Skip to content

Commit

Permalink
Merge pull request #29 from BuilderIO/main
Browse files Browse the repository at this point in the history
bombastictranz/builder.io
  • Loading branch information
bombastictranz authored Jun 22, 2024
2 parents a0aa51f + 0bc01fc commit fb6db20
Show file tree
Hide file tree
Showing 400 changed files with 24,166 additions and 9,257 deletions.
9 changes: 1 addition & 8 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"@e2e/*",
"@e2e/gen1-next",
"@e2e/gen1-remix",
"@e2e/gen1-react",
"@builder.io/sdk-angular",
"@e2e/angular"
]
"ignore": ["@e2e/*", "@e2e/gen1-next", "@e2e/gen1-remix", "@e2e/gen1-react", "@snippet/*"]
}
10 changes: 6 additions & 4 deletions .github/actions/yarn-nm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# - latest: https://gist.github.com/belgattitude/042f9caf10d029badbde6cf9d43e400a #
# #
# Versions: #
# - 1.2.1 - 25-05-2024 - fix a missing action/cache not upraded to v4 #
# - 1.2.0 - 01-05-2024 - action/cache upraded to v4 #
# - 1.1.0 - 22-07-2023 - Option to enable npm global cache folder. #
# - 1.0.4 - 15-07-2023 - Fix corepack was always enabled. #
# - 1.0.3 - 05-07-2023 - YARN_ENABLE_MIRROR to false (speed up cold start) #
Expand Down Expand Up @@ -77,7 +79,7 @@ runs:
echo "NPM_GLOBAL_CACHE_FOLDER=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: ♻️ Restore yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-download-cache
with:
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
Expand All @@ -88,23 +90,23 @@ runs:
- name: ♻️ Restore node_modules
if: inputs.cache-node-modules == 'true'
id: yarn-nm-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ inputs.cwd }}/**/node_modules
key: yarn-nm-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ steps.yarn-config.outputs.CURRENT_BRANCH }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }}

- name: ♻️ Restore global npm cache folder
if: inputs.cache-npm-cache == 'true'
id: npm-global-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-config.outputs.NPM_GLOBAL_CACHE_FOLDER }}
key: npm-global-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }}

- name: ♻️ Restore yarn install state
if: inputs.cache-install-state == 'true' && inputs.cache-node-modules == 'true'
id: yarn-install-state-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ inputs.cwd }}/.yarn/ci-cache
key: yarn-install-state-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ steps.yarn-config.outputs.CURRENT_BRANCH }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }}
Expand Down
146 changes: 104 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

steps:
- name: Setup
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'

Expand All @@ -34,6 +34,9 @@ jobs:
cache-install-state: true

- name: Run prettier
run: yarn workspace @builder.io/root ci:lint

- name: Run eslint
run: yarn workspace @builder.io/sdks ci:lint:sdks

- name: Typecheck
Expand All @@ -50,31 +53,32 @@ jobs:
# we still want to run all the SDK tests even if one fails, to get a full picture of the state of the SDKs.
fail-fast: false
matrix:
sdk: ['svelte', 'qwik', 'react-native', 'react', 'nextjs', 'solid', 'vue', 'angular']
include:
- sdk: svelte
sdk-name: svelte
- sdk: qwik
sdk-name: qwik
- sdk: react-native
sdk-name: react-native
- sdk: react
sdk-name: react
- sdk: nextjs
sdk-name: react-nextjs
- sdk: solid
sdk-name: solid
- sdk: vue
sdk-name: vue
- sdk: angular
sdk-name: angular
e2e-server:
[
'svelte',
'sveltekit',
'react-native',
'solid',
'solid-start',
'qwik-city',
'react',
'remix',
'hydrogen',
'next-pages-dir',
'next-app-dir-client',
'next-app-dir',
'vue',
'nuxt',
'angular',
'angular-ssr',
]

steps:
- name: Setup
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'

Expand All @@ -84,18 +88,67 @@ jobs:
cache-node-modules: true
cache-install-state: true

- name: Build E2E apps
run: yarn workspace @builder.io/sdks e2e:build:${{ matrix.sdk }}

- name: Run E2E tests
run: yarn workspace @builder.io/sdks e2e:run:${{ matrix.sdk }}
run: yarn nx test @e2e/${{ matrix.e2e-server }}

- name: Upload Playwright Report
uses: actions/upload-artifact@v3
# Only upload the report if the tests failed
if: ${{ failure() }}
with:
name: ${{ matrix.sdk }}-playwright-report
name: ${{ matrix.e2e-server }}-playwright-report
path: packages/sdks-tests/playwright-report/
retention-days: 30

sdks-snippets:
name: Gen 2 SDK Snippets
runs-on: ubuntu-latest

strategy:
# we still want to run all the SDK tests even if one fails, to get a full picture of the state of the SDKs.
fail-fast: false
matrix:
snippet:
[
'vue',
'nuxt',
'react',
'angular',
'angular-ssr',
'qwik-city',
'next-app-dir',
'next-app-dir-client',
'next-pages-dir',
'svelte',
'sveltekit',
'solid',
'react-native',
]

steps:
- name: Setup
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'

- name: 📥 Monorepo install
uses: ./.github/actions/yarn-nm-install
with:
cache-node-modules: true
cache-install-state: true

- name: Run snippets tests
run: yarn nx test @snippet/${{ matrix.snippet }}

- name: Upload Playwright Report
uses: actions/upload-artifact@v3
# Only upload the report if the tests failed
if: ${{ failure() }}
with:
name: ${{ matrix.snippet }}-snippet-playwright-report
path: packages/sdks-tests/playwright-report/
retention-days: 30

Expand All @@ -105,10 +158,10 @@ jobs:

steps:
- name: Setup
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'

Expand All @@ -125,12 +178,17 @@ jobs:
name: Gen 1 React SDK
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
e2e-server: ['gen1-react', 'gen1-next', 'gen1-remix']

steps:
- name: Setup
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'

Expand All @@ -140,23 +198,27 @@ jobs:
cache-node-modules: true
cache-install-state: true

- name: Build E2E apps
run: yarn workspace @builder.io/packages e2e:build:old-react

- name: Run E2E tests
run: yarn workspace @builder.io/packages e2e:run:old-react
run: yarn nx test @e2e/${{ matrix.e2e-server }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: actions/checkout@v4

- name: Use node version 18
uses: actions/setup-node@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'

- run: npm run ci:lint
- name: 📥 Monorepo install
uses: ./.github/actions/yarn-nm-install
with:
cache-node-modules: true
cache-install-state: true

- run: yarn ci:lint

build:
runs-on: ubuntu-latest
Expand All @@ -167,10 +229,10 @@ jobs:
package: ['webcomponents', 'widgets']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use node version 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'

Expand All @@ -179,7 +241,7 @@ jobs:
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
- uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
Expand Down
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# we only want to lint the mono-repo, exclude everything else
plugins
examples
starters

packages/*
!packages/sdks-tests
!packages/sdks
!packages/react
!packages/core
!packages/react-tests

coverage
node_modules
dist
Expand All @@ -8,6 +20,7 @@ docs
.nuxt
.expo
build
.svelte-kit

# This code is generated by Mitosis, and Mitosis is responsible for prettifying the output.
packages/sdks/output/
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
/packages/angular/ @BuilderIO/sdks
/packages/core/ @BuilderIO/sdks

## SDK snippets
/packages/sdks/snippets @BuilderIO/sdks @samijaber @kapunahelewong

# E-commerce plugins
/plugins/magento2/ @BuilderIO/e-commerce-plugins
Expand Down
Loading

0 comments on commit fb6db20

Please sign in to comment.