From 9b25f2498568ebd4dceb1cca3c592043b4d654e2 Mon Sep 17 00:00:00 2001 From: Ger Hobbelt Date: Sun, 14 Apr 2019 18:38:21 +0200 Subject: [PATCH] - fix issue #43: large sets of unnecessary files were included in the published npm package :-1: - `packages/...` are included in the subsequent releases for use by advanced ES20xx-based tools. --- .gitignore | 59 ++++++++++++++++++++++++++-------------- .npmignore | 80 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 86 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index 395117768..b71bdaa57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,22 @@ +## WARNING ## WARNING ## WARNING ## WARNING ## WARNING +## +## Looks like npm (and git?) has a bug on Windows where the fnmatch pattern with trailing slash, e.g. `output/` +## doesn't work for subdirectories, while the same pattern *without* the trailing slash *does* work for +## filtering directories (behaviour like `**/tmp/` but git and npm supports a different set of glob patterns) +## +## Commandline to observe this behaviour (on Windows dev box): +## +## npm pack && tar ftv *.tgz | grep tests +## +## Edit the ignore file to edit the `tests` line further below with or without trailing `/` to observe the +## buggy behaviour. +## +## WARNING ## WARNING ## WARNING ## WARNING ## WARNING ## Dependency directory ## Commenting this out is preferred by some people, see ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git -node_modules/ +node_modules ## Google Closure Compiler install directory gcc/ @@ -20,46 +34,49 @@ gcc/ # more npm dung npm-debug.log +*.tgz # Editor backup files *.bak *~ +*.xxx # Generated web content directories (nanoc output) -web/tmp/ +web/tmp web/crash.log # ignore the compiler output for any examples: -/examples/output -/packages/jison-lex/examples/output -/docs/examples/output -/docs/examples/reference-output +examples/output +docs/examples/reference-output # Vagrant sandbox -vagrant/ +vagrant Vagrantfile # scratch space -/tmp/ -/book-using-jison-beyond-the-basics/base-materials/ +#tmp/ +#---^ see WARNING at the top of this file! +tmp +tmp2 +/book-using-jison-beyond-the-basics/base-materials *.log *.patch # istanbul / nyc code coverage analysis workspaces -/.nyc_output -/coverage -/packages/helpers-lib/coverage -/packages/jison-lex/coverage -/packages/json2jison/coverage -/packages/jison2json/coverage -/packages/lex-parser/coverage -/packages/ebnf-parser/coverage -/examples/coverage/ +.nyc_output +# ignore all coverage report directories anywhere +coverage # additional crap thast shouldn't land in git repo or npm: -/tmp*/ +tmp* /test*.* /issue*.* -/examples/formula-v*.* -/docs/examples/formula-v*.* +/dump* +/*bug* +/examples/formula-v* +/docs/examples/formula-v* +profile*.txt +/include.lex + + diff --git a/.npmignore b/.npmignore index 86d66ca3a..45ed9c51d 100644 --- a/.npmignore +++ b/.npmignore @@ -1,8 +1,22 @@ +## WARNING ## WARNING ## WARNING ## WARNING ## WARNING +## +## Looks like npm (and git?) has a bug on Windows where the fnmatch pattern with trailing slash, e.g. `output/` +## doesn't work for subdirectories, while the same pattern *without* the trailing slash *does* work for +## filtering directories (behaviour like `**/tmp/` but git and npm supports a different set of glob patterns) +## +## Commandline to observe this behaviour (on Windows dev box): +## +## npm pack && tar ftv *.tgz | grep tests +## +## Edit the ignore file to edit the `tests` line further below with or without trailing `/` to observe the +## buggy behaviour. +## +## WARNING ## WARNING ## WARNING ## WARNING ## WARNING ## Dependency directory ## Commenting this out is preferred by some people, see ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git -node_modules/ +node_modules ## Google Closure Compiler install directory gcc/ @@ -16,61 +30,60 @@ gcc/ #*.pdf # do not publish 50mb of documentation -docs/ - -# Ignore the monorepo subpackages directory as the dist/ files do not need them and those should be published separately -packages/ +docs # Apple Crap .DS_Store # more npm dung npm-debug.log +*.tgz # Editor backup files *.bak *~ +*.xxx # Generated web content directories (nanoc output) -web/tmp/ +web/tmp web/crash.log # ignore the compiler output for any examples: -/examples/output -/packages/jison-lex/examples/output -/docs/examples/output -/docs/examples/reference-output +examples/output +docs/examples/reference-output # Vagrant sandbox -vagrant/ +vagrant Vagrantfile # scratch space -/tmp/ -/book-using-jison-beyond-the-basics/base-materials/ +#tmp/ +#---^ see WARNING at the top of this file! +tmp +tmp2 +/book-using-jison-beyond-the-basics/base-materials *.log *.patch # istanbul / nyc code coverage analysis workspaces -/.nyc_output -/coverage -/packages/helpers-lib/coverage -/packages/jison-lex/coverage -/packages/json2jison/coverage -/packages/jison2json/coverage -/packages/lex-parser/coverage -/packages/ebnf-parser/coverage -/examples/coverage/ +.nyc_output +# ignore all coverage report directories anywhere +coverage # additional crap thast shouldn't land in git repo or npm: -/tmp*/ +tmp* /test*.* /issue*.* -/examples/formula-v*.* -/docs/examples/formula-v*.* +/dump* +/*bug* +/examples/formula-v* +/docs/examples/formula-v* +profile*.txt +/include.lex + # Ignore the web directory, i.e. the web pages -web/ +web # Ignore build/publish scripts, etc. git-tag-and-bump-and-rebuild.sh @@ -82,19 +95,22 @@ Makefile # misc files which are used during development Vagrantfile __patch_*.js -/modules/ +modules # extra documentation (WIP) -book-using-jison-beyond-the-basics/ +book-using-jison-beyond-the-basics book.json .bookignore # no examples wanted -/examples/ +examples + +# all test sets & test rigs +#tests/ +#-----^ see WARNING at the top of this file! +tests -# test set & test rig -/tests/ -/test-npm-install/ +test-npm-install # jscs et al config files: .js*