Switch to package-lock.json and get rid of most npm stuff in the Makefile.

This commit is contained in:
ccd0 2019-04-06 13:24:19 -07:00
parent deb0e8bd0f
commit 4fba9ac05d
3 changed files with 13 additions and 39 deletions

View File

@ -30,7 +30,8 @@ If you're reporting a bug, the more detail you can give, the better. If I can't
- 4chan X is mostly written in [CoffeeScript](http://coffeescript.org/). If you're already familiar with Javascript, it doesn't take long to pick up.
- Edit the sources in the src/ directory (not the compiled scripts in builds/).
- Compile the script with: `make` (this should fetch needed dependencies automatically; if not, do an `npm install` first)
- Fetch needed dependencies with: `npm install`
- Compile the script with: `make`
- Install the compiled script (found in the testbuilds/ directory), and test your changes.
- Make sure you have set your name and email as you want them, as they will be published in your commit message:<br>`git config user.name yourname`<br>`git config user.email youremail`
- Commit your changes: `git commit -a`

View File

@ -15,15 +15,14 @@ else
endif
CP = $(call CAT,$<,$@)
npgoals := clean cleanrel cleanweb cleanfull withtests wrapped archives $(foreach i,1 2 3 4,bump$(i)) tag tagcommit beta stable web update updatehard
npgoals := clean cleanrel cleanweb cleanfull withtests archives $(foreach i,1 2 3 4,bump$(i)) tag tagcommit beta stable web update updatehard
ifneq "$(filter $(npgoals),$(MAKECMDGOALS))" ""
.NOTPARALLEL :
endif
coffee := $(BIN)coffee -c --no-header
coffee_deps := node_modules/coffee-script/package.json
template := node tools/template.js
template_deps := package.json tools/template.js node_modules/lodash.template/package.json node_modules/esprima/package.json
template_deps := package.json tools/template.js
# read name meta_name meta_distBranch meta_uploadPath
$(eval $(shell node tools/pkgvars.js))
@ -55,7 +54,7 @@ uses_tests_enabled := \
imports_src/globals/globals.js := \
version.json
imports_src/css/CSS.js := \
node_modules/font-awesome/package.json
node_modules/font-awesome/fonts/fontawesome-webfont.woff
imports_src/Monitoring/Favicon.coffee := \
src/meta/icon128.png
@ -104,22 +103,6 @@ all : default release
.events .events2 tmp testbuilds builds :
$(MKDIR)
ifneq "$(wildcard npm-shrinkwrap.json)" ""
.events/npm : npm-shrinkwrap.json | .events
npm install
echo -> $@
node_modules/%/package.json : .events/npm
$(if $(wildcard $@),,npm install && echo -> $<)
else
node_modules/%/package.json : package.json
npm install $(call QUOTE,$*@$(version_$*))
endif
.tests_enabled :
echo false> .tests_enabled
@ -137,7 +120,7 @@ endef
$(foreach s,$(sources),$(eval $(call check_source,$(subst $$,$$$$,$(s)))))
.events/compile : $(updates) $(template_deps) $(coffee_deps) tools/chain.js
.events/compile : $(updates) $(template_deps) tools/chain.js
node tools/chain.js $(call QUOTE, \
$(subst .events/,tmp/, \
$(if $(filter-out $(updates),$?), \
@ -154,7 +137,7 @@ $(dests) : .events/compile
&& echo -> $< \
)
tmp/eventPage.js : src/meta/eventPage.coffee $(coffee_deps) | tmp
tmp/eventPage.js : src/meta/eventPage.coffee | tmp
$(coffee) -o tmp src/meta/eventPage.coffee
tmp/LICENSE : LICENSE tools/newlinefix.js | tmp
@ -189,7 +172,7 @@ testbuilds/updates$1.json : src/meta/updates.json version.json $(template_deps)
testbuilds/$(name)$1.crx.zip : \
$(foreach f,$(crx_contents),testbuilds/crx$1/$(f)) \
package.json version.json tools/zip-crx.js node_modules/jszip/package.json
package.json version.json tools/zip-crx.js
node tools/zip-crx.js $1
testbuilds/$(name)$1.crx : $(foreach f,$(crx_contents),testbuilds/crx$1/$(f)) version.json tools/sign.sh | tmp
@ -214,7 +197,7 @@ testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip
builds/% : testbuilds/% | builds
$(CP)
test.html : README.md template.jst tools/markdown.js node_modules/markdown-it/package.json node_modules/markdown-it-anchor/package.json node_modules/lodash.template/package.json
test.html : README.md template.jst tools/markdown.js
node tools/markdown.js
index.html : test.html
@ -223,7 +206,7 @@ index.html : test.html
tmp/.jshintrc : src/meta/jshint.json tmp/declaration.js src/globals/globals.js $(template_deps) | tmp
$(template) $< $@
.events/jshint : $(dests) tmp/.jshintrc node_modules/jshint/package.json
.events/jshint : $(dests) tmp/.jshintrc
$(BIN)jshint $(call QUOTE, \
$(if $(filter-out $(dests),$?), \
$(dests), \
@ -263,7 +246,7 @@ distready : dist $(wildcard dist/* dist/*/*)
git push web $(meta_distBranch)
echo -> $@
.events2/push-store : .git/refs/tags/stable | .events2 distready node_modules/webstore-upload/package.json node_modules/request/package.json
.events2/push-store : .git/refs/tags/stable | .events2 distready
node tools/webstore.js
echo -> $@
@ -299,7 +282,6 @@ cleanweb :
cleanfull : clean cleanweb
$(RMDIR) .events2 dist node_modules
$(RM) npm-shrinkwrap.json
git worktree prune
withtests :
@ -307,10 +289,6 @@ withtests :
-$(MAKE)
echo false> .tests_enabled
wrapped : src/meta/npm-shrinkwrap.json
$(call CAT,$<,npm-shrinkwrap.json)
npm install
archives :
git fetch -n archives
git merge --no-commit -s ours archives/gh-pages
@ -326,7 +304,6 @@ $(foreach i,1 2 3 4,bump$(i)) :
tag :
git add builds
$(MAKE) cleanrel
$(MAKE) wrapped
$(MAKE) all
git diff --quiet -- builds
$(MAKE) tagcommit
@ -355,15 +332,11 @@ web : index.html distready
cd dist && git commit -am "Update web page."
update :
$(RM) npm-shrinkwrap.json
$(RM) package-lock.json
npm install --save-dev $(shell node tools/unpinned.js)
npm install
npm shrinkwrap --dev
$(call CAT,npm-shrinkwrap.json,src/meta/npm-shrinkwrap.json)
updatehard :
$(RM) npm-shrinkwrap.json
$(RM) package-lock.json
npm install --save-dev $(shell node tools/unpinned.js latest)
npm install
npm shrinkwrap --dev
$(call CAT,npm-shrinkwrap.json,src/meta/npm-shrinkwrap.json)