Commit graph

217 commits

Author SHA1 Message Date
Martin Pitt
8a73531374 Use full React instead of react-lite
This is the direction we are going in Cockpit, as react-lite falls
behind with API development and debuggability.

Closes #43
2018-08-29 00:40:16 +02:00
Martin Pitt
9fa5c6ab05 Properly initialize state of Application
This will otherwise crash with React 16.
2018-08-29 00:40:16 +02:00
Martin Pitt
842a380766 Move to webpack 4
This has uglification built in.

Closes #42
2018-08-29 00:37:18 +02:00
Martin Pitt
133badfa3d Enable a lot of eslint options and plugins
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
2018-08-28 22:57:52 +02:00
Martin Pitt
3922333029 Use eslint for everything
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.
2018-08-28 22:57:52 +02:00
Martin Pitt
da06135330 cockpituous-release: Show how to do Fedora uploads
Closes #40
2018-08-28 22:51:10 +02:00
Martin Pitt
b0fd338e4b Bump Cockpit test API to 176
No API changes.
2018-08-28 22:51:10 +02:00
Martin Pitt
959d743452 Drop Python3 build requirement
This is only being used for extracting the package name from package
json, to avoid having to duplicate it in `Makefile`.
But for only this purpose, Python 3 is rather heavyweight. It's also not
available on RHEL/CentOS 7.
2018-08-28 22:51:10 +02:00
Martin Pitt
0c7ff6a896 Fix license tag in spec file
https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
2018-08-28 22:51:10 +02:00
Martin Pitt
a26ef5d27c Simplify spec file
- 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=1603146

Closes #38
2018-08-02 10:16:49 -04:00
Martin Pitt
509547f502
Add minimal Cockpituous release script
This only builds a tarball and srpm, and shows a few other example.
Document the intent and point to the cockpituous docs.

Closes #37
2018-07-19 09:22:45 +02:00
Martin Pitt
0a7a0bfb59 Fix Makefile dependencies for directories in src/
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.
2018-07-19 09:11:07 +02:00
Martin Pitt
e9635620c5 spec: Don't try to rebuild webpack when building released tarballs
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
2018-07-19 09:11:07 +02:00
Martin Pitt
70c7242d9d Fix webpack result test in dist/
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.
2018-07-19 09:11:07 +02:00
Martin Pitt
d3b8811ac6 spec: Add missing python3 build dependency
Required for Makefile to determine the package name from the manifest.
2018-07-19 09:11:07 +02:00
Martin Pitt
d361bbd76c spec: Add %changelog stub
So that cockpituous' release-srpm can properly add the changelog from
the tag.
2018-07-19 09:11:07 +02:00
Martin Pitt
9af00423f4 Ship final spec file instead of template in release tarballs
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.
2018-07-19 09:11:07 +02:00
Martin Pitt
12f82a8b31 Makefile: Drop unused directory from clean rule 2018-07-19 09:11:07 +02:00
Martin Pitt
cc7f892897 spec: Fix Release 2018-07-19 09:11:07 +02:00
Lars Karlitski
7fa53fa3f5 Run npm install when package.json changed
Closes #34
2018-07-16 18:58:38 +02:00
Martin Pitt
3109cad8ca Fix make dist with parallel make
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
2018-07-16 17:56:34 +02:00
Martin Pitt
32e278b94f
Bump Cockpit test API to 172 (#32)
No API changes.
2018-07-12 08:01:41 +02:00
Martin Pitt
42579dcdc3 Run tests with Python 3
Bump Cockpit test API to 171 for this, which made the test API
bilingual.

Closes #31
2018-07-02 17:37:20 +02:00
Martin Pitt
78c613e2fa Bump Cockpit test API to 170
No API changes.

Closes #30
2018-06-27 10:49:28 +02:00
Lars Karlitski
a8978120fa vagrant: Use rsync backend for file sharing
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
2018-06-25 14:28:42 +02:00
Lars Karlitski
1d0a8d311f vagrant: Bump base box to fedora 28 2018-06-25 14:28:42 +02:00
Martin Pitt
f26741e269 Add git tag derived version to tarball and spec
Stop hardcoding the version in the spec file, and put the version into
dist tarballs.

Closes #27
2018-06-22 20:07:29 +02:00
Lars Karlitski
7260f5c01f Add scss example
Closes #26
2018-06-22 11:15:57 +02:00
Martin Pitt
47e02ef136 Add i18n for HTML and manifest 2018-06-19 18:09:57 +02:00
Martin Pitt
7ce7b2b40b Add i18n support
Make the "Running on.." string translatable and copy the extraction and
conversion of JSX and PO files from Cockpit.
2018-06-19 14:40:45 +02:00
Martin Pitt
21950771af Makefile: Drop hardcoded "starter-kit" references
We already parse the project name from the manifest.
2018-06-19 14:25:26 +02:00
Martin Pitt
5351885f5d README: Suggest running tests against Fedora 28 2018-06-19 14:25:26 +02:00
Martin Pitt
9da603a149 README: Drop bogus backticks 2018-06-19 14:25:26 +02:00
Martin Pitt
59bf8a5af0 README: Add some more documentation
* How to checkout the code
* How to run straight from the git tree
* Links to further reading

Closes #22
2018-05-09 18:41:57 +02:00
Martin Pitt
1edb6a070b Remove some instances of "starter kit"
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
2018-05-04 19:19:29 +02:00
Martin Pitt
26c7b80a19 Bump Cockpit test API to 167
No API changes.

Closes #21
2018-05-04 19:18:04 +02:00
Martin Pitt
b614b72939 build: Add a make vm convenience target
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
2018-03-28 13:00:38 +02:00
Martin Pitt
099ac621b2 test: Use test/common Cockpit API from latest stable tag
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
2018-03-10 14:54:40 +01:00
Martin Pitt
8e9cc58eef build: On-demand rebuilding and add "devel-install" target
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
2018-03-09 12:18:57 +01:00
Martin Pitt
931e1be3c3 Add integration test using Cockpit test API
Closes #16
2018-03-09 10:13:03 +01:00
Martin Pitt
c99c9e2d38 Makefile: Run npm install when necessary
Also mark phony targets as such.
2018-03-09 10:13:03 +01:00
Martin Pitt
baf392e7e8 gitignore: Add package-lock.json and release tarballs/rpms 2018-03-09 10:13:03 +01:00
Lars Karlitski
d616952c8c Add .travis.yml (#15) 2017-10-19 17:54:52 +02:00
Lars Karlitski
b348bee798 Remove temporary build directories (#13) 2017-10-19 17:54:36 +02:00
Lars Karlitski
03217f7fe8 Consistently name everything [cockpit-]starter-kit (#14) 2017-10-19 17:54:12 +02:00
Marius Vollmer
463f76a318 Use official "cockpit-manifest" launchable type
The "cockpit-package" type was only a proposal.

Fixes #7
Closes #12
2017-10-19 16:05:49 +02:00
Lars Karlitski
fb3ce721b2 Use proper es6 import syntax 2017-10-18 19:12:56 +02:00
Lars Karlitski
6bfe20fdcc Dist using git ls-files
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.
2017-10-18 19:12:56 +02:00
Lars Karlitski
bd26aeda57 Move and update documentation (#10)
Also remove yarn.lock to simplify getting started.
2017-10-18 16:47:48 +02:00
Lars Karlitski
8ff4b33bb5 Clean up StarterKit view
And show the contents of `/etc/hostname` to make sure cockpit.js is
loaded correctly.
2017-10-18 16:42:54 +02:00