Skip to content

Commit

Permalink
move development files out of package and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Oct 17, 2024
1 parent 373c22c commit 2fe6b07
Show file tree
Hide file tree
Showing 103 changed files with 162 additions and 124 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ jobs:
- name: Run tests
run: |
make test-ignore-warnings
- name: Run Javascript Tests
run: |
cd resources; make test
17 changes: 7 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
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
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/**
25 changes: 22 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
"extends": "airbnb",
"extends": ["eslint:recommended"],
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
"jquery": true,
"mocha": true
},
"ecmaFeatures": {
"jsx": true,
"modules": true,
},
"rules": {
"array-bracket-spacing": [2, "never"],
"no-redeclare": 0,
Expand All @@ -34,6 +30,6 @@
],
"globals": {
"__DEV__" : true,
"expect": true,
"expect": true
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
yarn-error.log
cypress/screenshots/
stamp-yarn
29 changes: 29 additions & 0 deletions resources/Makefile
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions resources/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -4532,9 +4525,9 @@ [email protected]:
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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
14 changes: 1 addition & 13 deletions src/collective/taxonomy/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,7 @@

<browser:resourceDirectory
name="taxonomy"
directory="javascripts/build"
layer=".interfaces.IBrowserLayer"
/>

<browser:resourceDirectory
name="taxonomy.icons"
directory="icons"
layer=".interfaces.IBrowserLayer"
/>

<browser:resource
name="collective.taxonomy.css"
file="collective.taxonomy.css"
directory="static"
layer=".interfaces.IBrowserLayer"
/>

Expand Down
Loading

0 comments on commit 2fe6b07

Please sign in to comment.