ibm-wch-sdk-ng-vcVisual Studio Code extension to assist creating single page applications for Watson Content Hub. The extension builds on top of the WCH SDK and the WCH CLI modules. First stepsMake sure to have access to a WCH Tenant. You can subscribe for a free trial if you don't have any, yet. After subscribing you will you have access to an API URL, your username and your password. Since you will need this triplet of information frequently during the development process, it makes sense to save this in a credential store on your development machine. Credential ManagementFollow the steps outlined in Credential Management to store your credentials. On a Linux based system you can use the WCH: Store Credentials command. In addition to that you might want to configure the Api URL and your username in the configuration section of Visual Studio Code. Head to Getting StartedGet started by working with an existing WCH application or by creating a new one.
Create your first Single Page ApplicationStart the IDE and open an arbitrary folder as your workspace. This will be the parent folder of the application we are going to create. Open the Command Palette and enter the command:
The workflow will ask you for your API URL, the The command will create a new project skeletton with for an Angular 4 based single page application that work with WCH. The generation process will take a little while, in the meantime you will see an activity indicator in the status bare. The result of the command is an application in a subfolder of your workspace. Open this folder to continue. Build and run your ApplicationOpen the application folder in your workspace. Switch to the Integrated Terminal and install the node dependencies:
This may take a little while. When done, type
This will build and start the app in development mode and launch your browser on SnippetsType part of a snippet, press HTML WCH Snippets
CommandsType WCH: Create LayoutThe command creates a layout and a code component for one single content type. When triggered via the context menu on a particular type, this type will be selected. Else the user is presented with a list of existing types and can select one of the types. The command will then ask for a name of the layout and suggests a sensible default. WCH: Create Page TypeThe command creates a new type document that represents a page and adds layouts and layout mappings. The page type is initially empty. The type will only be created in the local file system, it has to be pushed to WCH to be available to the server. The command will then ask for a name of the type. WCH: Push and PullA set of commands allows to push and pull data from WCH using wchtools for the most common usecases of pushing/pulling types, layouts, layout mappings and pages. WCH: Create New Project From TemplateThe command creates a new project based on a project template stored in Git. Enter the project description and select from the desired template. WCH: Store CredentialsThe command stores the credentials for a particular API URL. Use this to guide you through the process described in the Credential Management documentation. ConfigurationFine tune the behaviour of the commands by adding configuration settings. WCH Configuration
Installation
Prerequisites
Sample .wchtoolsoptions.json file
RecommendationsIn addition I recommend the following extensions VideosVisual Studio Code setup for WCH development |