Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Oct 30, 2020
0 parents commit 6b0ba4b
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/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://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
},
"hooks": {
"before:init": "yarn test",
"after:bump": "npx auto-changelog --commit-limit false -p"
}
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0

- Initial release
52 changes: 52 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs.developer`

$ npm install -g yo
$ npm install -g @plone/generator-volto
$ npm install -g mrs.developer

1. Create new volto app

$ yo @plone/volto my-volto-project --addon @eeacms/volto-addon-template
$ cd my-volto-project

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 plone

...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/
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 yo @plone/generator-volto
$ yo @plone/volto my-volto-project --addon @eeacms/volto-addon-template
$ cd my-volto-project
```

1. If you already have a volto project, just update `package.json`:
``` JSON
"addons": [
"@eeacms/volto-addon-template"
],

"dependencies": {
"@eeacms/volto-addon-template": "1.0.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](https://github.com/eea/volto-addon-template/blob/master/DEVELOP.md).

## Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA).
All Rights Reserved.

See [LICENSE.md](https://github.com/eea/volto-addon-template/blob/master/LICENSE.md) for details.

## Funding

[European Environment Agency (EU)](http://eea.europa.eu)
30 changes: 30 additions & 0 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const path = require('path');
const fs = require('fs');

const currentDir = path.basename(process.cwd());

const bootstrap = function (ofile) {
fs.readFile(ofile, 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
var result = data.replace(/volto-addon-template/g, currentDir);

fs.writeFile(ofile, result, 'utf8', function (err) {
if (err) {
return console.log(err);
}
});
});
}

fs.readdir(".", { withFileTypes: true }, (err, dirents) => {
const files = dirents
.filter(dirent => dirent.isFile())
.map(dirent => dirent.name);
files.forEach(function (file) {
if (file != 'bootstrap.js') {
bootstrap(file);
}
});
});
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@eeacms/volto-addon-template",
"version": "0.1.0",
"description": "volto-addon-template: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
"license": "MIT",
"homepage": "https://github.com/eea/volto-addon-template",
"keywords": [
"volto-addon",
"volto",
"plone",
"react"
],
"repository": {
"type": "git",
"url": "git@github.com:eea/volto-addon-template.git"
},
"devDependencies": {
"release-it": "*"
},
"scripts": {
"release": "release-it",
"bootstrap": "node bootstrap"
}
}
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const applyConfig = (config) => {
return config;
};

export default applyConfig;

0 comments on commit 6b0ba4b

Please sign in to comment.