Skip to content

Commit

Permalink
Merge branch 'pnpm'
Browse files Browse the repository at this point in the history
* pnpm:
  MISC: config-checks.mk: remove unused NPM_INSTALL
  Makefile.mk: save XNPM to defaults and use it to install node_modules/
  MISC: config-checks.mk: check for pnpn, provide as $(XNPM)
  UI: Makefile.mk: fetch Lit version directly from node_modules/lit/package.json
  X11TEST: ereplay.cjs: set timeout to 2500 to allow click durations of 2200ms

Signed-off-by: Tim Janik <[email protected]>
  • Loading branch information
tim-janik committed Oct 24, 2023
2 parents 1c7da51 + b047e20 commit f1b37e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ include misc/config-utils.mk
include misc/config-uname.mk
include misc/config-checks.mk
include misc/config-external.mk
.config.defaults += CC CFLAGS CXX CLANG_TIDY CXXFLAGS LDFLAGS LDLIBS
.config.defaults += CC CFLAGS CXX CLANG_TIDY CXXFLAGS LDFLAGS LDLIBS XNPM

# == ls-tree.lst ==
# Requires either git or a pre-packaged `ls-tree.lst` file
Expand Down Expand Up @@ -251,11 +251,9 @@ $>/node_modules/.npm.done: $(if $(NPMBLOCK),, $>/package.json) | $>/
@: # Install all node_modules and anonymize build path
$Q cd $>/ \
&& { POFFLINE= && test ! -d node_modules/ || POFFLINE=--prefer-offline ; } \
&& $(NPM_INSTALL) $$POFFLINE \
&& $(XNPM) install $$POFFLINE \
&& find . -name package.json -print0 | xargs -0 sed -r "\|$$PWD|s|^(\s*(\"_where\":\s*)?)\"$$PWD|\1\"/...|" -i
$Q: # add newer nodejs API to browserify-url.js, needed for e.g. postcss error messages
$Q grep pathToFileURL $>/node_modules/url/url.js || \
echo 'exports.pathToFileURL = _ => _;' >> $>/node_modules/url/url.js
$Q touch $@
NODE_PATH ::= $(abspath $>/node_modules/)
export NODE_PATH
Expand Down
4 changes: 3 additions & 1 deletion misc/config-checks.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ GDK_PIXBUF_CSOURCE ?= gdk-pixbuf-csource
IMAGEMAGICK_CONVERT ?= convert
PANDOC ?= pandoc
CP ?= cp --reflink=auto
NPM_INSTALL ?= npm install $(if $(PARALLEL_MAKE), --progress=false)
.config.defaults += CP PERL PYTHON3 PKG_CONFIG GDK_PIXBUF_CSOURCE PANDOC IMAGEMAGICK_CONVERT
HAVE_PANDOC1 = $(shell $(PANDOC) --version | grep -q '^pandoc 1\.' && echo 1)

Expand Down Expand Up @@ -113,6 +112,9 @@ $>/config-cache.mk: misc/config-checks.mk misc/version.sh $(GITCOMMITDEPS) | $>/
$Q echo '# make $@' > $@.tmp
$Q echo "ANKLANG_GETTEXT_DOMAIN ::=" \
'anklang-$$(version_short)' >>$@.tmp
$Q pnpm --version 2>&1 | grep -qE '^([89]|[1-9]+[0-9]+)\.[0-9]+\.[0-9]+$$' \
&& echo 'XNPM ::= pnpm' >>$@.tmp \
|| echo 'XNPM ::= npm' >>$@.tmp
$Q GTK2_CFLAGS=$$($(PKG_CONFIG) --cflags $(GTK2_PACKAGES)) \
&& echo "GTK2_CFLAGS ::= $$GTK2_CFLAGS" >>$@.tmp
$Q GTK2_LIBS=$$($(PKG_CONFIG) --libs $(GTK2_PACKAGES)) \
Expand Down
3 changes: 2 additions & 1 deletion ui/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ $>/ui/index.html: ui/index.html $>/ui/global.css $>/ui/vue-styles.css $>/node_mo
$(QGEN)
$Q rm -f $>/ui/doc && ln -s ../doc $>/ui/doc # do here, b/c MAKE is flaky in tracking symlink timestamps
$Q echo ' { "config": { $(strip $(PACKAGE_VERSIONS)),' > $>/ui/config.json
$Q (cd $>/ && npm list) | sed -nr '/ lit@/{s/.*@(.*)/ "lit_version": "\1" /;p}' >>$>/ui/config.json
$Q sed -nr '/^ *"version":/{s/.*: *"(.*)",/ "lit_version": "\1" /;p}' \
$>/node_modules/lit/package.json >>$>/ui/config.json
$Q echo ' } }' >>$>/ui/config.json
$Q sed -r \
-e "/<script type='application\/json' id='--EMBEDD-config_json'>/ r $>/ui/config.json" \
Expand Down
2 changes: 1 addition & 1 deletion x11test/ereplay.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const puppeteer = require ("puppeteer-core");
const { createRunner, parse, PuppeteerRunnerExtension } = require ('@puppeteer/replay');

// Maximum timeout per step
const TIMEOUT = 1500;
const TIMEOUT = 2500;
// Delay per step, too fast replay interferes with animations
const DELAY = 101;

Expand Down

0 comments on commit f1b37e4

Please sign in to comment.