|
1 | | -### Create your own MapStore project |
| 1 | +# Create your own MapStore project |
2 | 2 |
|
3 | 3 | To create a new MapStore based project you can use the createProject script: |
4 | 4 |
|
5 | | -``` |
| 5 | +```sh |
6 | 6 | node ./createProject.js <projectType> <projectName> <projectVersion> <projectDescription> <gitRepositoryUrl> <outputFolder> |
7 | 7 | ``` |
8 | 8 |
|
9 | 9 | All the arguments are mandatory: |
10 | | - * **projectName**: short project name that will be used as the repository name on github, webapp path and name in package.json |
11 | | - * **projectType**: type of project to create, currently two types of projects are supported: |
12 | | - - **standard**: is a copy of the standard MapStore project, ready to be used and customized |
13 | | - - **custom**: is a simple (skeleton) project, useful if you want to build a custom application using the SDK |
14 | | - * **projectVersion**: project version in package.json (X.Y.Z) |
15 | | - * **projectDescription**: project description, used in sample index page and as description in package.json |
16 | | - * **gitRepositoryUrl**: full url to the github repository where the project will be published |
17 | | - * **outputFolder**: folder where the project will be created |
18 | 10 |
|
19 | | -At the end of the script execution, the given outputFolder will be populated by all the configuration files needed to start working on the project. Moreover, the local git repo will be initialized and the MapStore submodule added and downloaded. |
| 11 | +* **projectName**: short project name that will be used as the repository name on github, webapp path and name in package.json |
| 12 | +* **projectType**: type of project to create, currently two types of projects are supported: |
| 13 | + * **standard**: is a copy of the standard MapStore project, ready to be used and customized |
| 14 | + * **custom**: is a simple (skeleton) project, useful if you want to build a custom application using the SDK |
| 15 | +* **projectVersion**: project version in package.json (X.Y.Z) |
| 16 | +* **projectDescription**: project description, used in sample index page and as description in package.json |
| 17 | +* **gitRepositoryUrl**: full url to the github repository where the project will be published |
| 18 | +* **outputFolder**: folder where the project will be created |
| 19 | + |
| 20 | +At the end of the script execution, the given outputFolder will be populated by all the configuration files needed to start working on the project. Moreover, the local git repository will be initialized and the MapStore sub-module added and downloaded. |
20 | 21 |
|
21 | 22 | If you create a *standard* project, you can customize it editing **js/app.jsx**: look at the comments for hints and the MapStore documentation for more details. |
22 | 23 |
|
23 | 24 | If you create a *custom* project, you will find a simple application in the **js** folder (app.jsx is the entry point) with two pages (home and main). |
24 | 25 |
|
25 | 26 | The following steps are: |
26 | | - * npm install to download dependencies |
27 | | - * npm start to test the project |
28 | | - * git add / push to publish the initial project on the git repo |
29 | | - * ./build.sh to build the full war |
30 | 27 |
|
31 | | -### Create a new project type |
| 28 | +* npm install to download dependencies |
| 29 | +* npm start to test the project |
| 30 | +* git add / push to publish the initial project on the git repo |
| 31 | +* ./build.sh to build the full war |
| 32 | + |
| 33 | +## Create a new project type |
| 34 | + |
32 | 35 | If you are not happy with the available project types (*standard* and *custom*), you can extend them adding a new folder in **project**. |
33 | 36 |
|
34 | | -The folder will contain two subfolders: |
35 | | - * **static**: for static content, to be copied as is to the project folder |
36 | | - * **templates**: for template files, containing project-dependent variables that will be replaced by the createProject script. You can use the following variables: |
37 | | - - **\_\_PROJECTNAME\_\_**: \<projectName\> parameter value |
38 | | - - **\_\_PROJECTDESCRIPTION\_\_**: \<projectDescription\> parameter value |
39 | | - - **\_\_PROJECTVERSION\_\_**: \<projectVersion\> parameter value |
40 | | - - **\_\_REPOURL\_\_**: \<gitRepositoryUrl\> parameter value |
| 37 | +The folder will contain two sub-folders: |
| 38 | + |
| 39 | +* **static**: for static content, to be copied as is to the project folder |
| 40 | +* **templates**: for template files, containing project-dependent variables that will be replaced by the createProject script. You can use the following variables: |
| 41 | + * **\_\_PROJECTNAME\_\_**: \<projectName\> parameter value |
| 42 | + * **\_\_PROJECTDESCRIPTION\_\_**: \<projectDescription\> parameter value |
| 43 | + * **\_\_PROJECTVERSION\_\_**: \<projectVersion\> parameter value |
| 44 | + * **\_\_REPOURL\_\_**: \<gitRepositoryUrl\> parameter value |
41 | 45 |
|
42 | 46 | In addition to static and templates, the following files from the root MapStore folder will be copied: |
43 | | - * .babelrc |
44 | | - * .editorconfig |
45 | | - * .eslintrc |
46 | | - * .eslintignore |
47 | | - * LICENSE.txt |
| 47 | + |
| 48 | +* .babelrc |
| 49 | +* .editorconfig |
| 50 | +* .eslintrc |
| 51 | +* .eslintignore |
| 52 | +* LICENSE.txt |
0 commit comments