From 3aa461bf8204f9e16da4d27d34e1615a9c554cf9 Mon Sep 17 00:00:00 2001 From: Tiberiu Ichim Date: Thu, 17 Sep 2020 11:43:55 +0300 Subject: [PATCH] Initial commit --- .gitignore | 16 ++++++++++++ .release-it.json | 15 +++++++++++ CHANGELOG.md | 5 ++++ DEVELOP.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE.md | 9 +++++++ README.md | 55 ++++++++++++++++++++++++++++++++++++++++ bootstrap | 8 ++++++ package.json | 16 ++++++++++++ src/index.js | 5 ++++ 9 files changed, 195 insertions(+) create mode 100644 .gitignore create mode 100644 .release-it.json create mode 100644 CHANGELOG.md create mode 100644 DEVELOP.md create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 bootstrap create mode 100644 package.json create mode 100644 src/index.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..211dab2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.vscode/ +.history +logs +*.log +npm-debug.log* +.DS_Store +*.swp +yarn-error.log + +node_modules +build +dist +.env.local +.env.development.local +.env.test.local +.env.production.local diff --git a/.release-it.json b/.release-it.json new file mode 100644 index 0000000..b5f478c --- /dev/null +++ b/.release-it.json @@ -0,0 +1,15 @@ +{ + "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": "v${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": { + "before:init": "yarn test", + "after:bump": "npx auto-changelog --commit-limit false -p" + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3742d31 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.1.0 + +- Initial release diff --git a/DEVELOP.md b/DEVELOP.md new file mode 100644 index 0000000..f4f1e67 --- /dev/null +++ b/DEVELOP.md @@ -0,0 +1,66 @@ +# volto-addon-template + +## Develop + +Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/) + +1. Install `mrs.developer` + + $ npm install -g mrs.developer + +1. Install `@plone/create-volto-app` + + $ npm install -g @plone/create-volto-app + +1. Create new volto app + + $ create-volto-app my-volto-project + $ cd my-volto-project + +1. Update `package.json` with the following information: + + { + "scripts": { + "develop": "missdev --config=jsconfig.json --output=addons" + }, + + "addons": [ + "@eeacms/volto-addon-template" + ], + } + +1. Add the following to `mrs.developer.json`: + + { + "volto-addon-template": { + "url": "https://github.com/eea/volto-addon-template.git", + "package": "@eeacms/volto-addon-template", + "branch": "develop", + "path": "src" + } + } + +1. Install + + $ yarn develop + $ yarn + +1. Start backend + + $ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e VERSIONS="plone.restapi=7.0.0a5" -e ADDONS="kitconcept.volto" plone:5 + + ...wait for backend to setup and start - `Ready to handle requests`: + + $ docker logs -f plone + + ...you can also check http://localhost:8080/Plone + +1. Start frontend + + $ yarn start + +1. Go to http://localhost:3000 + +1. Happy hacking! + + $ cd src/addons/volto-addon-template/ diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..0992c00 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2020 European Environment Agency + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..17e946e --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# volto-addon-template +[![Releases](https://img.shields.io/github/v/release/eea/volto-addon-template)](https://github.com/eea/volto-addon-template/releases) + +[Volto](https://github.com/plone/volto) add-on + +## Features + +### + +Demo GIF + +## Getting started + +1. Create new volto project if you don't already have one: + ``` + $ npm install -g @plone/create-volto-app + $ create-volto-app my-volto-project + $ cd my-volto-project + ``` + +1. Update `package.json`: + ``` JSON + "addons": [ + "@eeacms/volto-addon-template" + ], + + "dependencies": { + "@eeacms/volto-addon-template": "github:eea/volto-addon-template#0.1.0" + } + ``` + +1. Install new add-ons and restart Volto: + ``` + $ yarn + $ yarn start + ``` + +1. Go to http://localhost:3000 + +1. Happy editing! + +## How to contribute + +See [DEVELOP.md](DEVELOP.md). + +## Copyright and license + +The Initial Owner of the Original Code is European Environment Agency (EEA). +All Rights Reserved. + +See [LICENSE.md](LICENSE.md) for details. + +## Funding + +[European Environment Agency (EU)](http://eea.europa.eu) diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..c2897d3 --- /dev/null +++ b/bootstrap @@ -0,0 +1,8 @@ +#!/bin/bash +TEMPLATE="volto-addon-template" +ADDON="$(basename $PWD)" + +echo "Replacing $TEMPLATE with $ADDON" +grep -rlZ $TEMPLATE . --exclude="bootstrap" --exclude-dir=".git" | xargs -0 sed -i "s/$TEMPLATE/$ADDON/g" +echo "Done!" +echo "See git diff for details" diff --git a/package.json b/package.json new file mode 100644 index 0000000..ffee30c --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "@eeacms/volto-addon-template", + "version": "0.1.0", + "description": "volto-addon-template: Volto add-on", + "main": "src/index.js", + "repository": "https://github.com/eea/volto-addon-template", + "author": "European Environment Agency: IDM2 A-Team", + "license": "MIT", + "devDependencies": { + "release-it": "*" + }, + "scripts": { + "release": "release-it", + "bootstrap": "./bootstrap" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..cb042f0 --- /dev/null +++ b/src/index.js @@ -0,0 +1,5 @@ +const applyConfig = (config) => { + return config; +}; + +export default applyConfig;