-
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 #6 from eea/upgrade-latest-volto
upgrade to latest volto and adapt to new Blocks/extensibility system
- Loading branch information
Showing
56 changed files
with
22,810 additions
and
30,780 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,41 @@ | ||
const jsConfig = require('./jsconfig').compilerOptions; | ||
const path = require('path'); | ||
const projectRootPath = __dirname; | ||
const packageJson = require(path.join(projectRootPath, 'package.json')); | ||
|
||
const pathsConfig = jsConfig.paths; | ||
let voltoPath = './node_modules/@plone/volto'; | ||
Object.keys(pathsConfig).forEach(pkg => { | ||
if (pkg === '@plone/volto') { | ||
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][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: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`, | ||
settings: { | ||
'import/resolver': { | ||
alias: { | ||
map: [ | ||
['@plone/volto', '@plone/volto/src'], | ||
...addonAliases, | ||
['@package', `${__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 |
---|---|---|
|
@@ -16,3 +16,4 @@ data | |
src/develop | ||
src/addons | ||
npm-cache | ||
omelette |
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,16 @@ | ||
.vscode/ | ||
logs | ||
*.log | ||
npm-debug.log* | ||
.DS_Store | ||
|
||
coverage | ||
node_modules | ||
build | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
data | ||
omelette |
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 |
---|---|---|
@@ -1,74 +1,22 @@ | ||
# Based on https://github.com/plone/volto/blob/master/entrypoint.sh | ||
FROM node:12-stretch-slim | ||
|
||
FROM node:10-jessie as build | ||
|
||
ARG NPM_CONFIG_REGISTRY | ||
ARG MAX_OLD_SPACE_SIZE=8192 | ||
|
||
ENV NODE_OPTIONS=--max_old_space_size=$MAX_OLD_SPACE_SIZE | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y git bsdmainutils vim-nox mc \ | ||
RUN runDeps="openssl ca-certificates patch" \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends $runDeps \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN npm i -g mrs-developer | ||
COPY . /opt/frontend/ | ||
RUN chown -R node /opt/frontend/ | ||
|
||
WORKDIR /opt/frontend/ | ||
|
||
COPY . . | ||
# RUN chmod +x optimize_node_modules.sh | ||
|
||
RUN mkdir -p /opt/frontend/src/develop | ||
|
||
RUN chown -R node /opt/frontend | ||
|
||
USER node | ||
|
||
RUN echo "prefix = \"/home/node\"\n" > /home/node/.npmrc | ||
RUN rm -rf node_modules .git package-lock.json | ||
|
||
# RUN npm install mr-developer | ||
|
||
#RUN node_modules/.bin/mrdeveloper --config=jsconfig.json --no-config --output=addons | ||
RUN missdev | ||
|
||
RUN make activate-all | ||
|
||
# RUN NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY npm ci | ||
RUN NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY npm install | ||
|
||
# RUN ./optimize_node_modules.sh | ||
# RUN make clean-addons | ||
# RUN rm -f package-lock.json | ||
|
||
RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build | ||
|
||
# Second stage build | ||
FROM node:10-jessie | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y git bsdmainutils vim-nox mc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /opt/frontend/ | ||
|
||
COPY entrypoint-prod.sh /opt/frontend/entrypoint.sh | ||
RUN chmod +x entrypoint.sh | ||
|
||
COPY package.json . | ||
COPY package-lock.json . | ||
|
||
COPY --from=build /opt/frontend/public ./public | ||
COPY --from=build /opt/frontend/build ./build | ||
|
||
RUN chown -R node /opt/frontend | ||
|
||
USER node | ||
|
||
RUN rm -rf package-lock.json | ||
RUN NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY npm install --production | ||
RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn \ | ||
&& RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build \ | ||
&& rm -rf /home/node/.cache | ||
|
||
EXPOSE 3000 3001 4000 4001 | ||
|
||
ENTRYPOINT ["/opt/frontend/entrypoint-prod.sh"] | ||
CMD ["yarn", "start:prod"] | ||
CMD ["yarn", "start:prod"] |
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 |
---|---|---|
@@ -1,13 +1 @@ | ||
const baseCfg = require('@plone/volto/babel'); | ||
// "react-loadable/babel" | ||
|
||
module.exports = function(api) { | ||
const voltoConfig = baseCfg(api); | ||
const presets = voltoConfig.presets; | ||
const plugins = [...voltoConfig.plugins]; | ||
return { | ||
plugins, | ||
presets, | ||
sourceType: 'unambiguous', | ||
}; | ||
}; | ||
module.exports = require('@plone/volto/babel'); |
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,24 @@ | ||
#!/usr/bin/env bash | ||
PARAM=$1 | ||
if [ -z $PARAM ]; then | ||
PARAM='not forced' | ||
fi | ||
if [ ! -z "$SENTRY_AUTH_TOKEN" ] && [ ! -z "$SENTRY_URL" ] && [ ! -z "$SENTRY_ORG" ] && [ ! -z "$SENTRY_PROJECT" ] && [ ! -z "$SENTRY_RELEASE" ]; then | ||
CREATE=1 | ||
if [[ ! $PARAM = '--force' ]]; then | ||
if ./node_modules/@sentry/cli/sentry-cli releases info $SENTRY_RELEASE | grep -q $SENTRY_RELEASE; then | ||
CREATE=0 | ||
fi | ||
fi | ||
if [ $CREATE = 1 ]; then | ||
./node_modules/@sentry/cli/sentry-cli releases new $SENTRY_RELEASE | ||
./node_modules/@sentry/cli/sentry-cli releases files $SENTRY_RELEASE upload ./build/public/static/ --url-prefix "~/static" | ||
./node_modules/@sentry/cli/sentry-cli releases finalize $SENTRY_RELEASE | ||
fi | ||
if [ $CREATE = 0 ]; then | ||
echo "Release $SENTRY_RELEASE already exists" | ||
echo "Use --force if you still want to upload the source maps" | ||
fi | ||
else | ||
echo "SENTRY is not configured" | ||
fi |
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
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 |
---|---|---|
@@ -1,48 +1,6 @@ | ||
{ | ||
"addons": [ | ||
"volto-addons", | ||
"volto-blocks", | ||
"volto-ckeditor", | ||
"volto-corsproxy", | ||
"volto-datablocks", | ||
"volto-drafteditor", | ||
"volto-mosaic", | ||
"volto-plotlycharts", | ||
"volto-sidebar" | ||
], | ||
"compilerOptions": { | ||
"baseUrl": "src", | ||
"paths": { | ||
"volto-addons": [ | ||
"develop/volto-addons/src" | ||
], | ||
"volto-base": [ | ||
"develop/volto-base/src" | ||
], | ||
"volto-blocks": [ | ||
"develop/volto-blocks/src" | ||
], | ||
"volto-ckeditor": [ | ||
"develop/volto-ckeditor/src" | ||
], | ||
"volto-datablocks": [ | ||
"develop/volto-datablocks/src" | ||
], | ||
"volto-drafteditor": [ | ||
"develop/volto-drafteditor/src" | ||
], | ||
"volto-embed": [ | ||
"develop/volto-embed/src" | ||
], | ||
"volto-mosaic": [ | ||
"develop/volto-mosaic/src" | ||
], | ||
"volto-plotlycharts": [ | ||
"develop/volto-plotlycharts/src" | ||
], | ||
"volto-sidebar": [ | ||
"develop/volto-sidebar/src" | ||
] | ||
} | ||
} | ||
"compilerOptions": { | ||
"paths": {}, | ||
"baseUrl": "src" | ||
} | ||
} |
Oops, something went wrong.