Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'aa/dt-1825' into aa/dt-1877
Browse files Browse the repository at this point in the history
angeloashmore committed Dec 21, 2023
2 parents 34d1fc1 + 84e5db0 commit ca61552
Showing 41 changed files with 1,757 additions and 2,223 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -214,36 +214,3 @@ jobs:
with:
name: e2e-tests-screenshots-cypress
path: cypress/screenshots/

deployment:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/dev') # Job only runs on dev branches
environment: alpha
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: ./.github/actions/setup-node

- name: Install Dependencies
run: |
yarn install
git checkout .
- name: Build essentials
uses: ./.github/actions/build-essential

- name: Version And Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NEXT_PUBLIC_SM_UI_SEGMENT_KEY: Ng5oKJHCGpSWplZ9ymB7Pu7rm0sTDeiG
PUBLIC_SM_INIT_SEGMENT_KEY: JfTfmHaATChc4xueS7RcCBsixI71dJIJ
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
npm_config_preid: ${{ github.ref_name }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git checkout .
yarn bump:alpha
yarn publish:alpha
30 changes: 30 additions & 0 deletions .github/workflows/publish-unstable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish unstable
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: main
workflow_dispatch:
jobs:
publish-unstable:
name: Publish unstable
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'release:') && !github.event.pull_request.draft }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref }}
- name: Use Node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install
- name: Run publish script
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "${GITHUB_ACTOR}"
yarn publish unstable --tolerate-republish
550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.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
@@ -7,6 +7,8 @@ initFields:
initScope: slicemachine
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
supportedArchitectures:
34 changes: 34 additions & 0 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Releasing

## From the CLI

First, ensure you have:

1. Publish access to the `slicemachine` organization and to the
`slice-machine-ui` and `start-slicemachine` packages.
2. Read access to the `SENTRY_AUTH_TOKEN` secret.

Then, if you have access, the steps below explain how to publish packages:

1. Run `git checkout <branch>` to switch to the branch you want to release.
2. Run `git pull` to update the current branch.
3. Run `yarn` to install the project dependencies.
4. Run `yarn clean`, from the top-level directory, to clean the working tree.
5. Run `yarn npm login` to log in to the npm registry.
6. Run `export SENTRY_AUTH_TOKEN=<SENTRY_AUTH_TOKEN>` to add the `SENTRY_AUTH_TOKEN`
variable to the environment of all subsequently executed commands.
7. To publish:
- A stable release, run `yarn publish stable --dry-run <name>:(major|minor|patch) ...`, from the top-level directory.
- An unstable release, run `yarn publish unstable --dry-run`, from the top-level directory.
8. This was a dry run. If everything looks good, you can re-run the same command
without the `--dry-run` flag.

Finally, if the release succeeded, you should:

1. Write/Publish the [release notes](https://github.com/prismicio/slice-machine/releases)
on GitHub.
2. Move all [Linear issues](https://linear.app/prismic/team/DT/all) in _Release → Pending_
to _Release → Done_.

> [!TIP]
> You can use the following command as a starting point for publishing all packages at once: `yarn publish stable --dry-run @slicemachine/adapter-next:patch @slicemachine/adapter-nuxt:patch @slicemachine/adapter-nuxt2:patch @slicemachine/adapter-sveltekit:patch @slicemachine/init:patch @slicemachine/manager:patch @slicemachine/plugin-kit:patch slice-machine-ui:patch start-slicemachine:patch`.
1 change: 0 additions & 1 deletion e2e-projects/next-upgrade/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "next-upgrade",
"version": "1.22.1",
"private": true,
"scripts": {
"dev": "next dev",
2 changes: 1 addition & 1 deletion e2e-projects/next-upgrade/tsconfig.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
1 change: 0 additions & 1 deletion e2e-projects/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "cimsirp",
"version": "1.22.1",
"private": true,
"scripts": {
"dev": "next dev",
1 change: 0 additions & 1 deletion e2e-projects/sveltekit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "sveltekit",
"version": "1.22.1",
"private": true,
"scripts": {
"dev": "vite dev",
5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
},
"packageManager": "yarn@3.6.0",
"scripts": {
"clean": "rimraf --glob '{e2e-projects/*/{.next,.svelte-kit},packages/*/{.next,.svelte-kit,build,coverage,dist,out,package.tgz,storybook-static},playwright/{playwright-report,test-results}}'",
"dev": "concurrently --prefix-colors auto \"yarn:dev:*\"",
"dev:manager": "yarn workspace @slicemachine/manager dev",
"dev:start-slicemachine": "yarn workspace start-slicemachine dev",
@@ -26,11 +27,7 @@
"cypress-setup": "./cypress-setup.sh",
"cypress": "yarn cypress-setup && start-server-and-test 'npm run dev --prefix e2e-projects/cypress-next-app' http://localhost:3000 'SM_ENV=development VITE_ENABLE_SENTRY=false npm run slicemachine --prefix e2e-projects/cypress-next-app' http://localhost:9999 'cypress run'",
"cypress:dev": "yarn cypress-setup && start-server-and-test 'npm run dev --prefix e2e-projects/cypress-next-app' http://localhost:3000 'SM_ENV=staging VITE_ENABLE_SENTRY=false npm run slicemachine --prefix e2e-projects/cypress-next-app' http://localhost:9999 'cypress open'",
"bump:interactive": "lerna version prerelease --preid alpha --no-push --exact",
"bump:alpha": "lerna version prerelease --preid $npm_config_preid --no-changelog --exact --yes",
"bump:production": "lerna version --conventional-graduate --exact",
"publish:alpha": "lerna publish from-package --dist-tag alpha --yes",
"publish:production": "PUBLIC_SM_UI_SEGMENT_KEY=cGjidifKefYb6EPaGaqpt8rQXkv5TD6P PUBLIC_SM_INIT_SEGMENT_KEY=ED3O1FVsa8DteNyRmAuDyMcPoftJ6VdP lerna publish from-package"
"publish": "tsx scripts/publish.ts"
},
"dependenciesMeta": {
"@sentry/cli": {
@@ -47,16 +44,22 @@
}
},
"devDependencies": {
"@types/semver": "7.3.13",
"chalk": "4.1.2",
"concurrently": "7.6.0",
"cypress": "12.8.0",
"cypress-localstorage-commands": "2.2.2",
"cypress-real-events": "1.7.6",
"cypress-wait-until": "1.7.2",
"execa": "7.1.1",
"husky": "8.0.3",
"lerna": "7.4.1",
"lint-staged": "13.2.0",
"mri": "1.2.0",
"prettier": "3.0.3",
"start-server-and-test": "1.15.5"
"rimraf": "5.0.5",
"semver": "7.3.8",
"start-server-and-test": "1.15.5",
"tsx": "4.6.2"
},
"lint-staged": {
"**/packages/slice-machine/**/*.@(js|jsx|ts|tsx|)": [
7 changes: 5 additions & 2 deletions packages/adapter-next/package.json
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
"dev": "vite build --watch",
"format": "prettier --write .",
"lint": "eslint --max-warnings 0 --ext .js,.ts .",
"prepack": "npm run build",
"prepack": "$npm_execpath run build",
"size": "size-limit",
"test": "yarn lint && yarn types && yarn unit && yarn build && yarn size",
"types": "tsc --noEmit",
@@ -89,7 +89,7 @@
"prettier": "3.0.3",
"prettier-plugin-jsdoc": "1.1.1",
"react": "18.2.0",
"rollup-plugin-preserve-directives": "0.1.1",
"rollup-plugin-preserve-directives": "0.2.0",
"size-limit": "8.2.4",
"typescript": "4.9.5",
"vite": "4.3.9",
@@ -102,5 +102,8 @@
},
"engines": {
"node": ">=14.15.0"
},
"publishConfig": {
"access": "public"
}
}
8 changes: 2 additions & 6 deletions packages/adapter-next/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, Plugin } from "vite";
import { defineConfig } from "vite";
import sdk from "vite-plugin-sdk";
import react from "@vitejs/plugin-react";
import preserveDirectives from "rollup-plugin-preserve-directives";
@@ -18,11 +18,7 @@ export default defineConfig({
},
},
rollupOptions: {
plugins: [
// @ts-expect-error - rollup-plugin-preserve-directives has a bundling issue when used in an ESM environment.
// See: https://github.com/Ephem/rollup-plugin-preserve-directives/issues/1
preserveDirectives.default() as Plugin,
],
plugins: [preserveDirectives()],
},
},
test: {
5 changes: 4 additions & 1 deletion packages/adapter-nuxt/package.json
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
"dev": "vite build --watch",
"format": "prettier --write .",
"lint": "eslint --max-warnings 0 --ext .js,.ts .",
"prepack": "npm run build",
"prepack": "$npm_execpath run build",
"size": "size-limit",
"test": "yarn lint && yarn types && yarn unit && yarn build && yarn size",
"types": "tsc --noEmit",
@@ -101,5 +101,8 @@
},
"engines": {
"node": ">=14.15.0"
},
"publishConfig": {
"access": "public"
}
}
5 changes: 4 additions & 1 deletion packages/adapter-nuxt2/package.json
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
"dev": "vite build --watch",
"format": "prettier --write .",
"lint": "eslint --max-warnings 0 --ext .js,.ts .",
"prepack": "npm run build",
"prepack": "$npm_execpath run build",
"size": "size-limit",
"test": "yarn lint && yarn types && yarn unit && yarn build && yarn size",
"types": "tsc --noEmit",
@@ -100,5 +100,8 @@
},
"engines": {
"node": ">=14.15.0"
},
"publishConfig": {
"access": "public"
}
}
5 changes: 4 additions & 1 deletion packages/adapter-sveltekit/package.json
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
"dev:svelte": "svelte-package --input src/simulator --output dist/simulator --watch",
"format": "prettier --write .",
"lint": "eslint --max-warnings 0 --ext .js,.ts .",
"prepack": "npm run build",
"prepack": "$npm_execpath run build",
"size": "size-limit",
"test": "yarn lint && yarn types && yarn unit && yarn build && yarn size",
"types": "tsc --noEmit",
@@ -118,5 +118,8 @@
},
"engines": {
"node": ">=14.15.0"
},
"publishConfig": {
"access": "public"
}
}
5 changes: 4 additions & 1 deletion packages/init/package.json
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
"dev": "vite build --watch",
"format": "prettier --write .",
"lint": "eslint --max-warnings 0 --ext .js,.ts .",
"prepack": "npm run build",
"prepack": "$npm_execpath run build",
"size": "size-limit",
"test": "yarn lint && yarn types && yarn unit && yarn build && yarn size",
"types": "tsc --noEmit",
@@ -93,5 +93,8 @@
"vite": "4.3.9",
"vite-plugin-sdk": "0.1.1",
"vitest": "0.32.0"
},
"publishConfig": {
"access": "public"
}
}
8 changes: 7 additions & 1 deletion packages/init/src/SliceMachineInitProcess.ts
Original file line number Diff line number Diff line change
@@ -137,7 +137,13 @@ export class SliceMachineInitProcess {
appName: pkg.name,
appVersion: pkg.version,
});
await setupSentry();
try {
await setupSentry();
} catch (error) {
// noop - We don't want to stop the user from using Slice Machine
// because of failed tracking set up. We probably couldn't determine the
// Sentry environment.
}
await this.manager.telemetry.track({
event: "command:init:start",
repository: this.options.repository,
Loading

0 comments on commit ca61552

Please sign in to comment.