Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update development files #160

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 0 additions & 2 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
uses: plone/meta/.github/workflows/test.yml@main
release_ready:
uses: plone/meta/.github/workflows/release_ready.yml@main
circular:
uses: plone/meta/.github/workflows/circular.yml@main

##
# To modify the list of default jobs being created add in .meta.toml:
Expand Down
3 changes: 1 addition & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "721299ce"
commit-id = "a89af8f2"

[pyproject]
codespell_skip = "*.js,*.min.js,*.min.js.map,*.min.css.map,*.svg,*.lock,*.json"
Expand All @@ -13,7 +13,6 @@ jobs = [
"qa",
"test",
"release_ready",
"circular",
]

[gitignore]
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
# """
##
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand Down
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/**
26 changes: 23 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,34 @@ 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 starts a webpack development server at ``localhost:3000`` and
serves the JS files.

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
Binary file modified images/edit_taxonomy_data.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ target-version = ["py38"]
##

[tool.codespell]
ignore-words-list = "discreet,"
ignore-words-list = "discreet,assertin,"
skip = "*.po,*.js,*.min.js,*.min.js.map,*.min.css.map,*.svg,*.lock,*.json"
##
# Add extra configuration options in .meta.toml:
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.
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 All @@ -49,7 +49,7 @@
"redux-devtools-log-monitor": "^1.0.11",
"webpack": "^3.12.0",
"webpack-dev-middleware": "^1.2.0",
"webpack-hot-middleware": "^2.25.4"
"webpack-hot-middleware": "^2.26.1"
},
"dependencies": {
"har-validator": "5.1.5",
Expand All @@ -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.
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;

}
Loading
Loading