Skip to content

Commit 0256e5a

Browse files
Package Updates: add CommonJs builds, update npm packs and add to private preview drop (#132)
1 parent 6de72cc commit 0256e5a

Some content is hidden

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

47 files changed

+232
-151
lines changed

.github/workflows/nightly-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
# Bump alpha package versions
8080
- name: Bump alpha package versions
81-
run: node common/release/node_modules/beachball/bin/beachball canary --canary-name alpha+${{ steps.datetime.outputs.datetime }} --tag dev --no-publish
81+
run: node common/config/node_modules/beachball/bin/beachball canary --canary-name alpha+${{ steps.datetime.outputs.datetime }} --tag dev --no-publish
8282

8383
# Build packages
8484
- name: Build @azure/communication-ui package

.github/workflows/npm-release-bump.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Bump package versions
4545
- name: Bump package versions
46-
run: node common/release/node_modules/beachball/bin/beachball bump
46+
run: node common/config/node_modules/beachball/bin/beachball bump
4747

4848
# Get datetime for release branch name
4949
- name: Create datetime

.github/workflows/npm-release-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Perform changelog check
4141
- name: Guard check - ensure no new changes were introduced
42-
run: node common/release/node_modules/beachball/bin/beachball check
42+
run: node common/config/node_modules/beachball/bin/beachball check
4343

4444
# Builds
4545
- name: Build Packages and Samples

.github/workflows/private-preview-release.yaml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,30 @@ jobs:
2626
run: rush install
2727

2828
- name: Build Packages and Samples
29-
run: rush build -t "@azure/communication-ui"
29+
run: |
30+
rush build -t "@azure/communication-ui"
31+
rush build -t "@azure/acs-chat-declarative"
32+
rush build -t "@azure/acs-chat-selector"
33+
rush build -t "@azure/acs-calling-declarative"
3034
31-
- name: Package Private-Preview Artifact
35+
- name: Package @communication-ui
3236
run: npm pack
3337
working-directory: ./packages/communication-ui/
3438

35-
- name: Archive builds
36-
run: 7z a private-preview.zip ./packages/communication-ui/private-preview/*
39+
- name: Package @azure/acs-chat-declarative
40+
run: npm pack
41+
working-directory: ./packages/acs-chat-declarative/
42+
43+
- name: Package @azure/acs-chat-selector
44+
run: npm pack
45+
working-directory: ./packages/acs-chat-selector/
46+
47+
- name: Package @azure/acs-calling-declarative
48+
run: npm pack
49+
working-directory: ./packages/acs-calling-declarative/
50+
51+
- name: Compile private preview zip
52+
run: 7z a private-preview.zip ./packages/**/private-preview/*
3753

3854
# Get datetime to name and tag the releases with.
3955
- name: Get Release names

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ junit.xml
8787
dist/
8888
build/
8989
temp/
90-
docGen/
90+
docGen/
91+
private-preview/
92+
private-preview.zip

beachball.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
require('./common/release/ts-node-register');
2-
module.exports = require('./common/release/changelog-config').config;
1+
require('./common/config/beachball/ts-node-register');
2+
module.exports = require('./common/config/beachball/changelog-config').config;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Add commonjs support",
4+
"packageName": "@azure/acs-calling-declarative",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Add commonjs support",
4+
"packageName": "@azure/acs-chat-declarative",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Add commonjs support",
4+
"packageName": "@azure/acs-chat-selector",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Exclude config files from npm pack",
4+
"packageName": "@azure/communication-ui",
5+
"email": "[email protected]",
6+
"dependentChangeType": "none"
7+
}

common/release/package.json renamed to common/config/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "release-tools",
2+
"name": "build-tools",
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
@@ -11,8 +11,12 @@
1111
},
1212
"devDependencies": {
1313
"@octokit/rest": "~18.0.6",
14+
"@rollup/plugin-commonjs": "~17.1.0",
1415
"@types/node": "^14.14.10",
1516
"beachball": "~1.53.2",
17+
"rollup": "~2.42.4",
18+
"rollup-plugin-sourcemaps": "~0.6.3",
19+
"rollup-plugin-svg": "~2.0.0",
1620
"ts-node": "^9.1.1"
1721
}
1822
}

common/config/rollup/rollup.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// © Microsoft Corporation. All rights reserved.
2+
3+
import commonjs from '@rollup/plugin-commonjs';
4+
import sourcemaps from 'rollup-plugin-sourcemaps';
5+
import svg from 'rollup-plugin-svg';
6+
7+
export default (packageJson) => ({
8+
context: 'window',
9+
external: [
10+
...(packageJson.dependencies ? Object.keys(packageJson.dependencies) : []),
11+
...(packageJson.peerDependencies ? Object.keys(packageJson.peerDependencies) : [])
12+
],
13+
input: './dist/dist-esm/index.js',
14+
output: {
15+
file: './dist/dist-cjs/index.js',
16+
format: 'cjs',
17+
sourcemap: true
18+
},
19+
plugins: [commonjs(), sourcemaps(), svg()]
20+
});

common/config/rush/command-line.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"commandKind": "global",
1414
"name": "changelog",
1515
"summary": "Runs beachball change",
16-
"shellCommand": "node common/release/node_modules/beachball/bin/beachball",
16+
"shellCommand": "node common/config/node_modules/beachball/bin/beachball",
1717
"safeForSimultaneousRushProcesses": true
1818
},
1919
{
2020
"commandKind": "global",
2121
"name": "changelog:check",
2222
"summary": "Checks change files have been generated",
23-
"shellCommand": "node common/release/node_modules/beachball/bin/beachball check",
23+
"shellCommand": "node common/config/node_modules/beachball/bin/beachball check",
2424
"safeForSimultaneousRushProcesses": true
2525
},
2626
{

common/config/rush/pnpm-lock.yaml

Lines changed: 27 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/contributing-guide/3. running-a-sample-or-storybook.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ cd packages\storybook
5252
rushx start
5353
```
5454

55+
When `rushx start` completes you should be able to view the storybook at: http://localhost:6006/
56+
5557
---
5658

5759
* Next: [Testing your changes](<./4. testing-your-changes.md>)

docs/infrastructure/api-extractor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ API Extractor is run as part of the build commands for each package. Running `ru
2020

2121
## Configuration Files
2222

23-
The primary configuration file can be found here: [common/api-extractor/api-extractor.json](https://github.com/Azure/communication-ui-sdk/blob/main/common/api-extractor/api-extractor.json). Each package has their own `api-extractor.json` that extends from this.
23+
The primary configuration file can be found here: [common/config/api-extractor/api-extractor.json](https://github.com/Azure/communication-ui-sdk/blob/main/common/config/api-extractor/api-extractor.json). Each package has their own `api-extractor.json` that extends from this.
2424

2525
## Gating PRs
2626

docs/infrastructure/beachball.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ For writing a good changelog entry for the change file see: [Tips for writing me
4141

4242
### Package version bumping
4343

44-
This is done by our github actions. If this needs to be down manually you can run `npm run beachball -- bump` under `common/release`.
44+
This is done by our github actions. If this needs to be down manually you can run `npm run beachball -- bump` under `common/config`.
4545
See [creating a release](./creating-a-release.md) for more information.
4646

4747
### Changelog Generation
4848

4949
This happens as part of the `beachball bump` command. In our repo however we have custom changelog renderers to create a feature rich changelog with links to PRs and authors.
5050

51-
These custom renderers are located here: [common/release/changelog-custom-renders.ts](https://github.com/Azure/communication-ui-sdk/blob/main/common/release/changelog-custom-renders.ts).
51+
These custom renderers are located here: [common/config/beachball/changelog-custom-renders.ts](https://github.com/Azure/communication-ui-sdk/blob/main/common/config/beachball/changelog-custom-renders.ts).
5252

5353
## Gating PRs
5454

@@ -57,6 +57,6 @@ To see all PR gates, view [pull requests](./pull-requests.md) docs.
5757

5858
## Configuration Files
5959

60-
The primary beachball configuration file is at: [common/release/changelog-config.ts](https://github.com/Azure/communication-ui-sdk/blob/main/common/release/changelog-config.ts). This is picked up by the root level `beachball.config.js`.
60+
The primary beachball configuration file is at: [common/config/beachball/changelog-config.ts](https://github.com/Azure/communication-ui-sdk/blob/main/common/config/beachball/changelog-config.ts). This is picked up by the root level `beachball.config.js`.
6161

6262
Each `package.json` must also not be marked `private:true` or beachball will ignore it and may optionally contain a `beachball:` section that contains package specific configuration.
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
public/
2-
node_modules/
3-
.vs/
4-
.vscode/
5-
jest/
6-
src/
7-
tests/
8-
scripts/
9-
tsconfig.json
10-
.eslintignore
11-
.prettierignore
12-
.prettierrc
13-
.eslintrc.js
14-
jest.config.js
1+
# Disallow everything by default so new files aren't accidently included:
2+
*
3+
4+
# Allow dist folder, this is the folder that should be packed and published:
5+
!dist/**/*
6+
7+
# Exceptions in the dist folder that should still be disallowed:
8+
dist/dist-esm/mocks/
9+
**/*.test.*
10+
**/*.spec.*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "../../common/api-extractor/api-extractor.json"
2+
"extends": "../../common/config/api-extractor/api-extractor.json"
33
}

0 commit comments

Comments
 (0)