Skip to content

Commit d89e8de

Browse files
authored
[NodeJS] Updates to streamline package size (#8871)
* Move to lerna and workspaces * Update AC version; bump node install for pipelines * Updates to ci job * Fix pipeline path * Switch back to Windows build agent * Move to ADO npm feed * Authenticate ci job with ADO * Workaround for npm concurrency issue on Windows * disable react-testapp * Fix some spacing issues * Add note on node version * Try ubuntu runner for js-ci.yaml
1 parent 61d2472 commit d89e8de

File tree

83 files changed

+69458
-85347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+69458
-85347
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,5 @@ _deps
319319
### CMake Patch ###
320320
# External projects
321321
*-prefix/
322+
323+
**/.nx/*

.pipelines/js-ci.yml

+25-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pr:
1010

1111
pool:
1212
name: Azure Pipelines
13-
vmImage: windows-2019
13+
vmImage: ubuntu-22.04
1414
demands:
1515
- npm
1616

@@ -30,7 +30,6 @@ parameters:
3030
type: object
3131
default:
3232
- adaptivecards-ui-testapp
33-
- adaptivecards-react-testapp
3433

3534
- name: test_projects
3635
displayName: "project in tests/."
@@ -41,28 +40,35 @@ parameters:
4140
- unit-tests
4241

4342
steps:
44-
- task: NodeTool@0
45-
name: NodeTool1
46-
displayName: Use Node 14.x
43+
- task: UseNode@1
44+
displayName: Use Node 20.x
4745
inputs:
48-
versionSpec: 14.x
46+
version: '20.x'
4947

50-
- bash: |
51-
npm install -g [email protected]
52-
workingDirectory: source/nodejs
53-
displayName: 'Bash - npm install -g npm 8.11.0'
54-
55-
- bash: |
56-
npm ci
57-
npx lerna bootstrap --ci
58-
npx lerna run release
59-
workingDirectory: source/nodejs
60-
displayName: 'Bash - lerna bootstrap'
48+
- task: npmAuthenticate@0
49+
displayName: 'npm authenticate'
50+
inputs:
51+
workingFile: 'source/nodejs/.npmrc'
6152

6253
- bash: |
63-
npx lerna run test
54+
npm cache clean --force
55+
npm ci --maxsockets=1
6456
workingDirectory: source/nodejs
65-
displayName: 'Run all tests'
57+
displayName: 'npm ci'
58+
59+
- task: Npm@1
60+
displayName: 'npm exec - lerna run release'
61+
inputs:
62+
command: 'custom'
63+
customCommand: 'exec lerna run release --stream'
64+
workingDir: 'source/nodejs'
65+
66+
- task: Npm@1
67+
displayName: 'npm exec - lerna run test'
68+
inputs:
69+
command: 'custom'
70+
customCommand: 'exec lerna run test --stream'
71+
workingDir: 'source/nodejs'
6672
condition: failed() # This is disabled because of issue 6874
6773

6874
- ${{ each target_package in parameters.target_packages }}:

.pipelines/js-release.yml

+5-24
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trigger: none
55

66
pool:
77
name: Azure Pipelines
8-
vmImage: ubuntu-20.04
8+
vmImage: ubuntu-22.04
99
demands:
1010
- npm
1111

@@ -26,37 +26,21 @@ parameters:
2626
default: true
2727

2828
steps:
29-
- task: NodeTool@0
30-
name: NodeTool1
31-
displayName: Use Node 14.x
29+
- task: UseNode@1
30+
displayName: Use Node 20.x
3231
inputs:
33-
versionSpec: 14.x
32+
versionSpec: '20.x'
3433

3534
- bash: |
36-
npm install -g [email protected]
37-
workingDirectory: source/nodejs
38-
displayName: 'Bash - npm install -g npm 8.11.0'
39-
40-
- bash: |
41-
npm ci
35+
npm ci --maxsockets=1
4236
workingDirectory: source/nodejs
4337
displayName: 'Bash - npm ci'
4438

45-
- bash: |
46-
npx lerna bootstrap --ci
47-
workingDirectory: source/nodejs
48-
displayName: 'Bash - npx lerna bootstrap --ci'
49-
5039
- bash: |
5140
npx lerna run release
5241
workingDirectory: source/nodejs
5342
displayName: 'Bash - npx lerna run release'
5443

55-
- bash: |
56-
npm run audit-all -- --no-fix
57-
workingDirectory: source/nodejs
58-
displayName: 'Bash - lerna-audit --no-fix'
59-
6044
- ${{ each target_package in parameters.target_packages }}:
6145
- ${{ if eq(parameters.dry_run, true) }}:
6246
- task: Npm@1
@@ -81,6 +65,3 @@ steps:
8165
git push --tags
8266
workingDirectory: source/android/adaptivecards
8367
displayName: 'Push git tag'
84-
85-
86-

source/nodejs/.husky/pre-commit

-12
This file was deleted.

source/nodejs/.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registry=https://microsoft.pkgs.visualstudio.com/AdaptiveCards/_packaging/npm-public/npm/registry/
2+
always-auth=true
3+
install-strategy=nested

source/nodejs/README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ This directory contains all the JS packages for adaptive cards:
1313
Removed JS packages:
1414
* `adaptivecards-fabric` - A set of Fabric UI extensions for the Adaptive Cards JS renderer. This package has been deprecated. Please migrate to [`adaptivecards-fluentui`](https://www.npmjs.com/package/adaptivecards-fluentui). The source code is available in [21.09](https://github.com/microsoft/AdaptiveCards/releases/tag/21.09) or before releases.
1515

16+
## Prerequisites
17+
18+
- Node 20+
19+
20+
## Authenticate with npm registry
21+
22+
1. `vsts-npm-auth -config .npmrc` in `source/nodejs`
23+
1624
## Bootstrap the repo
1725

1826
We use lerna to manage package linking and building.
1927

2028
1. `cd source/nodejs`
2129
2. `npm install`
22-
3. `npx lerna bootstrap`
2330

2431
## Build
2532

@@ -74,4 +81,4 @@ Pre-requisite 2: Web drivers must be installed, if working with edge it can be d
7481

7582
1. `cd tests/ui-tests`
7683
2. `npm run build`
77-
3. `npm run test`
84+
3. `npm run test`

0 commit comments

Comments
 (0)