From e409db29b0bed18ddc3e6bd978d6e912668ddbf2 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Thu, 25 Aug 2022 21:58:43 -0700 Subject: [PATCH 1/2] refactor: move package files to top level This PR includes: - Moving `package.json`, `package-lock.json`, `.eslintrc.json`, and `task.json` to the root of the repository - Renaming `buildAndReleaseTask` to `src` - Adding the `build` task as an npm script - Adding `build` to the GitHub Action - Outputting the compiled JavaScript to the `dist` folder, instead of alongside the TypeScript source Signed-off-by: Jamie Magee --- buildAndReleaseTask/.eslintrc.json => .eslintrc.json | 0 .github/workflows/build.yml | 6 +++--- .gitignore | 1 + buildAndReleaseTask/tsconfig.json | 3 --- buildAndReleaseTask/package-lock.json => package-lock.json | 0 buildAndReleaseTask/package.json => package.json | 3 ++- {buildAndReleaseTask => src}/index.ts | 0 {buildAndReleaseTask => src}/writeprovenance.ts | 0 buildAndReleaseTask/task.json => task.json | 0 tsconfig.json | 6 ++++++ 10 files changed, 12 insertions(+), 7 deletions(-) rename buildAndReleaseTask/.eslintrc.json => .eslintrc.json (100%) delete mode 100644 buildAndReleaseTask/tsconfig.json rename buildAndReleaseTask/package-lock.json => package-lock.json (100%) rename buildAndReleaseTask/package.json => package.json (97%) rename {buildAndReleaseTask => src}/index.ts (100%) rename {buildAndReleaseTask => src}/writeprovenance.ts (100%) rename buildAndReleaseTask/task.json => task.json (100%) create mode 100644 tsconfig.json diff --git a/buildAndReleaseTask/.eslintrc.json b/.eslintrc.json similarity index 100% rename from buildAndReleaseTask/.eslintrc.json rename to .eslintrc.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c025355..f73273b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,12 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} cache: "npm" - cache-dependency-path: buildAndReleaseTask/package-lock.json - name: Install packages run: npm ci - working-directory: buildAndReleaseTask - name: Run lint run: npm run lint - working-directory: buildAndReleaseTask + + - name: Build + run: npm run build diff --git a/.gitignore b/.gitignore index fb13972..02cf5bb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules/ *.js *.vsix .taskkey +dist diff --git a/buildAndReleaseTask/tsconfig.json b/buildAndReleaseTask/tsconfig.json deleted file mode 100644 index b16a090..0000000 --- a/buildAndReleaseTask/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/@tsconfig/node16-strictest/tsconfig.json" -} \ No newline at end of file diff --git a/buildAndReleaseTask/package-lock.json b/package-lock.json similarity index 100% rename from buildAndReleaseTask/package-lock.json rename to package-lock.json diff --git a/buildAndReleaseTask/package.json b/package.json similarity index 97% rename from buildAndReleaseTask/package.json rename to package.json index 9531c8c..b280a65 100644 --- a/buildAndReleaseTask/package.json +++ b/package.json @@ -6,6 +6,7 @@ "author": "gattjoe", "license": "Apache-2.0", "scripts": { + "build": "tsc", "lint": "eslint . --ext .ts" }, "dependencies": { @@ -23,4 +24,4 @@ "eslint-plugin-node": "11.1.0", "eslint-plugin-security": "1.5.0" } -} \ No newline at end of file +} diff --git a/buildAndReleaseTask/index.ts b/src/index.ts similarity index 100% rename from buildAndReleaseTask/index.ts rename to src/index.ts diff --git a/buildAndReleaseTask/writeprovenance.ts b/src/writeprovenance.ts similarity index 100% rename from buildAndReleaseTask/writeprovenance.ts rename to src/writeprovenance.ts diff --git a/buildAndReleaseTask/task.json b/task.json similarity index 100% rename from buildAndReleaseTask/task.json rename to task.json diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..14f7b3c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@tsconfig/node16-strictest/tsconfig.json", + "compilerOptions": { + "outDir": "dist" + } +} \ No newline at end of file From 8978d4bdcd237193e1cf5fbd31b420681be29aca Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Mon, 29 Aug 2022 20:52:16 -0700 Subject: [PATCH 2/2] update target paths Signed-off-by: Jamie Magee --- task.json | 2 +- vss-extension.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/task.json b/task.json index 8016cb2..3fdbec0 100644 --- a/task.json +++ b/task.json @@ -33,7 +33,7 @@ "minimumAgentVersion": "2.206.1", "execution": { "Node16": { - "target": "index.js" + "target": "dist/index.js" } } } \ No newline at end of file diff --git a/vss-extension.json b/vss-extension.json index 60a1168..4dda98f 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -22,7 +22,10 @@ ], "files": [ { - "path": "buildAndReleaseTask" + "path": "dist" + }, + { + "path": "node_modules" }, { "path": "images", "addressable": true