This repository has been archived by the owner on May 29, 2023. It is now read-only.
generated from eea/volto-frontend-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eea/develop
- Loading branch information
Showing
70 changed files
with
24,231 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
src/addons/**/node_modules | ||
src/addons/**/cypress | ||
src/addons/**/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const projectRootPath = __dirname; | ||
const packageJson = require(path.join(projectRootPath, 'package.json')); | ||
|
||
let voltoPath = './node_modules/@plone/volto'; | ||
|
||
let configFile; | ||
if (fs.existsSync(`${this.projectRootPath}/tsconfig.json`)) | ||
configFile = `${this.projectRootPath}/tsconfig.json`; | ||
else if (fs.existsSync(`${this.projectRootPath}/jsconfig.json`)) | ||
configFile = `${this.projectRootPath}/jsconfig.json`; | ||
|
||
if (configFile) { | ||
const jsConfig = require(configFile).compilerOptions; | ||
const pathsConfig = jsConfig.paths; | ||
if (pathsConfig['@plone/volto']) | ||
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`; | ||
} | ||
|
||
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`); | ||
const reg = new AddonConfigurationRegistry(__dirname); | ||
|
||
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons | ||
const addonAliases = Object.keys(reg.packages).map((o) => [ | ||
o, | ||
reg.packages[o].modulePath, | ||
]); | ||
|
||
module.exports = { | ||
extends: `${voltoPath}/.eslintrc`, | ||
settings: { | ||
'import/resolver': { | ||
alias: { | ||
map: [ | ||
['@plone/volto', '@plone/volto/src'], | ||
...addonAliases, | ||
['@package', `${__dirname}/src`], | ||
['@root', `${__dirname}/src`], | ||
['~', `${__dirname}/src`], | ||
], | ||
extensions: ['.js', '.jsx', '.json'], | ||
}, | ||
'babel-plugin-root-import': { | ||
rootPathSuffix: 'src', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.vscode/ | ||
logs | ||
*.log | ||
npm-debug.log* | ||
.DS_Store | ||
|
||
coverage | ||
|
||
# Node | ||
node_modules | ||
coverage | ||
jsdoc | ||
webpack-assets.json | ||
webpack-stats.json | ||
npm-debug.log | ||
dist | ||
junit.xml | ||
eslint.xml | ||
yarn-error.log | ||
build | ||
|
||
# Other | ||
.DS_Store | ||
.idea | ||
lighthouse-report.html | ||
.vscode/ | ||
.#* | ||
*~ | ||
|
||
# Python | ||
/api/.installed.cfg | ||
/api/.mr.developer.cfg | ||
/api/bin/ | ||
/api/develop-eggs/ | ||
/api/eggs/ | ||
/api/include/ | ||
/api/lib/ | ||
/api/lib64/ | ||
/api/notebook/env/ | ||
/api/parts/ | ||
/api/share/python-wheels/ | ||
/api/src/ | ||
/api/var/ | ||
/api/venv/ | ||
/bin/ | ||
/lib/ | ||
.Python | ||
include | ||
pip-selfcheck.json | ||
pyvenv.cfg | ||
share | ||
|
||
# locales | ||
locales/*.json | ||
|
||
# Tests | ||
/tests/bin | ||
/tests/develop-eggs | ||
/tests/parts | ||
/tests/.installed.cfg | ||
*.pyc | ||
geckodriver.log | ||
log.html | ||
output.xml | ||
report.html | ||
selenium-screenshot-*.png | ||
/selenium/ | ||
cypress/videos/ | ||
cypress/screenshots | ||
cypress/reports | ||
|
||
# Local environment setup | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
data | ||
omelette | ||
|
||
public/critical.css | ||
src/addons/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"npm": { | ||
"publish": false | ||
}, | ||
"git": { | ||
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://github.com/raw/release-it/release-it/master/templates/changelog-compact.hbs", | ||
"tagName": "${version}" | ||
}, | ||
"github": { | ||
"release": true, | ||
"releaseName": "${version}", | ||
"releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://github.com/raw/release-it/release-it/master/templates/changelog-compact.hbs" | ||
}, | ||
"hooks": { | ||
"after:bump": "npx auto-changelog --commit-limit false -p" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const makeLoaderFinder = require('razzle-dev-utils/makeLoaderFinder'); | ||
const fileLoaderFinder = makeLoaderFinder('file-loader'); | ||
|
||
const projectRootPath = path.resolve('.'); | ||
const lessPlugin = require('@plone/volto/webpack-plugins/webpack-less-plugin'); | ||
|
||
const createConfig = require('../node_modules/razzle/config/createConfigAsync.js'); | ||
const razzleConfig = require(path.join(projectRootPath, 'razzle.config.js')); | ||
|
||
const SVGLOADER = { | ||
test: /icons\/.*\.svg$/, | ||
use: [ | ||
{ | ||
loader: 'svg-loader', | ||
}, | ||
{ | ||
loader: 'svgo-loader', | ||
options: { | ||
plugins: [ | ||
{ removeTitle: true }, | ||
{ convertPathData: false }, | ||
{ removeUselessStrokeAndFill: true }, | ||
{ removeViewBox: false }, | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = { | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
// '@storybook/preset-scss', | ||
], | ||
webpackFinal: async (config, { configType }) => { | ||
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION' | ||
// You can change the configuration based on that. | ||
// 'PRODUCTION' is used when building the static version of storybook. | ||
|
||
// Make whatever fine-grained changes you need | ||
let baseConfig; | ||
baseConfig = await createConfig( | ||
'web', | ||
'dev', | ||
{ | ||
// clearConsole: false, | ||
modifyWebpackConfig: razzleConfig.modifyWebpackConfig, | ||
plugins: razzleConfig.plugins, | ||
}, | ||
webpack, | ||
); | ||
const AddonConfigurationRegistry = require('@plone/volto/addon-registry'); | ||
|
||
const registry = new AddonConfigurationRegistry(projectRootPath); | ||
|
||
config = lessPlugin({ registry }).modifyWebpackConfig({ | ||
env: { target: 'web', dev: 'dev' }, | ||
webpackConfig: config, | ||
webpackObject: webpack, | ||
options: {}, | ||
}); | ||
|
||
// putting SVG loader on top, fix the fileloader manually (Volto plugin does not | ||
// work) since it needs to go first | ||
config.module.rules.unshift(SVGLOADER); | ||
const fileLoader = config.module.rules.find(fileLoaderFinder); | ||
fileLoader.exclude = [/\.(config|variables|overrides)$/, /icons\/.*\.svg$/]; | ||
|
||
config.plugins.unshift( | ||
new webpack.DefinePlugin({ | ||
__DEVELOPMENT__: true, | ||
__CLIENT__: true, | ||
__SERVER__: false, | ||
}), | ||
); | ||
|
||
const resultConfig = { | ||
...config, | ||
resolve: { | ||
...config.resolve, | ||
alias: { ...config.resolve.alias, ...baseConfig.resolve.alias }, | ||
}, | ||
}; | ||
resultConfig.module.rules[1].exclude = /node_modules\/(?!(@plone\/volto)\/)/; | ||
|
||
const addonExtenders = registry.getAddonExtenders().map((m) => require(m)); | ||
|
||
const extendedConfig = addonExtenders.reduce( | ||
(acc, extender) => | ||
extender.modify(acc, { target: 'web', dev: 'dev' }, config), | ||
resultConfig, | ||
); | ||
|
||
// Note: we don't actually support razzle plugins, which are also a feature | ||
// of the razzle.extend.js addons file. Those features are probably | ||
// provided in a different manner by Storybook plugins (for example scss | ||
// loaders). | ||
|
||
return extendedConfig; | ||
}, | ||
babel: async (options) => { | ||
return { | ||
...options, | ||
plugins: [ | ||
...options.plugins, | ||
[ | ||
'./node_modules/babel-plugin-root-import/build/index.js', | ||
{ | ||
rootPathSuffix: './src', | ||
}, | ||
], | ||
], | ||
// any extra options you want to set | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { addons } from '@storybook/addons'; | ||
|
||
addons.setConfig({ | ||
isFullscreen: false, | ||
showNav: true, | ||
showPanel: true, | ||
panelPosition: 'bottom', | ||
sidebarAnimations: true, | ||
enableShortcuts: true, | ||
isToolshown: true, | ||
theme: undefined, | ||
selectedPanel: undefined, | ||
initialActive: 'sidebar', | ||
showRoots: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import '@plone/volto/config'; // This is the bootstrap for the global config - client side | ||
import React from 'react'; | ||
import { StaticRouter } from 'react-router-dom'; | ||
import { IntlProvider } from 'react-intl'; | ||
import enMessages from '@root/../locales/en.json'; | ||
|
||
import '@root/theme'; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}; | ||
|
||
export const decorators = [ | ||
(Story) => ( | ||
<IntlProvider messages={enMessages} locale="en" defaultLocale="en"> | ||
<StaticRouter location="/"> | ||
<Story /> | ||
</StaticRouter> | ||
</IntlProvider> | ||
), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
save-prefix "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
### Changelog | ||
|
||
All notable changes to this project will be documented in this file. Dates are displayed in UTC. | ||
|
||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). | ||
|
||
#### 0.0.1 | ||
|
||
- bootstrap project [`981dc31`](https://github.com/eea/circularity-frontend/commit/981dc31de36c7089d5fa710cc3b7ff0b6261360a) | ||
- Initial commit [`7e0d92c`](https://github.com/eea/circularity-frontend/commit/7e0d92c66118d97f180722f3a6427d44a8902233) | ||
- yarn.lock [`82b3dc0`](https://github.com/eea/circularity-frontend/commit/82b3dc0545f4e4cea31c2da929a78337fa185f15) | ||
- add cypress integration tests [`a609d2b`](https://github.com/eea/circularity-frontend/commit/a609d2b114be1ac0fa11b1684dfe6a95434a9d73) | ||
- update JENKINSFILE [`23677f1`](https://github.com/eea/circularity-frontend/commit/23677f1d1a6dd8e113a2afc7963ac7f3f61d77af) | ||
- update package.json [`01f1a72`](https://github.com/eea/circularity-frontend/commit/01f1a720ba680cd0b618d3c33fdf584abf0a2182) | ||
- comment pull request for now [`0f015ec`](https://github.com/eea/circularity-frontend/commit/0f015ec5a3ec3cae200afcd28483a38804612160) | ||
- volto-circularity-policy [`ec74293`](https://github.com/eea/circularity-frontend/commit/ec742939dd1bef41fd2f2394f6156f6dae14e363) | ||
- add release-it config [`21f6288`](https://github.com/eea/circularity-frontend/commit/21f62881af4729386d4a264cc74abea1dfa0ff15) | ||
- fix cpyress integration path [`56f00ac`](https://github.com/eea/circularity-frontend/commit/56f00acba659e458562ecff0d477b945c3acde15) | ||
- Update mrs.developer.json [`c67370c`](https://github.com/eea/circularity-frontend/commit/c67370cfa7b95318694c0f2b1b0aa73215c21f25) | ||
- Update package.json [`0ceb862`](https://github.com/eea/circularity-frontend/commit/0ceb862ba9e47b561213c9b1c125c9a67d27cf3f) | ||
- fix missdev [`4e306f2`](https://github.com/eea/circularity-frontend/commit/4e306f25b3abc753cc9b8c0a25f21d673bd74278) | ||
- add @eeacms/volto-sustainability-theme to dependency [`a667e03`](https://github.com/eea/circularity-frontend/commit/a667e03b5996c3b2003d2d6a37a6194ddfac0147) | ||
- add custom package version of circularity policy [`b2e0488`](https://github.com/eea/circularity-frontend/commit/b2e04889f919fb8f6a7ed147ea4b6b78e03581aa) | ||
- eslint [`ab3e365`](https://github.com/eea/circularity-frontend/commit/ab3e365e4630eee189b79b5e34c2c2d9b50e980f) | ||
- make cypress generic [`748debb`](https://github.com/eea/circularity-frontend/commit/748debb26926cf4951a600f7bb0285eb8a88e4b1) | ||
- Update Jenkinsfile [`f20a20c`](https://github.com/eea/circularity-frontend/commit/f20a20cf7e0c77a09fcad16a84d9365805bddf63) | ||
- fix typo [`94f289d`](https://github.com/eea/circularity-frontend/commit/94f289d7576047fa454dd7391b4c601328e8b1fa) | ||
- Update .gitignore [`a6847ac`](https://github.com/eea/circularity-frontend/commit/a6847acc87783cec52e878501d471ff97d90d3cf) |
File renamed without changes.
Oops, something went wrong.