Skip to content

Commit

Permalink
feat(react/client): BREAKING CHANGES (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz authored May 25, 2022
1 parent 51be083 commit 20a8993
Show file tree
Hide file tree
Showing 190 changed files with 16,002 additions and 8,008 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dist/
esm/
sandpack/
file-resolver-protocol.ts
file-resolver-protocol.ts
examples/
cypress/
144 changes: 70 additions & 74 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI
on: [pull_request, push]
on: [pull_request]

jobs:
install:
name: Install
name: Install & build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -15,63 +15,43 @@ jobs:
with:
node-version-file: .nvmrc

- name: Setup | Cache
uses: c-hive/gha-yarn-cache@v2

- name: Setup | Install dependencies
run: yarn install --frozen-lockfile

- name: Setup | Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: |
node_modules
packages/*/node_modules
key: modules-${{ hashFiles('yarn.lock') }}

build:
name: Build
runs-on: ubuntu-18.04
timeout-minutes: 10
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1

- name: Setup | Node.js
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache
uses: c-hive/gha-yarn-cache@v2

- name: Setup | Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn run build
- name: Cache react build
uses: actions/cache@v3

- name: Cache | react build
uses: actions/upload-artifact@v2
with:
path: sandpack-react/dist
key: sandpack-react-${{ github.run_id }}
restore-keys: sandpack-react-

- name: Cache client build
uses: actions/cache@v3
name: sandpack-react-${{ github.sha }}

- name: Cache | client build
uses: actions/upload-artifact@v2
with:
path: sandpack-client/dist
key: sandpack-client-${{ github.run_id }}
restore-keys: sandpack-client-

name: sandpack-client-${{ github.sha }}

- name: Cache | theme build
uses: actions/upload-artifact@v2
with:
path: sandpack-themes/dist
name: sandpack-themes-${{ github.sha }}

sizebot:
name: Sizebot
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install, build]
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1
Expand All @@ -80,37 +60,43 @@ jobs:
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Setup | Restore react build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-react-${{ github.sha }}
path: sandpack-react/dist
key: sandpack-react-${{ github.run_id }}


- name: Setup | Restore client build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-client-${{ github.sha }}
path: sandpack-client/dist
key: sandpack-client-${{ github.run_id }}

- name: Setup | Restore themes build
uses: actions/download-artifact@v2
with:
name: sandpack-themes-${{ github.sha }}
path: sandpack-themes/dist

- name: Bot script
run: node scripts/sizebot/index.js
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

chromatic-deployment:
name: Chromatic deployment
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install, build]
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1
Expand All @@ -119,26 +105,32 @@ jobs:
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Setup | Restore react build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-react-${{ github.sha }}
path: sandpack-react/dist
key: sandpack-react-${{ github.run_id }}


- name: Setup | Restore client build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-client-${{ github.sha }}
path: sandpack-client/dist
key: sandpack-client-${{ github.run_id }}

- name: Setup | Restore theme build
uses: actions/download-artifact@v2
with:
name: sandpack-themes-${{ github.sha }}
path: sandpack-themes/dist

- name: Publish to Chromatic
uses: chromaui/action@v1
Expand All @@ -151,7 +143,7 @@ jobs:
name: Integration tests
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install, build]
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1
Expand All @@ -160,26 +152,32 @@ jobs:
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Setup | Restore react build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-react-${{ github.sha }}
path: sandpack-react/dist
key: sandpack-react-${{ github.run_id }}


- name: Setup | Restore client build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-client-${{ github.sha }}
path: sandpack-client/dist
key: sandpack-client-${{ github.run_id }}

- name: Setup | Restore theme build
uses: actions/download-artifact@v2
with:
name: sandpack-themes-${{ github.sha }}
path: sandpack-themes/dist

- name: Cypress run
uses: cypress-io/github-action@v2
Expand All @@ -191,7 +189,7 @@ jobs:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install, build]
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1
Expand All @@ -200,26 +198,26 @@ jobs:
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Setup | Restore react build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-react-${{ github.sha }}
path: sandpack-react/dist
key: sandpack-react-${{ github.run_id }}


- name: Setup | Restore client build
uses: actions/cache@v3
uses: actions/download-artifact@v2
with:
name: sandpack-client-${{ github.sha }}
path: sandpack-client/dist
key: sandpack-client-${{ github.run_id }}

- name: Test | Jest
run: yarn run test
Expand All @@ -228,7 +226,6 @@ jobs:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1
Expand All @@ -237,7 +234,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
Expand All @@ -253,7 +250,6 @@ jobs:
name: Format
runs-on: ubuntu-18.04
timeout-minutes: 10
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1
Expand All @@ -262,7 +258,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup | Node.js
uses: actions/setup-node@v2
with:
node-version: "14.16.1"
node-version: "14.17.0"

- name: Setup | Authenticate with Registry
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
Expand All @@ -87,6 +87,7 @@ jobs:
run: |
yarn workspace @codesandbox/sandpack-client build:publish
yarn workspace @codesandbox/sandpack-react build:publish
yarn workspace @codesandbox/sandpack-themes build:publish
- name: Prepare | Lerna Version
run: lerna version --conventional-commits --conventional-prerelease --yes
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Setup | Node.js
uses: actions/setup-node@v2
with:
node-version: "14.16.1"
node-version: "14.17.0"

- name: Setup | Authenticate with Registry
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
Expand All @@ -83,12 +83,13 @@ jobs:
path: bundler

- name: Prepare | Lerna Version
run: yarn lerna version --yes --no-private
run: yarn lerna version major --yes --no-private

- name: Prepare | Build
run: |
yarn workspace @codesandbox/sandpack-client build:publish
yarn workspace @codesandbox/sandpack-react build:publish
yarn workspace @codesandbox/sandpack-themes build:publish
- name: Sizebot | Generate
run: node scripts/sizebot/createCurrentSizes.js
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,5 @@ dist
# Mac
.DS_Store

# Autogenerate docs
website/docs/docs/api/client
website/docs/docs/api/react

cypress/videos
cypress/screenshots
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v14.17.0
Loading

0 comments on commit 20a8993

Please sign in to comment.