From 959573f24afacbfdd05d671504a6ddc3f40bb461 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 10 Nov 2021 10:08:24 -0600 Subject: [PATCH 1/5] chore: hoist local flag to root project --- package.json | 2 +- packages/dev/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 517e4c6206..0285337538 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "scripts": { "dev-lib": "yarn workspace @shopify/hydrogen dev", - "dev-server": "VITE_INSPECT=1 yarn workspace dev dev", + "dev-server": "LOCAL_DEV=true VITE_INSPECT=1 yarn workspace dev dev", "build": "run-s build-lib build-dev build-cli", "build-lib": "yarn workspace @shopify/hydrogen build", "build-cli": "yarn workspace @shopify/hydrogen-cli build", diff --git a/packages/dev/package.json b/packages/dev/package.json index 25c0fb830a..86e7408e03 100644 --- a/packages/dev/package.json +++ b/packages/dev/package.json @@ -5,7 +5,7 @@ "license": "MIT", "private": true, "scripts": { - "dev": "LOCAL_DEV=true vite", + "dev": "vite", "lint": "npm-run-all lint:*", "lint:js": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx src", "lint:css": "stylelint ./src/**/*.{css,sass,scss}", From bcdf91bdc06fd3d7722b91e635992fb6af687116 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 10 Nov 2021 10:18:53 -0600 Subject: [PATCH 2/5] chore: publish to stackblitz branch with new release --- .github/workflows/publish_stackblitz.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/publish_stackblitz.yml diff --git a/.github/workflows/publish_stackblitz.yml b/.github/workflows/publish_stackblitz.yml new file mode 100644 index 0000000000..b507355bdf --- /dev/null +++ b/.github/workflows/publish_stackblitz.yml @@ -0,0 +1,18 @@ +name: Publish to Stackblitz + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + name: Publish latest release to Stackblitz + steps: + - name: Checkout the code + uses: actions/checkout@v2 + - name: Push to stackblitz branch + uses: EndBug/add-and-commit@v7.4.0 + with: + push: 'origin stackblitz --force' + From 1b2757b96823b66d9a5c5888518fc02c10550cc3 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 10 Nov 2021 10:34:09 -0600 Subject: [PATCH 3/5] chore: rename gitignore for stackblitz --- .github/workflows/publish_stackblitz.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish_stackblitz.yml b/.github/workflows/publish_stackblitz.yml index b507355bdf..fbce3db68b 100644 --- a/.github/workflows/publish_stackblitz.yml +++ b/.github/workflows/publish_stackblitz.yml @@ -11,6 +11,9 @@ jobs: steps: - name: Checkout the code uses: actions/checkout@v2 + - name: Rename gitignore + run: | + mv _gitignore .gitignore - name: Push to stackblitz branch uses: EndBug/add-and-commit@v7.4.0 with: From 4bba5ef106a2b1d84df68d16087efc479158fb31 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 10 Nov 2021 10:39:55 -0600 Subject: [PATCH 4/5] chore: use correct path --- .github/workflows/publish_stackblitz.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_stackblitz.yml b/.github/workflows/publish_stackblitz.yml index fbce3db68b..970509c73a 100644 --- a/.github/workflows/publish_stackblitz.yml +++ b/.github/workflows/publish_stackblitz.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v2 - name: Rename gitignore run: | - mv _gitignore .gitignore + mv packages/dev/_gitignore packages/dev/.gitignore - name: Push to stackblitz branch uses: EndBug/add-and-commit@v7.4.0 with: From c473939c072bdf9991527de4a5b61f57f0a9b88d Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 10 Nov 2021 10:44:37 -0600 Subject: [PATCH 5/5] chore: include `.stackblitzrc` file to ensure dev server starts --- .../create-hydrogen-app/scripts/tmp-copy-template-from-dev.js | 2 +- packages/dev/.stackblitzrc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 packages/dev/.stackblitzrc diff --git a/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js b/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js index ef11ce4858..cd50c36805 100644 --- a/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js +++ b/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js @@ -12,7 +12,7 @@ const {copy} = require('./utils'); const devPath = path.resolve(__dirname, '..', '..', 'dev'); const templatePath = path.resolve(__dirname, '..', './template-hydrogen'); -const skipFiles = ['node_modules', 'dist']; +const skipFiles = ['node_modules', 'dist', '.stackblitzrc']; // Remove the symlink and replace it with a folder fs.unlinkSync(templatePath); diff --git a/packages/dev/.stackblitzrc b/packages/dev/.stackblitzrc new file mode 100644 index 0000000000..d98146f4d0 --- /dev/null +++ b/packages/dev/.stackblitzrc @@ -0,0 +1,4 @@ +{ + "installDependencies": true, + "startCommand": "npm run dev" +}