Generalize bundler language/variable names
These changes are not specific to webpack, but apply to other bundlers as well.
This commit is contained in:
parent
4990d6a103
commit
cd6b2afc15
3 changed files with 14 additions and 14 deletions
18
Makefile
18
Makefile
|
|
@ -14,14 +14,14 @@ APPSTREAMFILE=org.cockpit-project.$(PACKAGE_NAME).metainfo.xml
|
||||||
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
|
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
|
||||||
# stamp file to check for node_modules/
|
# stamp file to check for node_modules/
|
||||||
NODE_MODULES_TEST=package-lock.json
|
NODE_MODULES_TEST=package-lock.json
|
||||||
# one example file in dist/ from webpack to check if that already ran
|
# one example file in dist/ from bundler to check if that already ran
|
||||||
WEBPACK_TEST=dist/manifest.json
|
DIST_TEST=dist/manifest.json
|
||||||
# one example file in pkg/lib to check if it was already checked out
|
# one example file in pkg/lib to check if it was already checked out
|
||||||
COCKPIT_REPO_STAMP=pkg/lib/cockpit-po-plugin.js
|
COCKPIT_REPO_STAMP=pkg/lib/cockpit-po-plugin.js
|
||||||
# common arguments for tar, mostly to make the generated tarballs reproducible
|
# 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
|
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;
|
# 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
|
# 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
|
%.spec: packaging/%.spec.in
|
||||||
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
|
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
|
NODE_ENV=$(NODE_ENV) node_modules/.bin/webpack
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
NODE_ENV=$(NODE_ENV) node_modules/.bin/webpack --watch
|
NODE_ENV=$(NODE_ENV) npm run watch
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
rm -f $(SPEC)
|
rm -f $(SPEC)
|
||||||
rm -f po/LINGUAS
|
rm -f po/LINGUAS
|
||||||
|
|
||||||
install: $(WEBPACK_TEST) po/LINGUAS
|
install: $(DIST_TEST) po/LINGUAS
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME)
|
mkdir -p $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME)
|
||||||
cp -r dist/* $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME)
|
cp -r dist/* $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME)
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/share/metainfo/
|
mkdir -p $(DESTDIR)$(PREFIX)/share/metainfo/
|
||||||
|
|
@ -100,7 +100,7 @@ install: $(WEBPACK_TEST) po/LINGUAS
|
||||||
-o $(DESTDIR)$(PREFIX)/share/metainfo/$(APPSTREAMFILE)
|
-o $(DESTDIR)$(PREFIX)/share/metainfo/$(APPSTREAMFILE)
|
||||||
|
|
||||||
# this requires a built source tree and avoids having to install anything system-wide
|
# 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
|
mkdir -p ~/.local/share/cockpit
|
||||||
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)
|
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)
|
||||||
|
|
||||||
|
|
@ -115,12 +115,12 @@ print-version:
|
||||||
dist: $(TARFILE)
|
dist: $(TARFILE)
|
||||||
@ls -1 $(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
|
# 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
|
# pre-built dist/ (so it's not necessary) and ship package-lock.json (so that
|
||||||
# node_modules/ can be reconstructed if necessary)
|
# node_modules/ can be reconstructed if necessary)
|
||||||
$(TARFILE): export NODE_ENV=production
|
$(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
|
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)/,' \
|
tar --xz $(TAR_ARGS) -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \
|
||||||
--exclude packaging/$(SPEC).in --exclude node_modules \
|
--exclude packaging/$(SPEC).in --exclude node_modules \
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ your browser.
|
||||||
|
|
||||||
You can also use
|
You can also use
|
||||||
[watch mode](https://webpack.js.org/guides/development/#using-watch-mode) to
|
[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
|
$ npm run watch
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ or
|
||||||
|
|
||||||
$ make watch
|
$ 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 code changes by setting the `RSYNC` environment variable to
|
||||||
the remote hostname.
|
the remote hostname.
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ remove manually the symlink:
|
||||||
Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check
|
Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check
|
||||||
JavaScript code style in `.js` and `.jsx` files.
|
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:
|
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
|
Cockpit uses [Stylelint](https://stylelint.io/) to automatically check CSS code
|
||||||
style in `.css` and `scss` files.
|
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:
|
For developer convenience, the Stylelint can be started explicitly by:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ Cockpit Starter Kit Example Module
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name} -a 1
|
%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
|
# but keep it in RHEL/CentOS-8, as that has a too old nodejs
|
||||||
%if ! 0%{?rhel} || 0%{?rhel} >= 9
|
%if ! 0%{?rhel} || 0%{?rhel} >= 9
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue