diff --git a/.eslintignore b/.eslintignore index 8faa0e3..85f5a45 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ node_modules/* -src/lib/* +pkg/lib/* diff --git a/.gitignore b/.gitignore index e45fe25..f02bb78 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ Test*FAIL* /bots test/common/ test/images/ -src/lib/ +pkg *.pot POTFILES* tmp/ diff --git a/Makefile b/Makefile index d817de0..0c9ff5b 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) 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 src/lib to check if it was already checked out -LIB_TEST=src/lib/cockpit-po-plugin.js +# one example file in pkg/lib to check if it was already checked out +LIB_TEST=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 @@ -35,10 +35,10 @@ po/$(PACKAGE_NAME).js.pot: --keyword=gettext:1,1t --keyword=gettext:1c,2,2t \ --keyword=ngettext:1,2,3t --keyword=ngettext:1c,2,3,4t \ --keyword=gettextCatalog.getString:1,3c --keyword=gettextCatalog.getPlural:2,3,4c \ - --from-code=UTF-8 $$(find src/ \( -name '*.js' -o -name '*.jsx' \) \! -path 'src/lib/*') + --from-code=UTF-8 $$(find src/ \( -name '*.js' -o -name '*.jsx' \)) po/$(PACKAGE_NAME).html.pot: $(NODE_MODULES_TEST) - po/html2po -o $@ $$(find src -name '*.html' \! -path 'src/lib/*') + po/html2po -o $@ $$(find src -name '*.html') po/$(PACKAGE_NAME).manifest.pot: $(NODE_MODULES_TEST) po/manifest2po src/manifest.json -o $@ @@ -111,7 +111,7 @@ $(TARFILE): $(WEBPACK_TEST) $(SPEC) touch dist/* tar --xz $(TAR_ARGS) -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \ --exclude packaging/$(SPEC).in --exclude node_modules \ - $$(git ls-files) src/lib package-lock.json $(SPEC) dist/ + $$(git ls-files) pkg/lib package-lock.json $(SPEC) dist/ $(NODE_CACHE): $(NODE_MODULES_TEST) tar --xz $(TAR_ARGS) -cf $@ node_modules @@ -187,7 +187,6 @@ $(LIB_TEST): git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 265; \ git checkout --force FETCH_HEAD -- pkg/lib; \ git reset -- pkg/lib' - mv pkg/lib src/ && rmdir -p pkg $(NODE_MODULES_TEST): package.json # if it exists already, npm install won't update it; force that so that we always get up-to-date packages diff --git a/src/index.js b/src/index.js index a0e5c45..2d90d61 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ * along with Cockpit; If not, see . */ -import "./lib/patternfly/patternfly-4-cockpit.scss"; +import "patternfly/patternfly-4-cockpit.scss"; import React from 'react'; import ReactDOM from 'react-dom'; @@ -29,7 +29,7 @@ import { Application } from './app.jsx'; * out of the dist/index.js and since it will maintain the order of the imported CSS, * the overrides will be correctly in the end of our stylesheet. */ -import "./lib/patternfly/patternfly-4-overrides.scss"; +import "patternfly/patternfly-4-overrides.scss"; import './app.scss'; document.addEventListener("DOMContentLoaded", function () { diff --git a/webpack.config.js b/webpack.config.js index 0745388..c1210ff 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,8 +7,8 @@ const TerserJSPlugin = require('terser-webpack-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const CompressionPlugin = require("compression-webpack-plugin"); const ESLintPlugin = require('eslint-webpack-plugin'); -const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin"); -const CockpitRsyncPlugin = require("./src/lib/cockpit-rsync-plugin"); +const CockpitPoPlugin = require("./pkg/lib/cockpit-po-plugin"); +const CockpitRsyncPlugin = require("./pkg/lib/cockpit-rsync-plugin"); /* A standard nodejs and webpack pattern */ const production = process.env.NODE_ENV === 'production'; @@ -47,11 +47,11 @@ if (production) { module.exports = { mode: production ? 'production' : 'development', resolve: { - modules: [ "node_modules", path.resolve(__dirname, 'src/lib') ], + modules: [ "node_modules", path.resolve(__dirname, 'pkg/lib') ], alias: { 'font-awesome': 'font-awesome-sass/assets/stylesheets' }, }, resolveLoader: { - modules: [ "node_modules", path.resolve(__dirname, 'src/lib') ], + modules: [ "node_modules", path.resolve(__dirname, 'pkg/lib') ], }, watchOptions: { ignored: /node_modules/,