Skip to content

Commit

Permalink
UPDATE: Changed structure of package.json with workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
neo-garaix committed Jan 31, 2025
1 parent 719d5b5 commit 1c642df
Show file tree
Hide file tree
Showing 47 changed files with 4,343 additions and 3,908 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:

- name: Install dependencies
run: |
cd end2end
cd ..
npm ci
- name: Install Playwright
Expand Down Expand Up @@ -268,6 +268,7 @@ jobs:
if: success() || steps.test-playwright-read-only.conclusion == 'failure' || steps.test-playwright-not-read-only.conclusion == 'failure'
uses: cypress-io/[email protected]
with:
install: false
browser: chrome
headed: true
working-directory: tests/end2end
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ jobs:
node-version: 21

- name: Install lizmap dependencies
working-directory: assets
run: npm install

- name: Install tests dependencies
working-directory: tests/js-units
run: npm install

- name: Running tests
working-directory: tests/js-units
run: npm run js:test
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,22 @@ You need some developer tools in order to build and install dependencies.
#### Requirements

* Install dependencies :
* `cd assets/`
* `npm install`
* `npm install` in root directory of the repository.

It creates a `assets/node_modules/` directory. Don't commit it into the git repository!
It creates a `node_modules/` directory. Don't commit it into the git repository!


#### Installation

* Build for production (minified JS files) :
* From root directory :
`npm run build`

Don't commit minified JS files into the git repository. They will be built by our
continuous integration and added into zip packages that are available on github.

* Build for development (source mapping, build is executed at every change on a JS file) :
* From root directory :
`npm run watch`

Look at [webpack documentation](https://webpack.js.org/guides/development/) for other development options (e.g. live reloading)
Expand All @@ -162,7 +163,7 @@ Configuration of php-cs-fixer has been setup into .php-cs.dist.

### JavaScript

Please run `npm run pretest` in `assets/` directory and fix errors before any commit.
Please run `npm run pretest` in the root directory and fix errors before any commit.

## Issues

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ endif

build: debug
composer update --working-dir=lizmap/ --prefer-dist --no-ansi --no-interaction --no-dev --no-suggest --no-progress
cd assets/ && npm install
cd assets/ && npm run build
npm install
npm run build

tests: debug build
composer update --working-dir=tests/units/ --prefer-dist --no-ansi --no-interaction --no-dev --no-suggest --no-progress
Expand Down Expand Up @@ -208,7 +208,7 @@ version-doc:
sed -i "s@COMMIT_ID@$(COMMITID)@g" docs/index.html
sed -i "s@VERSION@$(FULL_VERSION)@g" docs/index.html docs/phpdoc.xml
sed -i "s@DATE@$(DATE_VERSION)@g" docs/index.html
jq '.version = "$(FULL_VERSION)"' assets/package.json > "$tmp" && mv "$tmp" assets/package.json
jq '.version = "$(FULL_VERSION)"' package.json > "$tmp" && mv "$tmp" package.json

php-doc:
docker run --rm -v ${PWD}:/data phpdoc/phpdoc:3 -c docs/phpdoc.xml
Expand Down
33 changes: 2 additions & 31 deletions assets/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
{
"name": "assets",
"version": "1.0.0",
"description": "",
"description": "Modules & Component for Lizmap",
"type": "module",
"scripts": {
"build": "webpack --config webpack.prod.js",
"watch": "webpack --watch --config webpack.dev.js",
"pretest": "eslint src",
"pretest-fix": "eslint --fix src"
},
"devDependencies": {
"dompurify": "^3.1.6",
"eslint": "^8.56.0",
"eslint-plugin-jsdoc": "^48.0.2",
"jsts": "^2.11.0",
"lit-html": "^3.1.1",
"ol": "^10.2.1",
"proj4": "^2.11.0",
"shpjs": "^6.1.0",
"svg-sprite-loader": "^6.0.11",
"svgo": "^3.2.0",
"svgo-loader": "^4.0.0",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.10.0"
},
"author": "3Liz",
"license": "ISC",
"dependencies": {
"@turf/line-split": "^7.2.0",
"flatgeobuf": "^3.36.0",
"ol-ext": "^4.0.24",
"ol-wfs-capabilities": "^2.0.0"
}
"license": "ISC"
}
22 changes: 11 additions & 11 deletions assets/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const __dirname = dirname(fileURLToPath(import.meta.url));

export default {
entry: {
lizmap: './src/index.js',
map: './src/legacy/map.js',
attributeTable: './src/legacy/attributeTable.js',
edition: './src/legacy/edition.js',
filter: './src/legacy/filter.js',
atlas: './src/legacy/atlas.js',
'switcher-layers-actions': './src/legacy/switcher-layers-actions.js',
timemanager: './src/legacy/timemanager.js',
view: './src/legacy/view.js',
'bottom-dock': './src/legacy/bottom-dock.js',
'map-projects': './src/legacy/map-projects.js',
lizmap: './assets/src/index.js',
map: './assets/src/legacy/map.js',
attributeTable: './assets/src/legacy/attributeTable.js',
edition: './assets/src/legacy/edition.js',
filter: './assets/src/legacy/filter.js',
atlas: './assets/src/legacy/atlas.js',
'switcher-layers-actions': './assets/src/legacy/switcher-layers-actions.js',
timemanager: './assets/src/legacy/timemanager.js',
view: './assets/src/legacy/view.js',
'bottom-dock': './assets/src/legacy/bottom-dock.js',
'map-projects': './assets/src/legacy/map-projects.js',
},
output: {
filename: '[name].js',
Expand Down
Loading

0 comments on commit 1c642df

Please sign in to comment.