From 45cce0490a5467351759e791830a2ff65e724dea Mon Sep 17 00:00:00 2001 From: Nathan Paul Date: Sun, 20 Aug 2023 12:09:59 -0500 Subject: [PATCH 1/3] Change build:release to build-release and update documentation in README --- README.md | 37 ++++++++++++++++++++----------------- package.json | 2 +- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 09d12fb..ac1110c 100644 --- a/README.md +++ b/README.md @@ -53,36 +53,39 @@ Config example: 2. The values setup in the picklist and the values in the configuration must be an exact match. There is no validation to check or correct spelling mistakes in the values. -## Get started with Extensions +## Prerequisites -Building and testing the extension requires following. +1. [Download and install NodeJS](http://nodejs.org) -1. [Download and install NodeJS](http://nodejs.org 'NodeJS Website') -2. [Install tfx-cli](https://docs.microsoft.com/en-us/vsts/extend/publish/command-line?view=vsts) +2. [Install tfx-cli](https://docs.microsoft.com/en-us/vsts/extend/publish/command-line?view=vsts) + ``` + npm install --global tfx-cli + ``` -``` -npm i -g tfx-cli -``` +3. Install dev prerequisites + ``` + npm install + ``` -Install dev prerequisites +### Build the extension ``` -npm install +npm run build-release +npm run package-release ``` -### Create vsix to deploy on test environment - +### Run the extension server locally +First build and package the development version of the extension: ``` -npm run build +npm run build-dev +npm run package-dev ``` -### Run the extension server locally - -Execute following commands in two separate Command Prompts. Denote that in order to test extenstion locally, you need to have certificate and key in the project root called `private.crt` and `private.key`. +Then install the extension. +Serve the extension locally: ``` -npm run watch -npm run serve-dev +npm run start ``` ### Publish the dev extension to marketplace diff --git a/package.json b/package.json index bcafcc1..46cec2c 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "scripts": { "start": "webpack-dev-server --hot --progress --static ./ --port 44300 --https", "build-dev": "webpack --progress --config webpack.dev.config.js", + "build-release": "webpack --progress", "package-dev": "tfx extension create --manifest-globs azure-devops-extension.json --overrides-file configs/dev.json", "package-release": "tfx extension create --manifest-globs azure-devops-extension.json --overrides-file configs/release.json", - "build:release": "webpack --progress", "postbuild": "npm run package", "package": "tfx extension create --manifest-globs azure-devops-extension.json", "gallery-publish": "tfx extension publish --rev-version", From e3fd72c1d3685fdea09711183460905a7e898d59 Mon Sep 17 00:00:00 2001 From: Nathan Paul Date: Sun, 20 Aug 2023 13:37:45 -0500 Subject: [PATCH 2/3] Fix webpack not reloading on change --- package.json | 2 +- webpack.dev.config.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 46cec2c..0af837d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "description": "Extenstion that allows to customize cascading picklists for Azure DevOps.", "private": true, "scripts": { - "start": "webpack-dev-server --hot --progress --static ./ --port 44300 --https", + "start": "webpack-dev-server --hot --progress --static ./ --port 44300 --https --config webpack.dev.config.js", "build-dev": "webpack --progress --config webpack.dev.config.js", "build-release": "webpack --progress", "package-dev": "tfx extension create --manifest-globs azure-devops-extension.json --overrides-file configs/dev.json", diff --git a/webpack.dev.config.js b/webpack.dev.config.js index b84b358..773f82d 100644 --- a/webpack.dev.config.js +++ b/webpack.dev.config.js @@ -11,6 +11,7 @@ const observerConfig = { output: { filename: 'observer.js', path: path.resolve(__dirname, 'dist'), + publicPath: '/dist/' }, devtool: 'source-map', @@ -33,7 +34,7 @@ const observerConfig = { new HtmlWebpackPlugin({ filename: 'observer.html', }), - ], + ] }; const confighubConfig = { @@ -42,6 +43,7 @@ const confighubConfig = { output: { filename: 'confighub.js', path: path.resolve(__dirname, 'dist'), + publicPath: '/dist/' }, devtool: 'source-map', From 43ebcbf7c81c9bd11862c3717c18a01cd9c7dbf1 Mon Sep 17 00:00:00 2001 From: Nathan Paul Date: Sun, 20 Aug 2023 13:58:43 -0500 Subject: [PATCH 3/3] Fix indentation error and add more info about running locally. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ac1110c..9fe64a8 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Config example: 2. [Install tfx-cli](https://docs.microsoft.com/en-us/vsts/extend/publish/command-line?view=vsts) ``` - npm install --global tfx-cli + npm install --global tfx-cli ``` 3. Install dev prerequisites @@ -82,6 +82,8 @@ npm run package-dev ``` Then install the extension. +This only has to be done once. +After installing the extension, additional changes will be served by webpack. Serve the extension locally: ```