Skip to content

Commit

Permalink
Demo: align intl-update workflow with Starter (#1433)
Browse files Browse the repository at this point in the history
- move to intl-update.sh script
- only execute in install.sh, not before build/start

note: demo site has no lang/intl
  • Loading branch information
nsams authored Nov 28, 2023
1 parent a78304d commit 167a804
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
9 changes: 9 additions & 0 deletions demo/admin/intl-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

cd "$(dirname "$0")" || exit

rm -rf ./lang/
mkdir -p ./lang

git clone https://github.com/vivid-planet/comet-demo-lang lang/comet-demo-lang
git clone https://github.com/vivid-planet/comet-lang.git lang/comet-lang
7 changes: 3 additions & 4 deletions demo/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"admin-generator": "rimraf 'src/*/generated' && comet-admin-generator generate crud-generator-config.ts",
"build": "run-s intl:update intl:compile && run-p gql:types generate-block-types && cross-env BABEL_ENV=production webpack --config ./webpack.config.ts --env production --mode production --progress",
"build": "run-s intl:compile && run-p gql:types generate-block-types && cross-env BABEL_ENV=production webpack --config ./webpack.config.ts --env production --mode production --progress",
"generate-block-types": "comet generate-block-types --inputs",
"generate-block-types:watch": "chokidar -s \"**/block-meta.json\" -c \"npm run generate-block-types\"",
"gql:types": "graphql-codegen",
Expand All @@ -14,12 +14,11 @@
"intl:compile:comet": "formatjs compile-folder --format simple --ast lang/comet-lang lang-compiled/comet-lang",
"intl:compile:comet-demo": "formatjs compile-folder --format simple --ast lang/comet-demo-lang lang-compiled/comet-demo-lang",
"intl:extract": "formatjs extract \"src/**/*.ts*\" --ignore ./**.d.ts --out-file lang-extracted/en.json --format simple",
"intl:update": "cd ./lang/comet-lang && git pull && cd ../comet-demo-lang && git pull",
"lint": "run-s intl:update intl:compile && run-p gql:types generate-block-types && run-p lint:eslint lint:tsc && $npm_execpath lint:generated-files-not-modified",
"lint": "run-s intl:compile && run-p gql:types generate-block-types && run-p lint:eslint lint:tsc && $npm_execpath lint:generated-files-not-modified",
"lint:eslint": "eslint --max-warnings 0 --config ./.eslintrc.cli.js --ext .ts,.tsx,.js,.jsx,.json,.md src/ package.json",
"lint:tsc": "tsc --project .",
"lint:generated-files-not-modified": "$npm_execpath admin-generator && git diff --exit-code HEAD --",
"start": "run-s intl:update intl:compile && run-p gql:types generate-block-types && dotenv -- cross-env BABEL_ENV=development webpack serve --config ./webpack.config.ts --mode development"
"start": "run-s intl:compile && run-p gql:types generate-block-types && dotenv -- cross-env BABEL_ENV=development webpack serve --config ./webpack.config.ts --mode development"
},
"dependencies": {
"@apollo/client": "^3.7.0",
Expand Down
8 changes: 3 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ ln -sf ../api/schema.gql ./demo/admin/schema.gql
ln -sf ../api/block-meta.json ./demo/admin/block-meta.json
ln -sf ../api/comet-config.json ./demo/admin/comet-config.json

rm -rf demo/admin/lang
mkdir -p demo/admin/lang
git clone https://github.com/vivid-planet/comet-lang.git demo/admin/lang/comet-lang
git clone https://github.com/vivid-planet/comet-demo-lang demo/admin/lang/comet-demo-lang

# site DEMO
ln -sf ../../.env ./demo/site/.env
ln -sf ../api/schema.gql ./demo/site/schema.gql
ln -sf ../api/block-meta.json ./demo/site/block-meta.json
ln -sf ../api/comet-config.json ./demo/site/comet-config.json

# Lang install
sh ./demo/admin/intl-update.sh

# Build the packages CLI and eslint-plugin to be used for dev startup
pnpm --filter '@comet/cli' --filter '@comet/eslint-plugin' run build

0 comments on commit 167a804

Please sign in to comment.