Skip to content

Commit

Permalink
Add changesets/cli to release embed (calcom#8126)
Browse files Browse the repository at this point in the history
* Add dep versions

* Release new version for embeds

* Add prepublish

* Use prepare script which works with both npm and yarn

* Add changesets correctly

* Add embed publishing command

---------

Co-authored-by: zomars <[email protected]>
  • Loading branch information
hariombalhara and zomars authored May 13, 2023
1 parent 040f03a commit 476119d
Show file tree
Hide file tree
Showing 25 changed files with 700 additions and 24 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.4.1.cjs
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/docs",
"version": "1.0.0",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions apps/web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @calcom/web

## 2.7.16

### Patch Changes

- Updated dependencies
- @calcom/embed-snippet@1.0.7
- @calcom/embed-react@1.0.12
- @calcom/embed-core@1.1.5
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"app-store": "yarn app-store-cli cli",
"create-app": "yarn app-store create",
"edit-app": "yarn app-store edit",
"publish-embed": "yarn workspaces foreach --from=\"@calcom/embed*\" npm publish --access=public",
"delete-app": "yarn app-store delete",
"create-app-template": "yarn app-store create-template",
"edit-app-template": "yarn app-store edit-template",
Expand Down Expand Up @@ -74,6 +75,7 @@
"web": "yarn workspace @calcom/web"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@deploysentinel/playwright": "^0.3.3",
"@playwright/test": "^1.31.2",
"@snaplet/copycat": "^0.3.0",
Expand Down
1 change: 1 addition & 0 deletions packages/app-store-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@calcom/app-store-cli",
"private": true,
"sideEffects": false,
"version": "0.0.0",
"bin": "dist/cli.js",
Expand Down
1 change: 1 addition & 0 deletions packages/app-store/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@calcom/app-store",
"private": true,
"sideEffects": false,
"version": "0.0.0",
"main": "./index.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/config",
"sideEffects": false,
"private": true,
"version": "0.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/dayjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/dayjs",
"description": "Cal.com's Day.js shared library",
"private": true,
"version": "1.0.0",
"main": "./index.ts",
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions packages/embeds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ This folder contains all the various flavours of embeds.
`snippet` contains the Vanilla JS Code Snippet that can be installed on any website and would automatically fetch the `core` library.

Please see the respective folder READMEs for details on them.

## Publishing to NPM - Soon to be automated using changesets github action
To publish the packages. Following steps should be followed. All commands are to be run at the root.

1. `yarn changeset` -> Creates changelog files and adds summary to changelog. Select embed packages only here.
2. `yarn changeset version` -> Bumps the versions as required
3. Get the PR reviewed and merged
4. `yarn publish-embed` -> Releases all packages. We can't use `yarn changeset publish` because it doesn't support workspace: prefix removal yet. See https://github.com/changesets/changesets/issues/432#issuecomment-1016365428
7 changes: 7 additions & 0 deletions packages/embeds/embed-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @calcom/embed-core

## 1.1.5

### Patch Changes

- Add changesets. Use prepack instead of prePublish and prepublish only as that works with both yarn and npm
5 changes: 2 additions & 3 deletions packages/embeds/embed-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcom/embed-core",
"version": "1.1.3",
"version": "1.1.5",
"description": "This is the vanilla JS core script that embeds Cal Link",
"main": "./dist/embed/embed.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -29,8 +29,7 @@
"embed-tests": "yarn playwright test --config=playwright/config/playwright.config.ts",
"embed-tests-quick": "QUICK=true yarn embed-tests",
"embed-tests-update-snapshots:ci": "yarn embed-tests-quick --update-snapshots",
"prepare": "NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"publish-prod:patch": "yarn publish --access public --patch",
"prepack": "NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf ../../../apps/web/public/embed"
},
"files": [
Expand Down
10 changes: 10 additions & 0 deletions packages/embeds/embed-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @calcom/embed-react

## 1.0.12

### Patch Changes

- Add changesets. Use prepack instead of prePublish and prepublish only as that works with both yarn and npm
- Updated dependencies
- @calcom/embed-snippet@1.0.7
- @calcom/embed-core@1.1.5
4 changes: 2 additions & 2 deletions packages/embeds/embed-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@calcom/embed-react",
"sideEffects": false,
"version": "1.0.10",
"version": "1.0.12",
"description": "Embed Cal Link as a React Component",
"license": "SEE LICENSE IN LICENSE",
"repository": {
Expand All @@ -20,9 +20,9 @@
"embed-tests": "yarn playwright test --config=./playwright/config/playwright.config.ts",
"embed-tests-quick": "QUICK=true yarn embed-tests",
"embed-tests-update-snapshots:ci": "yarn embed-tests-quick --update-snapshots",
"prepack": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"embed-web-start": "yarn workspace @calcom/web start",
"embed-dev": "yarn workspace @calcom/embed-react dev",
"publish-prod:patch": "yarn publish --access public --patch",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
"main": "./dist/Cal.umd.js",
Expand Down
9 changes: 9 additions & 0 deletions packages/embeds/embed-snippet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @calcom/embed-snippet

## 1.0.7

### Patch Changes

- Add changesets. Use prepack instead of prePublish and prepublish only as that works with both yarn and npm
- Updated dependencies
- @calcom/embed-core@1.1.5
5 changes: 2 additions & 3 deletions packages/embeds/embed-snippet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@calcom/embed-snippet",
"sideEffects": false,
"version": "1.0.5",
"version": "1.0.7",
"main": "./dist/snippet.umd.js",
"module": "./dist/snippet.es.js",
"description": "Vanilla JS embed snippet that is responsible to fetch @calcom/embed-core and thus show Cal Link as an embed on a page.",
Expand All @@ -16,8 +16,7 @@
"type-check": "tsc --pretty --noEmit",
"type-check:ci": "tsc-absolute --pretty --noEmit",
"lint": "eslint --ext .ts,.js src",
"prepare": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"publish-prod:patch": "yarn publish --access public --patch",
"prepack": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/eslint-plugin-eslint",
"sideEffects": false,
"private": true,
"version": "0.1.0",
"main": "./src/index.js",
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/features/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/feature-auth",
"sideEffects": false,
"private": true,
"description": "Cal.com's main auth code",
"authors": "Cal.com, Inc.",
"version": "1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/features/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/features",
"sideEffects": false,
"private": true,
"description": "Cal.com's main collocation of features",
"authors": "Cal.com, Inc.",
"version": "1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@calcom/lib",
"private": true,
"sideEffects": false,
"version": "0.0.0",
"main": "./index.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/trpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@calcom/trpc",
"sideEffects": false,
"private": true,
"description": "Shared tRPC library for Cal.com",
"authors": "zomars",
"version": "1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@calcom/ui",
"private": true,
"sideEffects": false,
"version": "0.0.0",
"main": "./index.tsx",
Expand Down
Loading

0 comments on commit 476119d

Please sign in to comment.