Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update polymer-analyzer's npm package files to eliminate demo and test baggage. #829

Merged
merged 5 commits into from
Jan 7, 2019

Conversation

usergenic
Copy link
Contributor

Ran a diff of npm pack output and here is a summary of the changes.

  • Before: 518 files, 2.1 MB
  • After: 341 files, 1.2 MB

A list of files no longer npm published after this update:

lib/demo/polymer-lint.d.ts
lib/demo/polymer-lint.js
lib/demo/polymer-lint.js.map
lib/test/analysis-format/analysis-format_test.d.ts
lib/test/analysis-format/analysis-format_test.js
lib/test/analysis-format/analysis-format_test.js.map
lib/test/analysis-format/generate-analysis_test.d.ts
lib/test/analysis-format/generate-analysis_test.js
lib/test/analysis-format/generate-analysis_test.js.map
lib/test/core/analysis-cache_test.d.ts
lib/test/core/analysis-cache_test.js
lib/test/core/analysis-cache_test.js.map
lib/test/core/analyzer_test.d.ts
lib/test/core/analyzer_test.js
lib/test/core/analyzer_test.js.map
lib/test/core/async-work-cache_test.d.ts
lib/test/core/async-work-cache_test.js
lib/test/core/async-work-cache_test.js.map
lib/test/core/cancelling-analysis_test.d.ts
lib/test/core/cancelling-analysis_test.js
lib/test/core/cancelling-analysis_test.js.map
lib/test/core/dependency-graph_test.d.ts
lib/test/core/dependency-graph_test.js
lib/test/core/dependency-graph_test.js.map
lib/test/core/utils_test.d.ts
lib/test/core/utils_test.js
lib/test/core/utils_test.js.map
lib/test/css/css-custom-property-scanner_test.d.ts
lib/test/css/css-custom-property-scanner_test.js
lib/test/css/css-custom-property-scanner_test.js.map
lib/test/css/css-parser_test.d.ts
lib/test/css/css-parser_test.js
lib/test/css/css-parser_test.js.map
lib/test/html/html-document_test.d.ts
lib/test/html/html-document_test.js
lib/test/html/html-document_test.js.map
lib/test/html/html-element-reference-scanner_test.d.ts
lib/test/html/html-element-reference-scanner_test.js
lib/test/html/html-element-reference-scanner_test.js.map
lib/test/html/html-import-scanner_test.d.ts
lib/test/html/html-import-scanner_test.js
lib/test/html/html-import-scanner_test.js.map
lib/test/html/html-parser_test.d.ts
lib/test/html/html-parser_test.js
lib/test/html/html-parser_test.js.map
lib/test/html/html-script-scanner_test.d.ts
lib/test/html/html-script-scanner_test.js
lib/test/html/html-script-scanner_test.js.map
lib/test/html/html-style-scanner_test.d.ts
lib/test/html/html-style-scanner_test.js
lib/test/html/html-style-scanner_test.js.map
lib/test/javascript/class-scanner_test.d.ts
lib/test/javascript/class-scanner_test.js
lib/test/javascript/class-scanner_test.js.map
lib/test/javascript/esutil_test.d.ts
lib/test/javascript/esutil_test.js
lib/test/javascript/esutil_test.js.map
lib/test/javascript/function-scanner_test.d.ts
lib/test/javascript/function-scanner_test.js
lib/test/javascript/function-scanner_test.js.map
lib/test/javascript/html-template-literal-scanner_test.d.ts
lib/test/javascript/html-template-literal-scanner_test.js
lib/test/javascript/html-template-literal-scanner_test.js.map
lib/test/javascript/javascript-export-scanner_test.d.ts
lib/test/javascript/javascript-export-scanner_test.js
lib/test/javascript/javascript-export-scanner_test.js.map
lib/test/javascript/javascript-import-scanner_test.d.ts
lib/test/javascript/javascript-import-scanner_test.js
lib/test/javascript/javascript-import-scanner_test.js.map
lib/test/javascript/javascript-parser_test.d.ts
lib/test/javascript/javascript-parser_test.js
lib/test/javascript/javascript-parser_test.js.map
lib/test/javascript/jsdoc_test.d.ts
lib/test/javascript/jsdoc_test.js
lib/test/javascript/jsdoc_test.js.map
lib/test/javascript/namespace-scanner_test.d.ts
lib/test/javascript/namespace-scanner_test.js
lib/test/javascript/namespace-scanner_test.js.map
lib/test/javascript/resolve-specifier-node_test.d.ts
lib/test/javascript/resolve-specifier-node_test.js
lib/test/javascript/resolve-specifier-node_test.js.map
lib/test/model/inline-document-descriptor_test.d.ts
lib/test/model/inline-document-descriptor_test.js
lib/test/model/inline-document-descriptor_test.js.map
lib/test/model/reference_test.d.ts
lib/test/model/reference_test.js
lib/test/model/reference_test.js.map
lib/test/model/warning_test.d.ts
lib/test/model/warning_test.js
lib/test/model/warning_test.js.map
lib/test/parser/document_test.d.ts
lib/test/parser/document_test.js
lib/test/parser/document_test.js.map
lib/test/polymer/behavior-scanner_test.d.ts
lib/test/polymer/behavior-scanner_test.js
lib/test/polymer/behavior-scanner_test.js.map
lib/test/polymer/css-import-scanner_test.d.ts
lib/test/polymer/css-import-scanner_test.js
lib/test/polymer/css-import-scanner_test.js.map
lib/test/polymer/dom-module-scanner_test.d.ts
lib/test/polymer/dom-module-scanner_test.js
lib/test/polymer/dom-module-scanner_test.js.map
lib/test/polymer/expression-scanner_test.d.ts
lib/test/polymer/expression-scanner_test.js
lib/test/polymer/expression-scanner_test.js.map
lib/test/polymer/polymer-core-feature_test.d.ts
lib/test/polymer/polymer-core-feature_test.js
lib/test/polymer/polymer-core-feature_test.js.map
lib/test/polymer/polymer-element_test.d.ts
lib/test/polymer/polymer-element_test.js
lib/test/polymer/polymer-element_test.js.map
lib/test/polymer/polymer-element-old-jsdoc_test.d.ts
lib/test/polymer/polymer-element-old-jsdoc_test.js
lib/test/polymer/polymer-element-old-jsdoc_test.js.map
lib/test/polymer/polymer-element-scanner_test.d.ts
lib/test/polymer/polymer-element-scanner_test.js
lib/test/polymer/polymer-element-scanner_test.js.map
lib/test/polymer/polymer2-element-scanner_test.d.ts
lib/test/polymer/polymer2-element-scanner_test.js
lib/test/polymer/polymer2-element-scanner_test.js.map
lib/test/polymer/polymer2-element-scanner_vanilla-elements_test.d.ts
lib/test/polymer/polymer2-element-scanner_vanilla-elements_test.js
lib/test/polymer/polymer2-element-scanner_vanilla-elements_test.js.map
lib/test/polymer/polymer2-element-scanner-old-jsdoc_test.d.ts
lib/test/polymer/polymer2-element-scanner-old-jsdoc_test.js
lib/test/polymer/polymer2-element-scanner-old-jsdoc_test.js.map
lib/test/polymer/polymer2-mixin-scanner_test.d.ts
lib/test/polymer/polymer2-mixin-scanner_test.js
lib/test/polymer/polymer2-mixin-scanner_test.js.map
lib/test/polymer/polymer2-mixin-scanner-old-jsdoc_test.d.ts
lib/test/polymer/polymer2-mixin-scanner-old-jsdoc_test.js
lib/test/polymer/polymer2-mixin-scanner-old-jsdoc_test.js.map
lib/test/polymer/pseudo-element-scanner_test.d.ts
lib/test/polymer/pseudo-element-scanner_test.js
lib/test/polymer/pseudo-element-scanner_test.js.map
lib/test/scanning/scan_test.d.ts
lib/test/scanning/scan_test.js
lib/test/scanning/scan_test.js.map
lib/test/test-utils.d.ts
lib/test/test-utils.js
lib/test/test-utils.js.map
lib/test/typescript/typescript-analyzer_test.d.ts
lib/test/typescript/typescript-analyzer_test.js
lib/test/typescript/typescript-analyzer_test.js.map
lib/test/typescript/typescript-import-scanner_test.d.ts
lib/test/typescript/typescript-import-scanner_test.js
lib/test/typescript/typescript-import-scanner_test.js.map
lib/test/typescript/typescript-preparser_test.d.ts
lib/test/typescript/typescript-preparser_test.js
lib/test/typescript/typescript-preparser_test.js.map
lib/test/url-loader/fs-url-loader_test.d.ts
lib/test/url-loader/fs-url-loader_test.js
lib/test/url-loader/fs-url-loader_test.js.map
lib/test/url-loader/indirect-url-resolver_test.d.ts
lib/test/url-loader/indirect-url-resolver_test.js
lib/test/url-loader/indirect-url-resolver_test.js.map
lib/test/url-loader/multi-url-loader_test.d.ts
lib/test/url-loader/multi-url-loader_test.js
lib/test/url-loader/multi-url-loader_test.js.map
lib/test/url-loader/multi-url-resolver_test.d.ts
lib/test/url-loader/multi-url-resolver_test.js
lib/test/url-loader/multi-url-resolver_test.js.map
lib/test/url-loader/package-url-resolver_test.d.ts
lib/test/url-loader/package-url-resolver_test.js
lib/test/url-loader/package-url-resolver_test.js.map
lib/test/url-loader/prefixed-url-loader_test.d.ts
lib/test/url-loader/prefixed-url-loader_test.js
lib/test/url-loader/prefixed-url-loader_test.js.map
lib/test/url-loader/redirect-resolver_test.d.ts
lib/test/url-loader/redirect-resolver_test.js
lib/test/url-loader/redirect-resolver_test.js.map
lib/test/url-loader/url-resolver_test.d.ts
lib/test/url-loader/url-resolver_test.js
lib/test/url-loader/url-resolver_test.js.map
lib/test/warning/warning-printer_test.d.ts
lib/test/warning/warning-printer_test.js
lib/test/warning/warning-printer_test.js.map

@justinfagnani
Copy link
Contributor

files seems to be generally prefered over .npmignore. I believe the files array can exclude paths with a ! prefix. Could we do the same by adding "!lib/demo" and "!lib/test"?

@usergenic
Copy link
Contributor Author

@justinfagnani You're right and it is way cleaner and easier to maintain. After confirming it works I've removed the .npmignore in favor of just using files to manage the npm published contents.

@usergenic
Copy link
Contributor Author

Note that LICENSE and README.md are apparently automatically included, no need to specify them in files (per https://docs.npmjs.com/files/package.json#files)

Certain files are always included, regardless of settings:

  • package.json
  • README
  • CHANGES / CHANGELOG / HISTORY
  • LICENSE / LICENCE
  • NOTICE

The file in the “main” field
README, CHANGES, LICENSE & NOTICE can have any case and extension.

@usergenic usergenic requested a review from aomarks January 7, 2019 19:47
@usergenic usergenic merged commit cc73463 into master Jan 7, 2019
@usergenic usergenic deleted the npmignore-analyzer branch January 7, 2019 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants