From cd6b2afc1539d3d09598ff1638ad02fa79fad9a7 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 19 Feb 2023 10:41:10 +0100 Subject: [PATCH] Generalize bundler language/variable names These changes are not specific to webpack, but apply to other bundlers as well. --- Makefile | 18 +++++++++--------- README.md | 8 ++++---- packaging/cockpit-starter-kit.spec.in | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index b91bad5..6f4efb1 100644 --- a/Makefile +++ b/Makefile @@ -14,14 +14,14 @@ APPSTREAMFILE=org.cockpit-project.$(PACKAGE_NAME).metainfo.xml VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) # stamp file to check for node_modules/ NODE_MODULES_TEST=package-lock.json -# one example file in dist/ from webpack to check if that already ran -WEBPACK_TEST=dist/manifest.json +# one example file in dist/ from bundler to check if that already ran +DIST_TEST=dist/manifest.json # one example file in pkg/lib to check if it was already checked out COCKPIT_REPO_STAMP=pkg/lib/cockpit-po-plugin.js # common arguments for tar, mostly to make the generated tarballs reproducible TAR_ARGS = --sort=name --mtime "@$(shell git show --no-patch --format='%at')" --mode=go=rX,u+rw,a-s --numeric-owner --owner=0 --group=0 -all: $(WEBPACK_TEST) +all: $(DIST_TEST) # checkout common files from Cockpit repository required to build this project; # this has no API stability guarantee, so check out a stable tag when you start @@ -80,18 +80,18 @@ po/LINGUAS: %.spec: packaging/%.spec.in sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@ -$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP) $(shell find src/ -type f) package.json webpack.config.js +$(DIST_TEST): $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP) $(shell find src/ -type f) package.json webpack.config.js NODE_ENV=$(NODE_ENV) node_modules/.bin/webpack watch: - NODE_ENV=$(NODE_ENV) node_modules/.bin/webpack --watch + NODE_ENV=$(NODE_ENV) npm run watch clean: rm -rf dist/ rm -f $(SPEC) rm -f po/LINGUAS -install: $(WEBPACK_TEST) po/LINGUAS +install: $(DIST_TEST) po/LINGUAS mkdir -p $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME) cp -r dist/* $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME) mkdir -p $(DESTDIR)$(PREFIX)/share/metainfo/ @@ -100,7 +100,7 @@ install: $(WEBPACK_TEST) po/LINGUAS -o $(DESTDIR)$(PREFIX)/share/metainfo/$(APPSTREAMFILE) # this requires a built source tree and avoids having to install anything system-wide -devel-install: $(WEBPACK_TEST) +devel-install: $(DIST_TEST) mkdir -p ~/.local/share/cockpit ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME) @@ -115,12 +115,12 @@ print-version: dist: $(TARFILE) @ls -1 $(TARFILE) -# when building a distribution tarball, call webpack with a 'production' environment +# when building a distribution tarball, call bundler with a 'production' environment # we don't ship node_modules for license and compactness reasons; we ship a # pre-built dist/ (so it's not necessary) and ship package-lock.json (so that # node_modules/ can be reconstructed if necessary) $(TARFILE): export NODE_ENV=production -$(TARFILE): $(WEBPACK_TEST) $(SPEC) +$(TARFILE): $(DIST_TEST) $(SPEC) if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi tar --xz $(TAR_ARGS) -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \ --exclude packaging/$(SPEC).in --exclude node_modules \ diff --git a/README.md b/README.md index 37afbc8..e61e1fd 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ your browser. You can also use [watch mode](https://webpack.js.org/guides/development/#using-watch-mode) to -automatically update the webpack on every code change with +automatically update the bundle on every code change with $ npm run watch @@ -45,7 +45,7 @@ or $ make watch -When developing against a virtual machine, webpack can also automatically upload +When developing against a virtual machine, watch mode can also automatically upload the code changes by setting the `RSYNC` environment variable to the remote hostname. @@ -67,7 +67,7 @@ remove manually the symlink: Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check JavaScript code style in `.js` and `.jsx` files. -The linter is executed within every build as a webpack preloader. +eslint is executed within every build. For developer convenience, the ESLint can be started explicitly by: @@ -84,7 +84,7 @@ Rules configuration can be found in the `.eslintrc.json` file. Cockpit uses [Stylelint](https://stylelint.io/) to automatically check CSS code style in `.css` and `scss` files. -The linter is executed within every build as a webpack preloader. +styleint is executed within every build. For developer convenience, the Stylelint can be started explicitly by: diff --git a/packaging/cockpit-starter-kit.spec.in b/packaging/cockpit-starter-kit.spec.in index ad5539f..156bd5e 100644 --- a/packaging/cockpit-starter-kit.spec.in +++ b/packaging/cockpit-starter-kit.spec.in @@ -26,7 +26,7 @@ Cockpit Starter Kit Example Module %prep %autosetup -n %{name} -a 1 -# ignore pre-built webpack in release tarball and rebuild it +# ignore pre-built bundle in release tarball and rebuild it # but keep it in RHEL/CentOS-8, as that has a too old nodejs %if ! 0%{?rhel} || 0%{?rhel} >= 9 rm -rf dist