chore: improve Stackblitz publishing flow (#203)

* chore: hoist local flag to root project

* chore: publish to stackblitz branch with new release

* chore: rename gitignore for stackblitz

* chore: use correct path

* chore: include `.stackblitzrc` file to ensure dev server starts
This commit is contained in:
Josh Larson 2021-11-10 12:01:53 -06:00 committed by GitHub
parent 0b8a73d712
commit 69576610c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 3 deletions

View File

@ -0,0 +1,21 @@
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: Rename gitignore
run: |
mv packages/dev/_gitignore packages/dev/.gitignore
- name: Push to stackblitz branch
uses: EndBug/add-and-commit@v7.4.0
with:
push: 'origin stackblitz --force'

View File

@ -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",

View File

@ -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);

View File

@ -0,0 +1,4 @@
{
"installDependencies": true,
"startCommand": "npm run dev"
}

View File

@ -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}",