From 3fc437f962fd5f71bc89a5695faf797400b60664 Mon Sep 17 00:00:00 2001 From: Jeff Jacobson Date: Thu, 24 Oct 2024 16:42:54 -0700 Subject: [PATCH] ci: :construction_worker: update scripts & azure pipeline config --- azure-pipelines.yml | 48 +++++++++++++++++------------------ package.json | 2 +- tools/copy-wsdot-webstyles.ts | 1 + 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 493fbb51..4b056ad1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,21 +40,32 @@ stages: inputs: version: 22.X - # Install project dependencies using npm in a clean state. - - task: Npm@1 - name: npm_install - displayName: NPM Clean Install (CI) + - task: Cache@2 + enabled: false inputs: - # The npm command to run. 'ci' installs dependencies based on the lock file. - command: ci + key: 'pnpm | "$(Agent.OS)" | pnpm-lock.yaml' + path: $(pnpm_config_cache) + displayName: Cache pnpm + - script: | + corepack enable + displayName: "Setup pnpm" - - task: Npm@1 - name: npm_test - displayName: NPM Test - continueOnError: true - inputs: - command: custom - customCommand: test + + # - script: | + # corepack enable + # corepack prepare pnpm@latest-9 --activate + # pnpm config set store-dir $(pnpm_config_cache) + # displayName: "Setup pnpm" + + - script: | + pnpm install + pnpm run build + displayName: "pnpm install and build" + + - script: | + pnpm test + name: pnpm_test + displayName: "pnpm test" - task: PublishTestResults@2 name: publish_test_results @@ -77,17 +88,6 @@ stages: inputs: summaryFileLocation: coverage/cobertura-coverage.xml - # Run the npm build script to compile the project. - - task: Npm@1 - name: run_build - displayName: NPM Build - inputs: - command: custom - # The npm command to run the build script defined in package.json. - customCommand: run build - # Sets the current working directory for this task to the sources directory. - workingDir: $(Build.SourcesDirectory) - # Copy the build output (dist folder) to the staging directory for artifact publishing. - task: CopyFiles@2 name: copy_files diff --git a/package.json b/package.json index 98e352a3..0bb6443c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Milepost map written with ArcGIS Maps API for JavaScript", "type": "module", "scripts": { - "copy-files": "tsx tools/copy-wsdot-webstyles.ts && tsx tools/copy-calcite-assets.ts", + "prepare": "tsx tools/copy-wsdot-webstyles.ts && tsx tools/copy-calcite-assets.ts", "build": "vite build", "watch": "vite build -- --watch", "preview": "vite preview", diff --git a/tools/copy-wsdot-webstyles.ts b/tools/copy-wsdot-webstyles.ts index 96594fa3..ab253833 100644 --- a/tools/copy-wsdot-webstyles.ts +++ b/tools/copy-wsdot-webstyles.ts @@ -17,6 +17,7 @@ await mkdir(destinationFolder, { recursive: true }); // Copy the files from the @wsdot/web-styles package into the destination folder. await cp(wsdotWebStylesFolder, destinationFolder, { preserveTimestamps: true, + dereference: true, recursive: true, filter: (src) => { // Exclude package.json and README.md.