mauriciopoppe / function-plot

A 2d function plotter for the web
https://mauriciopoppe.github.io/function-plot/
MIT License
914 stars 112 forks source link

Build pipeline does not produce typescript declarations #273

Closed jorins closed 4 months ago

jorins commented 5 months ago

Hello! I was trying to build the package from main to resolve an issue in my codebase seemingly related to #270. I ran the following after checkout:

  1. npm install
  2. npm run build
  3. npm pack

To build the project. This produces the following pack list:

npm notice 
npm notice 📦  function-plot@1.24.0
npm notice === Tarball Contents === 
npm notice 1.1kB   LICENSE                                         
npm notice 3.0kB   README.md                                       
npm notice 42.4kB  dist/117.function-plot.js                       
npm notice 64.5kB  dist/117.function-plot.js.map                   
npm notice 3.8kB   dist/asyncIntervalEvaluator.function-plot.js    
npm notice 7.6kB   dist/asyncIntervalEvaluator.function-plot.js.map
npm notice 26.4kB  dist/chart.js                                   
npm notice 22.8kB  dist/chart.js.map                               
npm notice 607B    dist/datum-defaults.js                          
npm notice 577B    dist/datum-defaults.js.map                      
npm notice 2.6kB   dist/evaluate-datum.js                          
npm notice 2.5kB   dist/evaluate-datum.js.map                      
npm notice 1.9kB   dist/evaluate-datum.test.js                     
npm notice 3.3kB   dist/evaluate-datum.test.js.map                 
npm notice 138.1kB dist/function-plot.js                           
npm notice 234.0kB dist/function-plot.js.map                       
npm notice 1.2kB   dist/globals.mjs                                
npm notice 1.1kB   dist/globals.mjs.map                            
npm notice 221B    dist/graph-types/index.js                       
npm notice 300B    dist/graph-types/index.js.map                   
npm notice 4.1kB   dist/graph-types/interval.js                    
npm notice 4.1kB   dist/graph-types/interval.js.map                
npm notice 3.3kB   dist/graph-types/polyline.js                    
npm notice 3.1kB   dist/graph-types/polyline.js.map                
npm notice 2.2kB   dist/graph-types/scatter.js                     
npm notice 2.2kB   dist/graph-types/scatter.js.map                 
npm notice 1.4kB   dist/graph-types/text.js                        
npm notice 1.6kB   dist/graph-types/text.js.map                    
npm notice 44B     dist/graph-types/types.js                       
npm notice 117B    dist/graph-types/types.js.map                   
npm notice 3.0kB   dist/helpers/annotations.js                     
npm notice 3.1kB   dist/helpers/annotations.js.map                 
npm notice 2.6kB   dist/helpers/derivative.js                      
npm notice 2.4kB   dist/helpers/derivative.js.map                  
npm notice 425B    dist/helpers/index.js                           
npm notice 538B    dist/helpers/index.js.map                       
npm notice 3.0kB   dist/helpers/secant.js                          
npm notice 3.2kB   dist/helpers/secant.js.map                      
npm notice 2.0kB   dist/index.js                                   
npm notice 1.6kB   dist/index.js.map                               
npm notice 3.7kB   dist/perf/interval-pipeline.js                  
npm notice 3.6kB   dist/perf/interval-pipeline.js.map              
npm notice 87B     dist/plugins/index.js                           
npm notice 173B    dist/plugins/index.js.map                       
npm notice 3.0kB   dist/plugins/zoom-box.js                        
npm notice 2.9kB   dist/plugins/zoom-box.js.map                    
npm notice 2.0kB   dist/polyfills.js                               
npm notice 1.2kB   dist/polyfills.js.map                           
npm notice 6.2kB   dist/samplers/builtIn.js                        
npm notice 6.6kB   dist/samplers/builtIn.js.map                    
npm notice 7.4kB   dist/samplers/builtIn.test.js                   
npm notice 7.9kB   dist/samplers/builtIn.test.js.map               
npm notice 3.6kB   dist/samplers/eval.mjs                          
npm notice 2.4kB   dist/samplers/eval.mjs.map                      
npm notice 207B    dist/samplers/index.js                          
npm notice 253B    dist/samplers/index.js.map                      
npm notice 4.9kB   dist/samplers/interval_worker_pool.js           
npm notice 4.5kB   dist/samplers/interval_worker_pool.js.map       
npm notice 7.2kB   dist/samplers/interval.js                       
npm notice 8.7kB   dist/samplers/interval.js.map                   
npm notice 5.0kB   dist/samplers/interval.test.js                  
npm notice 5.0kB   dist/samplers/interval.test.js.map              
npm notice 44B     dist/samplers/types.js                          
npm notice 114B    dist/samplers/types.js.map                      
npm notice 5.8kB   dist/tip.js                                     
npm notice 6.1kB   dist/tip.js.map                                 
npm notice 44B     dist/types.js                                   
npm notice 102B    dist/types.js.map                               
npm notice 2.4kB   dist/utils.mjs                                  
npm notice 3.2kB   dist/utils.mjs.map                              
npm notice 2.6kB   dist/utils.test.js                              
npm notice 3.2kB   dist/utils.test.js.map                          
npm notice 3.9kB   package.json                                    
npm notice === Tarball Details === 
npm notice name:          function-plot                           
npm notice version:       1.24.0                                  
npm notice filename:      function-plot-1.24.0.tgz                
npm notice package size:  199.4 kB                                
npm notice unpacked size: 716.0 kB                                
npm notice shasum:        2a7d24bbdfd48d480f683bc7b4d32e9342981695
npm notice integrity:     sha512-jJUmyx0UQZnhH[...]7r5NbpmxewDEw==
npm notice total files:   73                                      
npm notice 

Notably missing are declaration files. After some looking around I noticed that "declaration": true has been removed from tsconfig.json since 1.24. Re-adding declaration to tsconfig.json seems to fix this, although I'm having some other problems that are getting in the way of verifying the fix.

mauriciopoppe commented 5 months ago

Thank you for noticing this issue, I’m on vacation until the end of the month, I’ll take a look in February.

Best, Mauricio

On Thu, Jan 18, 2024 at 11:25 PM Jorin @.***> wrote:

Hello! I was trying to build the package from main to resolve an issue in my codebase seemingly related to #270 https://github.com/mauriciopoppe/function-plot/issues/270. I ran the following after checkout:

  1. npm install
  2. npm run build
  3. npm pack

To build the project. This produces the following pack list:

npm notice npm notice 📦 @.*** npm notice === Tarball Contents === npm notice 1.1kB LICENSE npm notice 3.0kB README.md npm notice 42.4kB dist/117.function-plot.js npm notice 64.5kB dist/117.function-plot.js.map npm notice 3.8kB dist/asyncIntervalEvaluator.function-plot.js npm notice 7.6kB dist/asyncIntervalEvaluator.function-plot.js.map npm notice 26.4kB dist/chart.js npm notice 22.8kB dist/chart.js.map npm notice 607B dist/datum-defaults.js npm notice 577B dist/datum-defaults.js.map npm notice 2.6kB dist/evaluate-datum.js npm notice 2.5kB dist/evaluate-datum.js.map npm notice 1.9kB dist/evaluate-datum.test.js npm notice 3.3kB dist/evaluate-datum.test.js.map npm notice 138.1kB dist/function-plot.js npm notice 234.0kB dist/function-plot.js.map npm notice 1.2kB dist/globals.mjs npm notice 1.1kB dist/globals.mjs.map npm notice 221B dist/graph-types/index.js npm notice 300B dist/graph-types/index.js.map npm notice 4.1kB dist/graph-types/interval.js npm notice 4.1kB dist/graph-types/interval.js.map npm notice 3.3kB dist/graph-types/polyline.js npm notice 3.1kB dist/graph-types/polyline.js.map npm notice 2.2kB dist/graph-types/scatter.js npm notice 2.2kB dist/graph-types/scatter.js.map npm notice 1.4kB dist/graph-types/text.js npm notice 1.6kB dist/graph-types/text.js.map npm notice 44B dist/graph-types/types.js npm notice 117B dist/graph-types/types.js.map npm notice 3.0kB dist/helpers/annotations.js npm notice 3.1kB dist/helpers/annotations.js.map npm notice 2.6kB dist/helpers/derivative.js npm notice 2.4kB dist/helpers/derivative.js.map npm notice 425B dist/helpers/index.js npm notice 538B dist/helpers/index.js.map npm notice 3.0kB dist/helpers/secant.js npm notice 3.2kB dist/helpers/secant.js.map npm notice 2.0kB dist/index.js npm notice 1.6kB dist/index.js.map npm notice 3.7kB dist/perf/interval-pipeline.js npm notice 3.6kB dist/perf/interval-pipeline.js.map npm notice 87B dist/plugins/index.js npm notice 173B dist/plugins/index.js.map npm notice 3.0kB dist/plugins/zoom-box.js npm notice 2.9kB dist/plugins/zoom-box.js.map npm notice 2.0kB dist/polyfills.js npm notice 1.2kB dist/polyfills.js.map npm notice 6.2kB dist/samplers/builtIn.js npm notice 6.6kB dist/samplers/builtIn.js.map npm notice 7.4kB dist/samplers/builtIn.test.js npm notice 7.9kB dist/samplers/builtIn.test.js.map npm notice 3.6kB dist/samplers/eval.mjs npm notice 2.4kB dist/samplers/eval.mjs.map npm notice 207B dist/samplers/index.js npm notice 253B dist/samplers/index.js.map npm notice 4.9kB dist/samplers/interval_worker_pool.js npm notice 4.5kB dist/samplers/interval_worker_pool.js.map npm notice 7.2kB dist/samplers/interval.js npm notice 8.7kB dist/samplers/interval.js.map npm notice 5.0kB dist/samplers/interval.test.js npm notice 5.0kB dist/samplers/interval.test.js.map npm notice 44B dist/samplers/types.js npm notice 114B dist/samplers/types.js.map npm notice 5.8kB dist/tip.js npm notice 6.1kB dist/tip.js.map npm notice 44B dist/types.js npm notice 102B dist/types.js.map npm notice 2.4kB dist/utils.mjs npm notice 3.2kB dist/utils.mjs.map npm notice 2.6kB dist/utils.test.js npm notice 3.2kB dist/utils.test.js.map npm notice 3.9kB package.json npm notice === Tarball Details === npm notice name: function-plot npm notice version: 1.24.0 npm notice filename: function-plot-1.24.0.tgz npm notice package size: 199.4 kB npm notice unpacked size: 716.0 kB npm notice shasum: 2a7d24bbdfd48d480f683bc7b4d32e9342981695 npm notice integrity: sha512-jJUmyx0UQZnhH[...]7r5NbpmxewDEw== npm notice total files: 73 npm notice

Notably missing are declaration files. After some looking around I noticed that "declaration": true has been removed https://github.com/mauriciopoppe/function-plot/compare/release-1.24...master#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0L10 from tsconfig.json since 1.24. Re-adding declaration to tsconfig.json seems to fix this, although I'm having some other problems that are getting in the way of verifying the fix.

— Reply to this email directly, view it on GitHub https://github.com/mauriciopoppe/function-plot/issues/273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMKWKWNHJKM3T3FCJBIT4LYPGONFAVCNFSM6AAAAABCBAS2MOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DSMJVGI4DMMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mauriciopoppe commented 5 months ago

I readded them in both the master and release-1.24 branches, you can use https://github.com/mauriciopoppe/function-plot/releases/tag/v1.24.1.

Thanks again for the report.

annieetang commented 5 months ago

Hello! I'm trying to use 1.24.1 and I'm getting this error when running npm install:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for function-plot@1.24.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Thanks for your help!

jorins commented 5 months ago

Hello! I'm trying to use 1.24.1 and I'm getting this error when running npm install:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for function-plot@1.24.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Thanks for your help!

1.24.1 is not published on npm as the published 1.24.0 should be identical; the difference is that declaration files were enabled in the project's tsconfig, and declarations are already published in the npm 1.24.0 package.

jorins commented 5 months ago

@mauriciopoppe thank you very much! Unfortunately I'm having issues including the library in a Next.js project and due to Next's vague errors, I cannot really say why. Hopefully I can return with a better explanation or write a PR at some point. I like your approach to this library, and I really want to make it work :)

mauriciopoppe commented 5 months ago

Apologies! I forgot to publish the package to npm, I'll do it tonight.

mauriciopoppe commented 4 months ago

I was busy last night, I’ll try to publish it tonight instead.

On Tue, Feb 6, 2024 at 4:18 PM Jorin @.***> wrote:

@mauriciopoppe https://github.com/mauriciopoppe thank you very much! Unfortunately I'm having issues including the library in a Next.js project and due to Next's vague errors, I cannot really say why. Hopefully I can return with a better explanation or write a PR at some point. I like your approach to this library, and I really want to make it work :)

— Reply to this email directly, view it on GitHub https://github.com/mauriciopoppe/function-plot/issues/273#issuecomment-1930766711, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMKWKTO3CPJFI3452SWO7TYSKM2NAVCNFSM6AAAAABCBAS2MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZQG43DMNZRGE . You are receiving this because you were mentioned.Message ID: @.***>

mauriciopoppe commented 4 months ago

The declarations should be available in https://github.com/mauriciopoppe/function-plot/releases/tag/v1.24.3

npm notice 📦  function-plot@1.24.3
npm notice === Tarball Contents ===
npm notice 1.1kB   LICENSE
npm notice 2.9kB   README.md
npm notice 4.8kB   dist/chart.d.ts
npm notice 25.3kB  dist/chart.js
npm notice 21.4kB  dist/chart.js.map
npm notice 125B    dist/datum-defaults.d.ts
npm notice 702B    dist/datum-defaults.js
npm notice 578B    dist/datum-defaults.js.map
npm notice 429B    dist/evaluate.d.ts
npm notice 2.0kB   dist/evaluate.js
npm notice 1.5kB   dist/evaluate.js.map
npm notice 206.1kB dist/function-plot.js
npm notice 341.6kB dist/function-plot.js.map
npm notice 678B    dist/globals.d.ts
npm notice 989B    dist/globals.js
npm notice 787B    dist/globals.js.map
npm notice 176B    dist/graph-types/index.d.ts
npm notice 700B    dist/graph-types/index.js
npm notice 264B    dist/graph-types/index.js.map
npm notice 236B    dist/graph-types/interval.d.ts
npm notice 4.2kB   dist/graph-types/interval.js
npm notice 3.8kB   dist/graph-types/interval.js.map
npm notice 236B    dist/graph-types/polyline.d.ts
npm notice 3.6kB   dist/graph-types/polyline.js
npm notice 3.0kB   dist/graph-types/polyline.js.map
npm notice 235B    dist/graph-types/scatter.d.ts
npm notice 2.5kB   dist/graph-types/scatter.js
npm notice 2.1kB   dist/graph-types/scatter.js.map
npm notice 232B    dist/graph-types/text.d.ts
npm notice 1.6kB   dist/graph-types/text.js
npm notice 1.5kB   dist/graph-types/text.js.map
npm notice 875B    dist/graph-types/types.d.ts
npm notice 110B    dist/graph-types/types.js
npm notice 117B    dist/graph-types/types.js.map
npm notice 267B    dist/helpers/annotations.d.ts
npm notice 3.1kB   dist/helpers/annotations.js
npm notice 3.0kB   dist/helpers/annotations.js.map
npm notice 238B    dist/helpers/derivative.d.ts
npm notice 2.9kB   dist/helpers/derivative.js
npm notice 2.3kB   dist/helpers/derivative.js.map
npm notice 191B    dist/helpers/eval.d.ts
npm notice 4.0kB   dist/helpers/eval.js
npm notice 2.3kB   dist/helpers/eval.js.map
npm notice 175B    dist/helpers/index.d.ts
npm notice 740B    dist/helpers/index.js
npm notice 482B    dist/helpers/index.js.map
npm notice 234B    dist/helpers/secant.d.ts
npm notice 3.3kB   dist/helpers/secant.js
npm notice 3.1kB   dist/helpers/secant.js.map
npm notice 1.5kB   dist/index.d.ts
npm notice 4.0kB   dist/index.js
npm notice 1.1kB   dist/index.js.map
npm notice 0B      dist/polyfills.d.ts
npm notice 2.0kB   dist/polyfills.js
npm notice 1.2kB   dist/polyfills.js.map
npm notice 95B     dist/samplers/builtIn.d.ts
npm notice 6.4kB   dist/samplers/builtIn.js
npm notice 6.5kB   dist/samplers/builtIn.js.map
npm notice 98B     dist/samplers/index.d.ts
npm notice 486B    dist/samplers/index.js
npm notice 189B    dist/samplers/index.js.map
npm notice 95B     dist/samplers/interval.d.ts
npm notice 5.2kB   dist/samplers/interval.js
npm notice 4.9kB   dist/samplers/interval.js.map
npm notice 404B    dist/samplers/types.d.ts
npm notice 110B    dist/samplers/types.js
npm notice 114B    dist/samplers/types.js.map
npm notice 315B    dist/tip.d.ts
npm notice 6.2kB   dist/tip.js
npm notice 6.0kB   dist/tip.js.map
npm notice 8.4kB   dist/types.d.ts
npm notice 110B    dist/types.js
npm notice 102B    dist/types.js.map
npm notice 734B    dist/utils.d.ts
npm notice 2.0kB   dist/utils.js
npm notice 2.0kB   dist/utils.js.map
npm notice 3.4kB   package.json
npm notice === Tarball Details ===
npm notice name:          function-plot
npm notice version:       1.24.3
npm notice filename:      function-plot-1.24.3.tgz
npm notice package size:  201.9 kB
npm notice unpacked size: 725.9 kB
npm notice shasum:        e8969d790ce23b3926b3d56c80f0084cbe62552f
npm notice integrity:     sha512-15oIzHTikiw7v[...]hlVzKYwTCwPbQ==
npm notice total files:   77
npm notice
function-plot-1.24.3.tgz
annieetang commented 4 months ago

thanks so much! I'm using the new "text" feature for GraphType, and I've been getting a build error. Any ideas on how to fix? I updated the package.json with v1.24.3

npm run build

> thermodynamics-cycle-visualization-frontend@0.0.0 build
> tsc && vite build

src/pages/carnot-page/plots.tsx:79:13 - error TS2322: Type '"text"' is not assignable to type '"polyline" | "interval" | "scatter" | undefined'.

79             graphType: 'text',
               ~~~~~~~~~

  node_modules/function-plot/dist/types.d.ts:126:5
    126     graphType?: 'polyline' | 'interval' | 'scatter';
            ~~~~~~~~~
    The expected type comes from property 'graphType' which is declared here on type 'FunctionPlotDatum'

src/pages/carnot-page/plots.tsx:85:13 - error TS2322: Type '"text"' is not assignable to type '"polyline" | "interval" | "scatter" | undefined'.

85             graphType: 'text',
               ~~~~~~~~~

  node_modules/function-plot/dist/types.d.ts:126:5
    126     graphType?: 'polyline' | 'interval' | 'scatter';
            ~~~~~~~~~
    The expected type comes from property 'graphType' which is declared here on type 'FunctionPlotDatum'
mauriciopoppe commented 4 months ago

@annieetang thanks for pointing it out, I added this to the master branch in https://github.com/mauriciopoppe/function-plot/commit/e63dfe1af56fb7346f6932e1302910875e8bd850#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410a but didn't backport it to the release-1.24 branch, I'll do that next

mauriciopoppe commented 4 months ago

I added the missing type in https://github.com/mauriciopoppe/function-plot/releases/tag/v1.24.4

annieetang commented 4 months ago

Thank you so so much!! Really appreciate all your help and quick communication as well :)

mauriciopoppe commented 4 months ago

No problem, fixed with https://github.com/mauriciopoppe/function-plot/releases/tag/v1.24.4