Taken rules from Cockpit, which have been proven to be effective for
finding bugs and keeping clean code, and sensible (not taking
unreasonable effort to satisfy).
Fix code layout in app.jsx accordingly.
Closes#39
eslint is much more powerful and flexible than jshint, and we don't want
to promote writing new projects with pre-ES6 code.
As a side effect, this also avoids downloading PhantomJS (see
https://github.com/jshint/jshint/issues/3318), thereby cutting down
node_modules/ from 470 MB to 210 MB.
- Entirely drop `%build` section, as there is nothing to do anyway.
- Use `%make_install` macro.
- Replace the complicated file list wrangling with a simple directory
enumeration.
Thanks to Igor Gnatenko for the suggestions!
See https://bugzilla.redhat.com/show_bug.cgi?id=1603146Closes#38
Our release tarballs only contain files, not their containing
directories, due to `git ls-files`. tar creates these directories on the
fly on unpack, with a current timestamp instead of an archived one. This
causes directories in src/ to be newer than dist/ and thus a `make` will
try to rebuild the webpack. This breaks RPM builds.
Release tarballs already have dist/. We can't rebuild the webpack in an
RPM as that requires npm and network access for `npm install`. But we
also don't want to ship the entire `node_modules/` as that is huge and
would require lots of careful license review.
So ship a stub node_modules/ that satisfies the Makefile dependency.
Make sure that this is not newer than package.json or anything in dist/,
so that none of the Makefile's rebuild rules trigger.
Closes#36
When building in production mode, there is no index.js, just an
index.min.js.gz. This previously caused unnecessary rebuilds, or even
RPM build failures in environments where npm was not available. Test for
index.html instead, which is reliable.
Also factor this out into a constant to make it easier to adjust in
forked projects.
This is easier to handle downstream, as the spec file can be used as-is,
instead of having to get rebuilt.
Adjust the clean rule to only remove the .spec if the .spec.in exists,
so that it gets removed in the upstream git, but not in unpacked release
tarball trees.
Building the *.po files requires the `po2json` module, so add a
dependency to it.
Put the example node module into a variable to avoid repeating it. Also
test for `po2json` instead of `react-lite`, as the latter is more likely
to get replaced by actual projects in favor of the full React.
Closes#33
Vagrant defaults to nfs on linux, which requires root rights and changes
nfs configuration. The rsync backend is much less invasive, but needs
manual triggering (at least `vagrant rsync-auto`).
Closes#29
Rename some files and change some identifiers to be neutral to the
application name. This makes it simpler to change everything to a proper
name when cloning this project.
Document in the README how to find the remaining places to change.
Closes#20
With this one does not need to type the full path to the VM. This is
useful to demonstrate how to use other test frameworks than cockpit's
test API.
Closes#19
Cockpit's testlib.py has no stable API guarantee, so check it out from a
stable tag instead of master. This should occasionally be bumped to stay
current.
Note that the same does not apply to bots/: Stable tags are useless
there as the old images get cleaned up. Also, testvm.py API needs to be
stable for Cockpit's own purposes already.
This needs to drop the slight git checkout optimization, but this also
makes the code more symmetric and easier to understand.
Closes#18
Don't always rebuild on "make" (in the phony "all" target), but
introduce a real file target dist/index.js and its requisites. This gets
rid of the "install-only" target, which is very non-standard and would
not on an unbuilt tree anyway.
Also add a "devel-install" target that does the usual symlinking of the
built source tree into ~/.local/share/cockpit.
Closes#17
This makes sure we always include all files in the repository when
disting.
Obsoletes webpack-with-stats, which had a bug anyway: it wasn't
reporting jslint errors.
This moves us one step closer to a normal source package. The sources
are now unpacked and we run "make install". We still don't build
since we don't have all the necessary tools.
Also, most importantly, the source tarball now includes our actual
sources in addition to the prebuilt binaries.