Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: add shopify, webcomponents packages to monorepo #3779

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,15 @@ jobs:
path: packages/sdks-tests/playwright-report/
retention-days: 30

gen1-sdk-core:
name: Gen 1 SDK Core
gen1:
name: Build (Gen 1)
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
package: ['sdk', 'webcomponents', 'shopify']

steps:
- name: Setup
uses: actions/checkout@v4
Expand All @@ -176,7 +181,7 @@ jobs:
run: yarn g:nx test @builder.io/sdk

- name: Build Core
run: yarn g:nx build @builder.io/sdk
run: yarn g:nx build @builder.io/${{ matrix.package }}

gen1-react-sdk:
name: Gen 1 React SDK
Expand Down Expand Up @@ -241,12 +246,13 @@ jobs:
retention-days: 30

build:
name: Build
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
package: ['webcomponents', 'widgets']
package: ['widgets']

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions .yarn/versions/550b138a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
undecided:
- "@builder.io/sdk"
- "@builder.io/react"
- "@builder.io/shopify"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"packages/react-tests/*",
"packages/sdks/e2e/*",
"packages/sdks/snippets/*",
"packages/sdks/output/*"
"packages/sdks/output/*",
"packages/webcomponents",
"packages/shopify"
],
"devDependencies": {
"@changesets/cli": "^2.27.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default {
// restoreMocks: false,

// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,
rootDir: 'src',

// A list of paths to directories that Jest should use to search for files in
// roots: [
Expand Down
19 changes: 0 additions & 19 deletions packages/react/.travis.yml

This file was deleted.

12 changes: 11 additions & 1 deletion packages/react/src/functions/with-builder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { Component } from '@builder.io/sdk';
import { BuilderBlock } from '../decorators/builder-block.decorator';

export function withBuilder(component: Function, options: Component) {
type DeriveReactComponentOrClass<A, B, C> =
Component extends React.Component<A, B, C>
? React.Component<A, B, C>
: Component extends React.ComponentClass<A, B>
? React.ComponentClass<A, B>
: never;

export function withBuilder<A, B, C, T = DeriveReactComponentOrClass<A, B, C>>(
component: T,
options: Component
): T {
BuilderBlock(options)(component as any);
return component;
}
2 changes: 1 addition & 1 deletion packages/shopify/js.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './js/index.js';
export * from './js/dist/index.js';
4 changes: 2 additions & 2 deletions packages/shopify/js/utils/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function toThenable(val: IterableIterator<any> | Thenable | any): Thenabl
try {
state = (val as IterableIterator<any>).next(prev);
} catch (err) {
return mkReject(err);
return mkReject(err as Error);
}

if (state.done) return mkResolve(state.value);
Expand All @@ -51,7 +51,7 @@ export function toThenable(val: IterableIterator<any> | Thenable | any): Thenabl
try {
state = (val as IterableIterator<any>).throw!(err);
} catch (e) {
return mkReject(e);
return mkReject(e as Error);
}
if (state.done) return mkResolve(state.value);
return reduce(state.value);
Expand Down
Loading
Loading