Skip to content

Commit

Permalink
Package Updates: add CommonJs builds, update npm packs and add to pri…
Browse files Browse the repository at this point in the history
…vate preview drop (#132)
  • Loading branch information
JamesBurnside authored Apr 9, 2021
1 parent 6de72cc commit 0256e5a
Show file tree
Hide file tree
Showing 47 changed files with 232 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# Bump alpha package versions
- name: Bump alpha package versions
run: node common/release/node_modules/beachball/bin/beachball canary --canary-name alpha+${{ steps.datetime.outputs.datetime }} --tag dev --no-publish
run: node common/config/node_modules/beachball/bin/beachball canary --canary-name alpha+${{ steps.datetime.outputs.datetime }} --tag dev --no-publish

# Build packages
- name: Build @azure/communication-ui package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-release-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Bump package versions
- name: Bump package versions
run: node common/release/node_modules/beachball/bin/beachball bump
run: node common/config/node_modules/beachball/bin/beachball bump

# Get datetime for release branch name
- name: Create datetime
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

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

# Builds
- name: Build Packages and Samples
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/private-preview-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,30 @@ jobs:
run: rush install

- name: Build Packages and Samples
run: rush build -t "@azure/communication-ui"
run: |
rush build -t "@azure/communication-ui"
rush build -t "@azure/acs-chat-declarative"
rush build -t "@azure/acs-chat-selector"
rush build -t "@azure/acs-calling-declarative"
- name: Package Private-Preview Artifact
- name: Package @communication-ui
run: npm pack
working-directory: ./packages/communication-ui/

- name: Archive builds
run: 7z a private-preview.zip ./packages/communication-ui/private-preview/*
- name: Package @azure/acs-chat-declarative
run: npm pack
working-directory: ./packages/acs-chat-declarative/

- name: Package @azure/acs-chat-selector
run: npm pack
working-directory: ./packages/acs-chat-selector/

- name: Package @azure/acs-calling-declarative
run: npm pack
working-directory: ./packages/acs-calling-declarative/

- name: Compile private preview zip
run: 7z a private-preview.zip ./packages/**/private-preview/*

# Get datetime to name and tag the releases with.
- name: Get Release names
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ junit.xml
dist/
build/
temp/
docGen/
docGen/
private-preview/
private-preview.zip
4 changes: 2 additions & 2 deletions beachball.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('./common/release/ts-node-register');
module.exports = require('./common/release/changelog-config').config;
require('./common/config/beachball/ts-node-register');
module.exports = require('./common/config/beachball/changelog-config').config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add commonjs support",
"packageName": "@azure/acs-calling-declarative",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add commonjs support",
"packageName": "@azure/acs-chat-declarative",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add commonjs support",
"packageName": "@azure/acs-chat-selector",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Exclude config files from npm pack",
"packageName": "@azure/communication-ui",
"email": "[email protected]",
"dependentChangeType": "none"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion common/release/package.json → common/config/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "release-tools",
"name": "build-tools",
"version": "1.0.0",
"private": true,
"scripts": {
Expand All @@ -11,8 +11,12 @@
},
"devDependencies": {
"@octokit/rest": "~18.0.6",
"@rollup/plugin-commonjs": "~17.1.0",
"@types/node": "^14.14.10",
"beachball": "~1.53.2",
"rollup": "~2.42.4",
"rollup-plugin-sourcemaps": "~0.6.3",
"rollup-plugin-svg": "~2.0.0",
"ts-node": "^9.1.1"
}
}
20 changes: 20 additions & 0 deletions common/config/rollup/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// © Microsoft Corporation. All rights reserved.

import commonjs from '@rollup/plugin-commonjs';
import sourcemaps from 'rollup-plugin-sourcemaps';
import svg from 'rollup-plugin-svg';

export default (packageJson) => ({
context: 'window',
external: [
...(packageJson.dependencies ? Object.keys(packageJson.dependencies) : []),
...(packageJson.peerDependencies ? Object.keys(packageJson.peerDependencies) : [])
],
input: './dist/dist-esm/index.js',
output: {
file: './dist/dist-cjs/index.js',
format: 'cjs',
sourcemap: true
},
plugins: [commonjs(), sourcemaps(), svg()]
});
4 changes: 2 additions & 2 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"commandKind": "global",
"name": "changelog",
"summary": "Runs beachball change",
"shellCommand": "node common/release/node_modules/beachball/bin/beachball",
"shellCommand": "node common/config/node_modules/beachball/bin/beachball",
"safeForSimultaneousRushProcesses": true
},
{
"commandKind": "global",
"name": "changelog:check",
"summary": "Checks change files have been generated",
"shellCommand": "node common/release/node_modules/beachball/bin/beachball check",
"shellCommand": "node common/config/node_modules/beachball/bin/beachball check",
"safeForSimultaneousRushProcesses": true
},
{
Expand Down
46 changes: 27 additions & 19 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/contributing-guide/3. running-a-sample-or-storybook.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ cd packages\storybook
rushx start
```

When `rushx start` completes you should be able to view the storybook at: http://localhost:6006/

---

* Next: [Testing your changes](<./4. testing-your-changes.md>)
Expand Down
2 changes: 1 addition & 1 deletion docs/infrastructure/api-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ API Extractor is run as part of the build commands for each package. Running `ru

## Configuration Files

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.
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.

## Gating PRs

Expand Down
6 changes: 3 additions & 3 deletions docs/infrastructure/beachball.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ For writing a good changelog entry for the change file see: [Tips for writing me

### Package version bumping

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

### Changelog Generation

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.

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).
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).

## Gating PRs

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

## Configuration Files

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`.
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`.

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.
24 changes: 10 additions & 14 deletions packages/acs-calling-declarative/.npmignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
public/
node_modules/
.vs/
.vscode/
jest/
src/
tests/
scripts/
tsconfig.json
.eslintignore
.prettierignore
.prettierrc
.eslintrc.js
jest.config.js
# Disallow everything by default so new files aren't accidently included:
*

# Allow dist folder, this is the folder that should be packed and published:
!dist/**/*

# Exceptions in the dist folder that should still be disallowed:
dist/dist-esm/mocks/
**/*.test.*
**/*.spec.*
2 changes: 1 addition & 1 deletion packages/acs-calling-declarative/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "../../common/api-extractor/api-extractor.json"
"extends": "../../common/config/api-extractor/api-extractor.json"
}
Loading

0 comments on commit 0256e5a

Please sign in to comment.