731fdf82c0 fixed the
deprecation warning in cockpit-po-plugin:
> node:37175) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning:
> Compilation.assets will be frozen in future, all modifications are
> deprecated.
> BREAKING CHANGE: No more changes should happen to Compilation.assets
> after sealing the Compilation.
The tests switch to German, make sure that the corresponding locale
exists. Otherwise, tests will run into unexpected messages like "invalid
or unusable locale: de_DE.UTF-8".
Bring back terser-webpack-plugin from commit c52136c051 and re-enable
it. It builds the autogenerated dist/index.js.LICENSE.txt which is quite
important for shipping distribution packages -- c-{podman,machines} both
do this.
Backport 95021c336e
to make sure that the webpack for the release tarball is *actually*
built in production mode.
We don't need to explicitly mention TerserJSPlugin any more (from commit
6b8611), as webpack 5 can now extend the `minimizer:` list with the
special `...` syntax.
This gets rid of several `npm install` warnings:
deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
as well as 10 MB of node_modules.
Fixes these `npm install` warnings:
> deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
> deprecated eslint-loader@4.0.2: This loader has been deprecated. Please use eslint-webpack-plugin
This works better with the current eslint loader, as then eslint and
babel can look at the same configuration. See
<https://babeljs.io/docs/en/config-files>.
This is similar to .eslintrc.json.
This code comes from cockpit.git. Newer ESLint versions have a lot of
complaints about it, but in starter-kit we can't do anything about these
directly. Let's keep the stricter ESLint settings instead of ignoring a
lot more warnings to cover src/lib.
Teach `make dist-gzip` to print the tarball name as last line, and use
it as `create-archive` action.
Add a `make print-version` command which packit can use. The builtin
default only works if there is at least one git tag, which is not the
case for starter-kit (which is never released).
Copy and adjust the browser.sh and run-test.sh scripts from
cockpit-podman, which we have used in Fedora/RHEL dist-git gating and
packit tests for a while.
This field was introduced in
https://github.com/cockpit-project/cockpit/pull/4964 as "purely
informational for now", and isn't even parsed by cockpit.
package.json's version would only be relevant for publishing NPM
modules, but cockpit pages are not that.
Neither starter-kit itself nor our derived projects like cockpit-podman
or cockpit-composer have ever maintained these two fields, so just get
rid of them.
This makes the git tag the single source of truth for the version
number.
Fixes#200
It currently reacts to /livetest comments on PRs and builds cockpit from
the PR's checkout. Then serves it on logs.cockpit-project.org on a port
specified on a follow-up comment to the /livetest.
Cockpit developers can now utilize this workflow to review a PR without
having to pull and compile the code locally.
Without that, `npm run watch` is entirely silent after the first build,
and does not give any feedback when a build starts, and even more
importantly, when it's done.
This avoids the lengthy (and potentially brittle) installation of
dependencies and having to create an unprivileged user.
Since [1] the tasks container can now fix /dev/kvm permissions.
[1] https://github.com/cockpit-project/cockpituous/pull/366
Travis stopped handing out free credits since their plan changes last
November, so tests have not run since then.
Cirrus CI offers an API similar to Travis, and also explicitly supports
/dev/kvm access.
Eventually we want to use the cockpit/tasks container directly. But we
can't fix the /dev/kvm permissions inside that as `sudo` does not work
in that. Once we fix that, the setup will become much cheaper and
simpler.
Drop the cockpit-po-plugin.js and sassc-loader.js code copies, and check
them out from a stable cockpit tag, similarly to how we already get the
PatternFly CSS.
Convert the `po2json` script into a webpack plugin, and integrate the
(now trivial) po.empty.js template.
This is the last step for building the entire dist/ directory with
`npm run build` (i.e. a tool that web developers are familiar with),
and not having a split webpack+make toolchain any more.
`this.po` is not being used anywhere, so drop the whole `!loaded` code
path. There is no defer mechanism, so `po.js` *must* be loaded after
cockpit.js. Let's trigger a crash instead of silently dropping
translations, to make such a bug obvious in manual and automatic tests.
The output file is an option, not a positional argument.
`opts.args` is undefined if there are no positional arguments, so that
just calling `po/po2json` crashed with
TypeError: Cannot read property 'length' of undefined
Similarly to commit cbedf06704, provide default values, so that
`po2json po/de.po` does not error out with
Option "--module" requires 1 arguments, but 0 were provided
f1542d54db rewrote
the language selector dialog. Update the tests to also work with
cockpit ≥ 233.
Do the version comparison dynamically for the time being, as this breaks
several image refreshes. We can drop this again and only use the new
code once all of these landed.
Otherwise there is just too much noise and when something is broken, the
error is above 3 pages of pointless logs.
See https://webpack.js.org/configuration/stats/
Cherry-picked from cockpit-podman commit 5989b20a05a.