diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 30d98f3c..79d2891c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -41,3 +41,7 @@ jobs:
- name: Run tests
run: |
make test-ignore-warnings
+
+ - name: Run Javascript Tests
+ run: |
+ cd resources; make test
diff --git a/MANIFEST.in b/MANIFEST.in
index 7c60d292..0ff55560 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,11 +1,15 @@
-exclude Makefile *.cfg *.in *.nix *.sh *.conf *.js *.json Procfile .jshintrc *-mxdev.txt .installed.txt
+exclude Makefile *.cfg *.in *.nix *.sh *.conf *.js *.json Procfile .jshintrc *-mxdev.txt .installed.txt *.yaml *.ini
+global-exclude *.pyc
+global-exclude *.yarn-integrity
+global-exclude cypress.json
+global-exclude cypress/**/*
+global-exclude node_modules/**
+global-exclude resources/**
include *.py
include *.rst
include *.txt
include .coveragerc
include buildout.cfg
-include *.yaml
-include mx.ini
recursive-include images *.gif
recursive-include docs *.GPL
recursive-include docs *.bugfix
@@ -13,11 +17,4 @@ recursive-include docs *.gif
recursive-include docs *.md
recursive-include docs *.png
recursive-include docs *.rst
-prune src/collective/taxonomy/javascripts/node_modules/**/*
graft src
-exclude src/collective/taxonomy/javascripts/build/messages/src/js/components/*.json
-global-exclude *.pyc
-global-exclude *.yarn-integrity
-global-exclude cypress.json
-global-exclude cypress/**/*
-global-exclude node_modules/**
diff --git a/README.rst b/README.rst
index 0ecd2d3c..ef14c6a7 100644
--- a/README.rst
+++ b/README.rst
@@ -160,14 +160,33 @@ The languages allowed for the taxonomies are the languages defined in ``portal_l
Development
===========
-Run the app, run ``npm start`` in the ``javascripts`` directory.
-To make Plone use the development code, you need the ``NODE_ENV`` environment
-variable to be set to ``development``:
+All JS development resources are in the directory ``resources/js``.
+
+While making changes to these files you can:
+
+ 1. change to directory ``resources/``
+ 2. run ``make serve``
+
+This start a webpack development server at ``localhost:3000`` and serves the JS
+files live.
+
+Now start your Plone instance with
::
NODE_ENV=development bin/instance fg
+and the taxonomy controlpanel will use the files served from the webpack server.
+
+When you have finished your changes run:
+
+::
+ make test
+ make build
+
+this will build the resources and save it in ``src/collective/taxonomy/static/js``.
+
+
i18n
----
diff --git a/src/collective/taxonomy/javascripts/.babelrc b/resources/.babelrc
similarity index 100%
rename from src/collective/taxonomy/javascripts/.babelrc
rename to resources/.babelrc
diff --git a/src/collective/taxonomy/javascripts/.eslintignore b/resources/.eslintignore
similarity index 100%
rename from src/collective/taxonomy/javascripts/.eslintignore
rename to resources/.eslintignore
diff --git a/src/collective/taxonomy/javascripts/.eslintrc b/resources/.eslintrc
similarity index 87%
rename from src/collective/taxonomy/javascripts/.eslintrc
rename to resources/.eslintrc
index 3b347eab..57930cd2 100644
--- a/src/collective/taxonomy/javascripts/.eslintrc
+++ b/resources/.eslintrc
@@ -1,5 +1,5 @@
{
- "extends": "airbnb",
+ "extends": ["eslint:recommended"],
"parser": "babel-eslint",
"env": {
"browser": true,
@@ -7,10 +7,6 @@
"jquery": true,
"mocha": true
},
- "ecmaFeatures": {
- "jsx": true,
- "modules": true,
- },
"rules": {
"array-bracket-spacing": [2, "never"],
"no-redeclare": 0,
@@ -34,6 +30,6 @@
],
"globals": {
"__DEV__" : true,
- "expect": true,
+ "expect": true
}
}
diff --git a/src/collective/taxonomy/javascripts/.gitignore b/resources/.gitignore
similarity index 76%
rename from src/collective/taxonomy/javascripts/.gitignore
rename to resources/.gitignore
index a58134b4..4527eb19 100644
--- a/src/collective/taxonomy/javascripts/.gitignore
+++ b/resources/.gitignore
@@ -1,2 +1,3 @@
yarn-error.log
cypress/screenshots/
+stamp-yarn
diff --git a/resources/Makefile b/resources/Makefile
new file mode 100644
index 00000000..16665fd6
--- /dev/null
+++ b/resources/Makefile
@@ -0,0 +1,29 @@
+# Taxonomy JS Development
+
+YARN ?= npx yarn
+
+
+.PHONY: install
+stamp-yarn install:
+ $(YARN) install
+ touch stamp-yarn
+
+
+.PHONY:
+build: stamp-yarn
+ $(YARN) run build
+
+
+.PHONY:
+serve: stamp-yarn
+ $(YARN) run start
+
+
+.PHONY:
+test: stamp-yarn
+ $(YARN) run test
+
+
+.PHONY:
+lint: stamp-yarn
+ $(YARN) run lint
diff --git a/src/collective/taxonomy/javascripts/cypress.json b/resources/cypress.json
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress.json
rename to resources/cypress.json
diff --git a/src/collective/taxonomy/javascripts/cypress/fixtures/Centraal_Museum.png b/resources/cypress/fixtures/Centraal_Museum.png
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/fixtures/Centraal_Museum.png
rename to resources/cypress/fixtures/Centraal_Museum.png
diff --git a/src/collective/taxonomy/javascripts/cypress/fixtures/Kunsthal_KAdE.png b/resources/cypress/fixtures/Kunsthal_KAdE.png
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/fixtures/Kunsthal_KAdE.png
rename to resources/cypress/fixtures/Kunsthal_KAdE.png
diff --git a/src/collective/taxonomy/javascripts/cypress/fixtures/Musee_du_Louvre.png b/resources/cypress/fixtures/Musee_du_Louvre.png
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/fixtures/Musee_du_Louvre.png
rename to resources/cypress/fixtures/Musee_du_Louvre.png
diff --git a/src/collective/taxonomy/javascripts/cypress/fixtures/Zeeuws_Museum.png b/resources/cypress/fixtures/Zeeuws_Museum.png
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/fixtures/Zeeuws_Museum.png
rename to resources/cypress/fixtures/Zeeuws_Museum.png
diff --git a/src/collective/taxonomy/javascripts/cypress/fixtures/example.json b/resources/cypress/fixtures/example.json
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/fixtures/example.json
rename to resources/cypress/fixtures/example.json
diff --git a/src/collective/taxonomy/javascripts/cypress/integration/end_to_end.js b/resources/cypress/integration/end_to_end.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/integration/end_to_end.js
rename to resources/cypress/integration/end_to_end.js
diff --git a/src/collective/taxonomy/javascripts/cypress/plugins/index.js b/resources/cypress/plugins/index.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/plugins/index.js
rename to resources/cypress/plugins/index.js
diff --git a/src/collective/taxonomy/javascripts/cypress/support/commands.js b/resources/cypress/support/commands.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/support/commands.js
rename to resources/cypress/support/commands.js
diff --git a/src/collective/taxonomy/javascripts/cypress/support/index.js b/resources/cypress/support/index.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/cypress/support/index.js
rename to resources/cypress/support/index.js
diff --git a/src/collective/taxonomy/javascripts/index.html b/resources/index.html
similarity index 100%
rename from src/collective/taxonomy/javascripts/index.html
rename to resources/index.html
diff --git a/src/collective/taxonomy/javascripts/package.json b/resources/package.json
similarity index 96%
rename from src/collective/taxonomy/javascripts/package.json
rename to resources/package.json
index 3cbbe64f..bfd6ad44 100644
--- a/src/collective/taxonomy/javascripts/package.json
+++ b/resources/package.json
@@ -35,7 +35,7 @@
"chai-spies": "*",
"cypress": "^4.3.0",
"eslint": "^6.6.0",
- "eslint-config-airbnb": "^9.0.1",
+ "eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^1.7.0",
"eslint-plugin-jsx-a11y": "^1.2.0",
"eslint-plugin-react": "^5.1.1",
@@ -66,5 +66,9 @@
"redux-thunk": "^2.1.0",
"uid": "0.0.2",
"whatwg-fetch": "^1.0.0"
+ },
+ "volta": {
+ "node": "18.20.3",
+ "yarn": "1.22.22"
}
}
diff --git a/src/collective/taxonomy/javascripts/server.js b/resources/server.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/server.js
rename to resources/server.js
diff --git a/src/collective/taxonomy/javascripts/src/js/actions.js b/resources/src/js/actions.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/actions.js
rename to resources/src/js/actions.js
diff --git a/src/collective/taxonomy/javascripts/src/js/api.js b/resources/src/js/api.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/api.js
rename to resources/src/js/api.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/AddNodeButton.js b/resources/src/js/components/AddNodeButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/AddNodeButton.js
rename to resources/src/js/components/AddNodeButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/App.js b/resources/src/js/components/App.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/App.js
rename to resources/src/js/components/App.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/EditableId.js b/resources/src/js/components/EditableId.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/EditableId.js
rename to resources/src/js/components/EditableId.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/EditableIds.js b/resources/src/js/components/EditableIds.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/EditableIds.js
rename to resources/src/js/components/EditableIds.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/EditableTree.js b/resources/src/js/components/EditableTree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/EditableTree.js
rename to resources/src/js/components/EditableTree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/EditableValue.js b/resources/src/js/components/EditableValue.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/EditableValue.js
rename to resources/src/js/components/EditableValue.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/EditableValues.js b/resources/src/js/components/EditableValues.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/EditableValues.js
rename to resources/src/js/components/EditableValues.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/FormControls.js b/resources/src/js/components/FormControls.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/FormControls.js
rename to resources/src/js/components/FormControls.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/HideTreeCheckbox.js b/resources/src/js/components/HideTreeCheckbox.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/HideTreeCheckbox.js
rename to resources/src/js/components/HideTreeCheckbox.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/InputText.js b/resources/src/js/components/InputText.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/InputText.js
rename to resources/src/js/components/InputText.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/LanguageSelector.js b/resources/src/js/components/LanguageSelector.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/LanguageSelector.js
rename to resources/src/js/components/LanguageSelector.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/Leaf.js b/resources/src/js/components/Leaf.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/Leaf.js
rename to resources/src/js/components/Leaf.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/MoveDownButton.js b/resources/src/js/components/MoveDownButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/MoveDownButton.js
rename to resources/src/js/components/MoveDownButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/MoveUpButton.js b/resources/src/js/components/MoveUpButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/MoveUpButton.js
rename to resources/src/js/components/MoveUpButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/Node.js b/resources/src/js/components/Node.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/Node.js
rename to resources/src/js/components/Node.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/ReadOnlySubTree.js b/resources/src/js/components/ReadOnlySubTree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/ReadOnlySubTree.js
rename to resources/src/js/components/ReadOnlySubTree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/RemoveNodeButton.js b/resources/src/js/components/RemoveNodeButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/RemoveNodeButton.js
rename to resources/src/js/components/RemoveNodeButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/SubTree.js b/resources/src/js/components/SubTree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/SubTree.js
rename to resources/src/js/components/SubTree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/TaxonomyTree.js b/resources/src/js/components/TaxonomyTree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/TaxonomyTree.js
rename to resources/src/js/components/TaxonomyTree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/Tree.js b/resources/src/js/components/Tree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/Tree.js
rename to resources/src/js/components/Tree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/common/Button.js b/resources/src/js/components/common/Button.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/common/Button.js
rename to resources/src/js/components/common/Button.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/common/MessageBox.js b/resources/src/js/components/common/MessageBox.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/common/MessageBox.js
rename to resources/src/js/components/common/MessageBox.js
diff --git a/src/collective/taxonomy/javascripts/src/js/components/common/Spinner.js b/resources/src/js/components/common/Spinner.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/components/common/Spinner.js
rename to resources/src/js/components/common/Spinner.js
diff --git a/src/collective/taxonomy/javascripts/src/js/constants.js b/resources/src/js/constants.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/constants.js
rename to resources/src/js/constants.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/AddNodeButton.js b/resources/src/js/containers/AddNodeButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/AddNodeButton.js
rename to resources/src/js/containers/AddNodeButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/App.js b/resources/src/js/containers/App.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/App.js
rename to resources/src/js/containers/App.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/DevTools.js b/resources/src/js/containers/DevTools.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/DevTools.js
rename to resources/src/js/containers/DevTools.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/EditableId.js b/resources/src/js/containers/EditableId.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/EditableId.js
rename to resources/src/js/containers/EditableId.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/EditableIds.js b/resources/src/js/containers/EditableIds.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/EditableIds.js
rename to resources/src/js/containers/EditableIds.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/EditableValue.js b/resources/src/js/containers/EditableValue.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/EditableValue.js
rename to resources/src/js/containers/EditableValue.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/EditableValues.js b/resources/src/js/containers/EditableValues.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/EditableValues.js
rename to resources/src/js/containers/EditableValues.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/LanguageSelector.js b/resources/src/js/containers/LanguageSelector.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/LanguageSelector.js
rename to resources/src/js/containers/LanguageSelector.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/MoveDownButton.js b/resources/src/js/containers/MoveDownButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/MoveDownButton.js
rename to resources/src/js/containers/MoveDownButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/MoveUpButton.js b/resources/src/js/containers/MoveUpButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/MoveUpButton.js
rename to resources/src/js/containers/MoveUpButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/ReadOnlySubTree.js b/resources/src/js/containers/ReadOnlySubTree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/ReadOnlySubTree.js
rename to resources/src/js/containers/ReadOnlySubTree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/RemoveNodeButton.js b/resources/src/js/containers/RemoveNodeButton.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/RemoveNodeButton.js
rename to resources/src/js/containers/RemoveNodeButton.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/SubTree.js b/resources/src/js/containers/SubTree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/SubTree.js
rename to resources/src/js/containers/SubTree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/containers/Tree.js b/resources/src/js/containers/Tree.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/containers/Tree.js
rename to resources/src/js/containers/Tree.js
diff --git a/src/collective/taxonomy/javascripts/src/js/i18n.js b/resources/src/js/i18n.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/i18n.js
rename to resources/src/js/i18n.js
diff --git a/src/collective/taxonomy/javascripts/src/js/index.js b/resources/src/js/index.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/index.js
rename to resources/src/js/index.js
diff --git a/src/collective/taxonomy/javascripts/src/js/reducers.js b/resources/src/js/reducers.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/reducers.js
rename to resources/src/js/reducers.js
diff --git a/src/collective/taxonomy/javascripts/src/js/store/configureStore.dev.js b/resources/src/js/store/configureStore.dev.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/store/configureStore.dev.js
rename to resources/src/js/store/configureStore.dev.js
diff --git a/src/collective/taxonomy/javascripts/src/js/store/configureStore.js b/resources/src/js/store/configureStore.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/store/configureStore.js
rename to resources/src/js/store/configureStore.js
diff --git a/src/collective/taxonomy/javascripts/src/js/store/configureStore.prod.js b/resources/src/js/store/configureStore.prod.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/store/configureStore.prod.js
rename to resources/src/js/store/configureStore.prod.js
diff --git a/src/collective/taxonomy/javascripts/src/js/store/middlewares.js b/resources/src/js/store/middlewares.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/store/middlewares.js
rename to resources/src/js/store/middlewares.js
diff --git a/src/collective/taxonomy/javascripts/src/js/translations/es.js b/resources/src/js/translations/es.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/translations/es.js
rename to resources/src/js/translations/es.js
diff --git a/src/collective/taxonomy/javascripts/src/js/translations/fr.js b/resources/src/js/translations/fr.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/translations/fr.js
rename to resources/src/js/translations/fr.js
diff --git a/src/collective/taxonomy/javascripts/src/js/translations/index.js b/resources/src/js/translations/index.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/translations/index.js
rename to resources/src/js/translations/index.js
diff --git a/src/collective/taxonomy/javascripts/src/js/translations/nl.js b/resources/src/js/translations/nl.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/js/translations/nl.js
rename to resources/src/js/translations/nl.js
diff --git a/src/collective/taxonomy/javascripts/src/test/actions.spec.js b/resources/src/test/actions.spec.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/test/actions.spec.js
rename to resources/src/test/actions.spec.js
diff --git a/src/collective/taxonomy/javascripts/src/test/reducers.spec.js b/resources/src/test/reducers.spec.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/test/reducers.spec.js
rename to resources/src/test/reducers.spec.js
diff --git a/src/collective/taxonomy/javascripts/src/test/setup.js b/resources/src/test/setup.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/src/test/setup.js
rename to resources/src/test/setup.js
diff --git a/src/collective/taxonomy/javascripts/webpack.config.js b/resources/webpack.config.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/webpack.config.js
rename to resources/webpack.config.js
diff --git a/resources/webpack.config.prod.js b/resources/webpack.config.prod.js
new file mode 100644
index 00000000..d5b2d6fd
--- /dev/null
+++ b/resources/webpack.config.prod.js
@@ -0,0 +1,44 @@
+var path = require('path')
+var webpack = require('webpack')
+
+module.exports = () => {
+ const config = {
+ devtool: 'cheap-module-source-map', // https://webpack.js.org/configuration/devtool
+ entry: {
+ edittaxonomydata: ['./src/js/index'],
+ },
+ output: {
+ path: path.join(__dirname, '../src/collective/taxonomy/static/js'),
+ filename: '[name].js',
+ },
+ plugins: [
+ new webpack.IgnorePlugin(/^(buffertools)$/),
+ new webpack.optimize.OccurrenceOrderPlugin(),
+ new webpack.DefinePlugin({
+ 'process.env.NODE_ENV': JSON.stringify('production')
+ }),
+ new webpack.optimize.UglifyJsPlugin({
+ compressor: {
+ pure_getters: true,
+ unsafe: true,
+ unsafe_comps: true,
+ screw_ie8: true,
+ warnings: false
+ }
+ })
+ ],
+ module: {
+ loaders: [{
+ test: /\.js$/,
+ loaders: ['babel-loader'],
+ exclude: /node_modules/,
+ include: path.join(__dirname, 'src'),
+ }]
+ }
+ };
+
+ console.log(JSON.stringify(config, null, 4));
+
+ return config;
+
+}
diff --git a/src/collective/taxonomy/javascripts/yarn.lock b/resources/yarn.lock
similarity index 99%
rename from src/collective/taxonomy/javascripts/yarn.lock
rename to resources/yarn.lock
index eb47b4ed..847efd8f 100644
--- a/src/collective/taxonomy/javascripts/yarn.lock
+++ b/resources/yarn.lock
@@ -3,24 +3,24 @@
"@babel/code-frame@^7.0.0":
- version "7.24.2"
- resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae"
- integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==
+ version "7.24.7"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465"
+ integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==
dependencies:
- "@babel/highlight" "^7.24.2"
+ "@babel/highlight" "^7.24.7"
picocolors "^1.0.0"
-"@babel/helper-validator-identifier@^7.24.5":
- version "7.24.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62"
- integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==
+"@babel/helper-validator-identifier@^7.24.7":
+ version "7.24.7"
+ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db"
+ integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==
-"@babel/highlight@^7.24.2":
- version "7.24.5"
- resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.5.tgz#bc0613f98e1dd0720e99b2a9ee3760194a704b6e"
- integrity sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==
+"@babel/highlight@^7.24.7":
+ version "7.24.7"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d"
+ integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==
dependencies:
- "@babel/helper-validator-identifier" "^7.24.5"
+ "@babel/helper-validator-identifier" "^7.24.7"
chalk "^2.4.2"
js-tokens "^4.0.0"
picocolors "^1.0.0"
@@ -2030,9 +2030,9 @@ debug@^3.1.0:
ms "^2.1.1"
debug@^4.0.1, debug@^4.1.1:
- version "4.3.4"
- resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
- integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
+ version "4.3.5"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e"
+ integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==
dependencies:
ms "2.1.2"
@@ -2488,17 +2488,10 @@ escope@^3.6.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"
-eslint-config-airbnb-base@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-3.0.1.tgz#b777e01f65e946933442b499fc8518aa251a6530"
- integrity sha512-71Gd90ksJRHhGrFv7A9TwgvpOGeHooJFpvDoaOaIPkypToIGXyOeiMwWxrj8LNyT6wOHqZCMalMmM0Eo7t2V9Q==
-
-eslint-config-airbnb@^9.0.1:
- version "9.0.1"
- resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-9.0.1.tgz#6708170d5034b579d52913fe49dee2f7fec7d894"
- integrity sha512-Q6mYyfyVWQSBHmuluWQaKppEUYSuxAxuqhxdE/Z2V+xy4E4mQj97Jchka5E/eLc2eU6ZqArnVIGpk6ajHv84iw==
- dependencies:
- eslint-config-airbnb-base "^3.0.0"
+eslint-config-prettier@^9.0.0:
+ version "9.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
+ integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==
eslint-import-resolver-node@^0.2.0:
version "0.2.3"
@@ -3673,11 +3666,11 @@ is-ci@^2.0.0:
ci-info "^2.0.0"
is-core-module@^2.13.0:
- version "2.13.1"
- resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384"
- integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==
+ version "2.14.0"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.14.0.tgz#43b8ef9f46a6a08888db67b1ffd4ec9e3dfd59d1"
+ integrity sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==
dependencies:
- hasown "^2.0.0"
+ hasown "^2.0.2"
is-data-descriptor@^1.0.1:
version "1.0.1"
@@ -4532,9 +4525,9 @@ mute-stream@0.0.8:
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
nan@^2.12.1:
- version "2.19.0"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0"
- integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==
+ version "2.20.0"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.20.0.tgz#08c5ea813dd54ed16e5bd6505bf42af4f7838ca3"
+ integrity sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==
nanomatch@^1.2.9:
version "1.2.13"
@@ -4686,9 +4679,9 @@ object-copy@^0.1.0:
kind-of "^3.0.3"
object-inspect@^1.13.1:
- version "1.13.1"
- resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2"
- integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==
+ version "1.13.2"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff"
+ integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==
object-keys@^1.1.1:
version "1.1.1"
@@ -5945,9 +5938,9 @@ spdx-expression-parse@^3.0.0:
spdx-license-ids "^3.0.0"
spdx-license-ids@^3.0.0:
- version "3.0.17"
- resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz#887da8aa73218e51a1d917502d79863161a93f9c"
- integrity sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==
+ version "3.0.18"
+ resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz#22aa922dcf2f2885a6494a261f2d8b75345d0326"
+ integrity sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==
split-string@^3.0.1, split-string@^3.0.2:
version "3.1.0"
@@ -6384,9 +6377,9 @@ type-is@~1.6.18:
mime-types "~2.1.24"
type@^2.7.2:
- version "2.7.2"
- resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0"
- integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==
+ version "2.7.3"
+ resolved "https://registry.yarnpkg.com/type/-/type-2.7.3.tgz#436981652129285cc3ba94f392886c2637ea0486"
+ integrity sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==
typed-array-buffer@^1.0.2:
version "1.0.2"
@@ -6450,9 +6443,9 @@ typedarray@^0.0.6:
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
ua-parser-js@^0.7.30:
- version "0.7.37"
- resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.37.tgz#e464e66dac2d33a7a1251d7d7a99d6157ec27832"
- integrity sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==
+ version "0.7.38"
+ resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.38.tgz#f497d8a4dc1fec6e854e5caa4b2f9913422ef054"
+ integrity sha512-fYmIy7fKTSFAhG3fuPlubeGaMoAd6r0rSnfEsO5nEY55i26KSLt9EH7PLQiiqPUhNqYIJvSkTy1oArIcXAbPbA==
uglify-js@^2.8.29:
version "2.8.29"
@@ -6465,9 +6458,9 @@ uglify-js@^2.8.29:
uglify-to-browserify "~1.0.0"
uglify-js@^3.1.4:
- version "3.17.4"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c"
- integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==
+ version "3.18.0"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.18.0.tgz#73b576a7e8fda63d2831e293aeead73e0a270deb"
+ integrity sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==
uglify-to-browserify@~1.0.0:
version "1.0.2"
diff --git a/src/collective/taxonomy/configure.zcml b/src/collective/taxonomy/configure.zcml
index f5498093..90f899fa 100644
--- a/src/collective/taxonomy/configure.zcml
+++ b/src/collective/taxonomy/configure.zcml
@@ -116,19 +116,7 @@
-
-
-
-
diff --git a/src/collective/taxonomy/edit_taxonomy_data.pt b/src/collective/taxonomy/edit_taxonomy_data.pt
index 095e9d0c..cfd38306 100644
--- a/src/collective/taxonomy/edit_taxonomy_data.pt
+++ b/src/collective/taxonomy/edit_taxonomy_data.pt
@@ -10,19 +10,19 @@
diff --git a/src/collective/taxonomy/javascripts/webpack.config.prod.js b/src/collective/taxonomy/javascripts/webpack.config.prod.js
deleted file mode 100644
index 1277cacc..00000000
--- a/src/collective/taxonomy/javascripts/webpack.config.prod.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var path = require('path')
-var webpack = require('webpack')
-
-module.exports = {
- devtool: 'cheap-module-source-map', // https://webpack.js.org/configuration/devtool
- entry: {
- edittaxonomydata: ['./src/js/index'],
- },
- output: {
- path: path.join(__dirname, 'build'),
- filename: '[name].js',
- },
- plugins: [
- new webpack.IgnorePlugin(/^(buffertools)$/),
- new webpack.optimize.OccurrenceOrderPlugin(),
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify('production')
- }),
- new webpack.optimize.UglifyJsPlugin({
- compressor: {
- pure_getters: true,
- unsafe: true,
- unsafe_comps: true,
- screw_ie8: true,
- warnings: false
- }
- })
- ],
- module: {
- loaders: [{
- test: /\.js$/,
- loaders: ['babel-loader'],
- exclude: /node_modules/,
- include: path.join(__dirname, 'src'),
- }]
- }
-}
diff --git a/src/collective/taxonomy/jsonimpl.py b/src/collective/taxonomy/jsonimpl.py
index 2eb32858..a5e09948 100644
--- a/src/collective/taxonomy/jsonimpl.py
+++ b/src/collective/taxonomy/jsonimpl.py
@@ -90,7 +90,7 @@ def get_resource_url(self):
if node_env == "development" and api.env.debug_mode():
return "http://localhost:3000/static/edittaxonomydata.js"
else:
- return "{}/++resource++taxonomy/edittaxonomydata.js".format(
+ return "{}/++resource++taxonomy/js/edittaxonomydata.js".format(
api.portal.get().absolute_url()
)
diff --git a/src/collective/taxonomy/collective.taxonomy.css b/src/collective/taxonomy/static/css/collective.taxonomy.css
similarity index 100%
rename from src/collective/taxonomy/collective.taxonomy.css
rename to src/collective/taxonomy/static/css/collective.taxonomy.css
diff --git a/src/collective/taxonomy/icons/LICENSE.txt b/src/collective/taxonomy/static/icons/LICENSE.txt
similarity index 100%
rename from src/collective/taxonomy/icons/LICENSE.txt
rename to src/collective/taxonomy/static/icons/LICENSE.txt
diff --git a/src/collective/taxonomy/icons/README.txt b/src/collective/taxonomy/static/icons/README.txt
similarity index 100%
rename from src/collective/taxonomy/icons/README.txt
rename to src/collective/taxonomy/static/icons/README.txt
diff --git a/src/collective/taxonomy/icons/config.json b/src/collective/taxonomy/static/icons/config.json
similarity index 100%
rename from src/collective/taxonomy/icons/config.json
rename to src/collective/taxonomy/static/icons/config.json
diff --git a/src/collective/taxonomy/icons/css/animation.css b/src/collective/taxonomy/static/icons/css/animation.css
similarity index 100%
rename from src/collective/taxonomy/icons/css/animation.css
rename to src/collective/taxonomy/static/icons/css/animation.css
diff --git a/src/collective/taxonomy/icons/css/taxonomy-codes.css b/src/collective/taxonomy/static/icons/css/taxonomy-codes.css
similarity index 100%
rename from src/collective/taxonomy/icons/css/taxonomy-codes.css
rename to src/collective/taxonomy/static/icons/css/taxonomy-codes.css
diff --git a/src/collective/taxonomy/icons/css/taxonomy-embedded.css b/src/collective/taxonomy/static/icons/css/taxonomy-embedded.css
similarity index 100%
rename from src/collective/taxonomy/icons/css/taxonomy-embedded.css
rename to src/collective/taxonomy/static/icons/css/taxonomy-embedded.css
diff --git a/src/collective/taxonomy/icons/css/taxonomy-ie7-codes.css b/src/collective/taxonomy/static/icons/css/taxonomy-ie7-codes.css
similarity index 100%
rename from src/collective/taxonomy/icons/css/taxonomy-ie7-codes.css
rename to src/collective/taxonomy/static/icons/css/taxonomy-ie7-codes.css
diff --git a/src/collective/taxonomy/icons/css/taxonomy-ie7.css b/src/collective/taxonomy/static/icons/css/taxonomy-ie7.css
similarity index 100%
rename from src/collective/taxonomy/icons/css/taxonomy-ie7.css
rename to src/collective/taxonomy/static/icons/css/taxonomy-ie7.css
diff --git a/src/collective/taxonomy/icons/css/taxonomy.css b/src/collective/taxonomy/static/icons/css/taxonomy.css
similarity index 100%
rename from src/collective/taxonomy/icons/css/taxonomy.css
rename to src/collective/taxonomy/static/icons/css/taxonomy.css
diff --git a/src/collective/taxonomy/icons/demo.html b/src/collective/taxonomy/static/icons/demo.html
similarity index 100%
rename from src/collective/taxonomy/icons/demo.html
rename to src/collective/taxonomy/static/icons/demo.html
diff --git a/src/collective/taxonomy/icons/font/taxonomy.eot b/src/collective/taxonomy/static/icons/font/taxonomy.eot
similarity index 100%
rename from src/collective/taxonomy/icons/font/taxonomy.eot
rename to src/collective/taxonomy/static/icons/font/taxonomy.eot
diff --git a/src/collective/taxonomy/icons/font/taxonomy.svg b/src/collective/taxonomy/static/icons/font/taxonomy.svg
similarity index 100%
rename from src/collective/taxonomy/icons/font/taxonomy.svg
rename to src/collective/taxonomy/static/icons/font/taxonomy.svg
diff --git a/src/collective/taxonomy/icons/font/taxonomy.ttf b/src/collective/taxonomy/static/icons/font/taxonomy.ttf
similarity index 100%
rename from src/collective/taxonomy/icons/font/taxonomy.ttf
rename to src/collective/taxonomy/static/icons/font/taxonomy.ttf
diff --git a/src/collective/taxonomy/icons/font/taxonomy.woff b/src/collective/taxonomy/static/icons/font/taxonomy.woff
similarity index 100%
rename from src/collective/taxonomy/icons/font/taxonomy.woff
rename to src/collective/taxonomy/static/icons/font/taxonomy.woff
diff --git a/src/collective/taxonomy/icons/font/taxonomy.woff2 b/src/collective/taxonomy/static/icons/font/taxonomy.woff2
similarity index 100%
rename from src/collective/taxonomy/icons/font/taxonomy.woff2
rename to src/collective/taxonomy/static/icons/font/taxonomy.woff2
diff --git a/src/collective/taxonomy/javascripts/build/.gitkeep b/src/collective/taxonomy/static/js/.gitkeep
similarity index 100%
rename from src/collective/taxonomy/javascripts/build/.gitkeep
rename to src/collective/taxonomy/static/js/.gitkeep
diff --git a/src/collective/taxonomy/javascripts/build/css/react-treeview.css b/src/collective/taxonomy/static/js/css/react-treeview.css
similarity index 100%
rename from src/collective/taxonomy/javascripts/build/css/react-treeview.css
rename to src/collective/taxonomy/static/js/css/react-treeview.css
diff --git a/src/collective/taxonomy/javascripts/build/edittaxonomydata.js b/src/collective/taxonomy/static/js/edittaxonomydata.js
similarity index 100%
rename from src/collective/taxonomy/javascripts/build/edittaxonomydata.js
rename to src/collective/taxonomy/static/js/edittaxonomydata.js
diff --git a/src/collective/taxonomy/javascripts/build/edittaxonomydata.js.map b/src/collective/taxonomy/static/js/edittaxonomydata.js.map
similarity index 100%
rename from src/collective/taxonomy/javascripts/build/edittaxonomydata.js.map
rename to src/collective/taxonomy/static/js/edittaxonomydata.js.map
diff --git a/src/collective/taxonomy/tests/test_json.py b/src/collective/taxonomy/tests/test_json.py
index 0213f1f5..70c4e9c5 100644
--- a/src/collective/taxonomy/tests/test_json.py
+++ b/src/collective/taxonomy/tests/test_json.py
@@ -169,5 +169,5 @@ def test_get_languages_mapping(self):
def test_get_resource_url(self):
url = self.view.get_resource_url()
self.assertEqual(
- "http://nohost/plone/++resource++taxonomy/edittaxonomydata.js", url
+ "http://nohost/plone/++resource++taxonomy/js/edittaxonomydata.js", url
)