Using Profound API Workspaces
What is a Workspace?
A workspace is a convenient way of organizing your projects. A workspace is a directory on the file system that includes all of the source code and configuration files needed to make an application work, along with a Git repository for source control. Workspace directories are stored within the 'modules' sub-directory of the Profound.js installation directory. Workspaces from Profound.js can easily be deployed in the cloud on Profound.js Spaces and vice versa.
Use of workspaces in Profound.js is optional, but strongly recommended. On Profound.js Spaces, all applications are organized into workspaces.
Creating a Workspace
To create a new workspace, use the option New→Workspace from the Home section of the ribbon:
Then enter a workspace name and description on the Create Workspace dialog:
The workspace is created and then automatically opened in the IDE.
Workspace Directory Structure
A workspace has the following directory structure. Note that you'll need to select Show Hidden in order to show all of the contents.
Application source code files can go into the main workspace directory, or into sub-directories that you create. This example shows a new/empty workspace – there are no source code files yet.
The '.git' directory contains the Git source control repository.
The '.gitignore' file contains a list of files and directories to be ignored by Git. This is useful when your project contains files that you don't want to commit to source control, such as dependencies from NPM (node_modules), etc.
The '.noderun' directory contains the workspace settings, which are stored in JSON files.
The 'public' directory is where you can place static files that are designed to be served via HTTP, such as images, style sheets, client-side JavaScript files, etc.
The 'README.md' file is a Markdown file that you can use to show a description of your project.
Adding Files and Directories
New files and directories can be added to the workspace by using the right-click options on the Files Tree:
Or by using the New File drop down options on the Home section of the ribbon:
And then saving the file into the workspace directory or a sub-directory, by clicking the Save button in the Home section of the ribbon:
When a workspace is open in the IDE, the default save location will be the workspace directory:
Opening Workspaces
Workspaces can be opened by clicking on the Open option on the Home section of the Ribbon:
And then selecting the workspace from the Workspace tab on the Open Dialog:
Workspaces can also be opened using the Spaces List in the bottom bar:
Clicking a workspace name in the list will open it in a new browser tab.
Renaming Workspaces
To rename a workspace, use the right-click option in the Files Tree to rename the workspace directory:
Changing Workspace Descriptions
To change a workspace description, open the file '.noderun/settings.json' in the workspace directory, and edit the "description" field.
Removing Workspaces
To remove a workspace, click on the minus icon on the Spaces List:
Or use the right-click option in the Files Tree to delete the workspace directory: