Open tisto opened 4 years ago
{
"volto-formbuilder": {
"package": "@kitconcept/volto-formbuilder",
"url": "https://github.com/kitconcept/volto-formbuilder.git",
"path": "src"
}
}
"scripts": {
"develop:npx": "npx -p mrs-developer missdev --config=jsconfig.json --output=addons",
"develop": "missdev --config=jsconfig.json --output=addons",
"preinstall": "if [ -f $(pwd)/node_modules/.bin/missdev ]; then yarn develop; else yarn develop:npx; fi",
"start": "razzle start",
"postinstall": "yarn omelette && yarn patches",
"omelette": "ln -sf node_modules/@plone/volto/ omelette",
"patches": "/bin/bash patches/patchit.sh > /dev/null 2>&1 ||true",
"build": "razzle build",
"test": "razzle test --env=jsdom --passWithNoTests",
"start:prod": "NODE_ENV=production node build/server.js",
"i18n": "NODE_ENV=production node node_modules/@plone/volto/src/i18n.js"
},
This makes sure it runs missdev before "yarn install"
"addons": [
"@kitconcept/volto-formbuilder"
],
"workspaces": [
"src/addons/volto-formbuilder"
],
"moduleNameMapper": {
"@plone/volto/babel": "<rootDir>/node_modules/@plone/volto/babel",
"@plone/volto/(.*)$": "<rootDir>/node_modules/@plone/volto/src/$1",
"load-volto-addons": "<rootDir>/node_modules/@plone/volto/dummy-addons-loader.js",
"@package/(.*)$": "<rootDir>/src/$1",
"volto-formbuilder/(.*)$": "<rootDir>/src/addons/volto-formbuilder/src/$1"
"~/(.*)$": "<rootDir>/src/$1"
},
Now run yarn install, yarn start.
I think it would be a good idea to migrate the jest configuration to jest.config.js, then we could use addons-registry to get the addons mappings.
package.json:
"private": "true",
"addons": [
"@kitconcept/volto-form-builder"
],
"workspaces": [
"src/addons/volto-form-builder"
],
"moduleNameMapper": {
...
"@kitconcept/volto-form-builder/(.*)$": "<rootDir>/src/addons/volto-form-builder/src/$1",
@tiberiuichim ok, this is the same what I did so far in other projects. Why do we need mrs.developer when we put the source code into /src/addons/volto-form-builder?
Old habit, sorry. missdev is useful as it updates jsconfig.json, but you're right, it's not needed.