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:
parent
0b8a73d712
commit
69576610c4
21
.github/workflows/publish_stackblitz.yml
vendored
Normal file
21
.github/workflows/publish_stackblitz.yml
vendored
Normal 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'
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev-lib": "yarn workspace @shopify/hydrogen dev",
|
"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": "run-s build-lib build-dev build-cli",
|
||||||
"build-lib": "yarn workspace @shopify/hydrogen build",
|
"build-lib": "yarn workspace @shopify/hydrogen build",
|
||||||
"build-cli": "yarn workspace @shopify/hydrogen-cli build",
|
"build-cli": "yarn workspace @shopify/hydrogen-cli build",
|
||||||
|
|
|
@ -12,7 +12,7 @@ const {copy} = require('./utils');
|
||||||
|
|
||||||
const devPath = path.resolve(__dirname, '..', '..', 'dev');
|
const devPath = path.resolve(__dirname, '..', '..', 'dev');
|
||||||
const templatePath = path.resolve(__dirname, '..', './template-hydrogen');
|
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
|
// Remove the symlink and replace it with a folder
|
||||||
fs.unlinkSync(templatePath);
|
fs.unlinkSync(templatePath);
|
||||||
|
|
4
packages/dev/.stackblitzrc
Normal file
4
packages/dev/.stackblitzrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"installDependencies": true,
|
||||||
|
"startCommand": "npm run dev"
|
||||||
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "LOCAL_DEV=true vite",
|
"dev": "vite",
|
||||||
"lint": "npm-run-all lint:*",
|
"lint": "npm-run-all lint:*",
|
||||||
"lint:js": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx src",
|
"lint:js": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx src",
|
||||||
"lint:css": "stylelint ./src/**/*.{css,sass,scss}",
|
"lint:css": "stylelint ./src/**/*.{css,sass,scss}",
|
||||||
|
|
Loading…
Reference in a new issue