mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Updated Design: Projects (markdown)
parent
6b2b2f3fb8
commit
c6258e74d2
@ -1,5 +1,9 @@
|
|||||||
_**This is a work in progress - I'm trying to capture the design as it evolves.**_
|
_**This is a work in progress - I'm trying to capture the design as it evolves.**_
|
||||||
|
|
||||||
|
Last Update: 25th October.
|
||||||
|
|
||||||
|
Working code in the `projects` branch.
|
||||||
|
|
||||||
- [Description](#description)
|
- [Description](#description)
|
||||||
- [Project files](#project-files)
|
- [Project files](#project-files)
|
||||||
- [Design](#design)
|
- [Design](#design)
|
||||||
@ -27,6 +31,7 @@ Projects exist in the directory `~/.node-red/projects/`
|
|||||||
├── projects
|
├── projects
|
||||||
│ └── my-project
|
│ └── my-project
|
||||||
│ ├── .git
|
│ ├── .git
|
||||||
|
| ├── .gitignore
|
||||||
│ ├── flow.json
|
│ ├── flow.json
|
||||||
│ ├── flow_cred.json
|
│ ├── flow_cred.json
|
||||||
│ ├── package.json
|
│ ├── package.json
|
||||||
@ -41,6 +46,7 @@ Projects exist in the directory `~/.node-red/projects/`
|
|||||||
- README.md – documentation for the flow
|
- README.md – documentation for the flow
|
||||||
- settings.json – project specific settings
|
- settings.json – project specific settings
|
||||||
|
|
||||||
|
- The name of the flow file (default `flow.json`) will be customisable
|
||||||
- The editor will provide facilities to edit each of these files in the appropriate context.
|
- The editor will provide facilities to edit each of these files in the appropriate context.
|
||||||
|
|
||||||
- TBD: A project could contain other files (such as public/html content). Should NR allows you to edit/manage them as well? We don’t want to become a generic IDE.
|
- TBD: A project could contain other files (such as public/html content). Should NR allows you to edit/manage them as well? We don’t want to become a generic IDE.
|
||||||
@ -50,9 +56,12 @@ Projects exist in the directory `~/.node-red/projects/`
|
|||||||
- The package.json file is the standard npm format.
|
- The package.json file is the standard npm format.
|
||||||
- It lists the npm dependencies and any other project metadata.
|
- It lists the npm dependencies and any other project metadata.
|
||||||
- The dependencies do not get installed in the project directory – they get installed at the top level of the user directory (as they would today).
|
- The dependencies do not get installed in the project directory – they get installed at the top level of the user directory (as they would today).
|
||||||
|
- It includes a `node-red` section, under which there is a `settings` section
|
||||||
|
|
||||||
### `settings.json`
|
### `settings.json`
|
||||||
|
|
||||||
|
25-Oct: The purpose of the `settings.json` file is not fully defined yet.
|
||||||
|
|
||||||
- The settings.json file contains project specific settings. They are a subset of those available in the top-level settings.js file. TBD: exactly what settings are supported.
|
- The settings.json file contains project specific settings. They are a subset of those available in the top-level settings.js file. TBD: exactly what settings are supported.
|
||||||
- The settings file is strictly JSON. It cannot contain code as it must be reloadable without side-effects and be writeable by the runtime.
|
- The settings file is strictly JSON. It cannot contain code as it must be reloadable without side-effects and be writeable by the runtime.
|
||||||
- Introduces the concept of flow-variables:
|
- Introduces the concept of flow-variables:
|
||||||
@ -89,12 +98,21 @@ The storage api will be extended to include the basic projects api. Not all stor
|
|||||||
|
|
||||||
```
|
```
|
||||||
StorageModule.projects = {
|
StorageModule.projects = {
|
||||||
init: init,
|
init: init,
|
||||||
listProjects: listProjects,
|
listProjects: Projects.list,
|
||||||
getActiveProject: getActiveProject,
|
getActiveProject: getActiveProject,
|
||||||
setActiveProject: setActiveProject,
|
setActiveProject: setActiveProject,
|
||||||
getProject: getProject,
|
getProject: getProject,
|
||||||
createProject: createProject,
|
createProject: createProject,
|
||||||
|
updateProject: updateProject,
|
||||||
|
getFiles: getFiles,
|
||||||
|
getFile: getFile,
|
||||||
|
stageFile: stageFile,
|
||||||
|
unstageFile: unstageFile,
|
||||||
|
commit: commit,
|
||||||
|
getFileDiff: getFileDiff,
|
||||||
|
getCommits: getCommits,
|
||||||
|
getCommit: getCommit,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -106,6 +124,24 @@ _Note:_ this api will grow as the feature is developed - this isn't the final AP
|
|||||||
|
|
||||||
This API is subject to change as the implementation evolves.
|
This API is subject to change as the implementation evolves.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- `GET /` - List projects
|
||||||
|
- `POST /` - Create project
|
||||||
|
- `PUT /:id` - Update project
|
||||||
|
- `GET /:id` - Get project
|
||||||
|
- `DELETE /:id` - Delete project (TODO)
|
||||||
|
- `GET /:id/files` - Get a projects file listing
|
||||||
|
- `GET /:id/files/:treeish/:filePath` - Get a file for a given treeish description,
|
||||||
|
- `POST /:id/stage/:filePath` - Stage a file from the working dir to index
|
||||||
|
- `POST /:id/stage` - Stage multiple files from the working dir to index
|
||||||
|
- `POST /:id/commit` - Commit the current index
|
||||||
|
- `DELETE /:id/stage/:filePath` - Unstage a file from the index
|
||||||
|
- `DELETE /:id/stage` - Unstage multiple files from the index
|
||||||
|
- `GET /:id/diff/:type/:filePath` - Get a file diff (type = tree | index)
|
||||||
|
- `GET /:id/commits` - Get the project commits
|
||||||
|
- `GET /:id/commits/:sha` - Get an individual commit
|
||||||
|
|
||||||
### `GET /projects`
|
### `GET /projects`
|
||||||
|
|
||||||
Returns a list of all projects available in the editor.
|
Returns a list of all projects available in the editor.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user