Skip to content

Commit

Permalink
Merge pull request #5277 from Shopify/rename-doc-scripts
Browse files Browse the repository at this point in the history
Tidy up documentation scripts
  • Loading branch information
gonzaloriestra authored Jan 28, 2025
2 parents 8b805e7 + 6c6ef29 commit 95b8209
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
node-version: "22"
- name: Build TSDoc docs
run: pnpm nx run-many --all --skip-nx-cache --target=docs:generate --output-style=stream
run: pnpm build-api-docs --output-style=stream
- name: Build Markdown files into HTML
uses: actions/jekyll-build-pages@v1
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/shopify-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ jobs:
run: pnpm refresh-readme
- name: Check if there are changes
run: 'test -z "$(git status --porcelain "packages/cli/README.md" )" || { echo -e "Run pnpm refresh-readme before pushing new commands or flags. Diff here:\n\n$(git diff)" ; exit 1; }'
- name: Refresh documentation
run: pnpm refresh-documentation
- name: Refresh code documentation
run: pnpm refresh-code-documentation
- name: Check if there are changes
run: 'test -z "$(git status --porcelain)" || { echo -e "Run pnpm refresh-documentation when you update functions with autogenerated examples. Diff here:\n\n$(git diff)" ; exit 1; }'
run: 'test -z "$(git status --porcelain)" || { echo -e "Run pnpm refresh-code-documentation when you update functions with autogenerated examples. Diff here:\n\n$(git diff)" ; exit 1; }'
- name: Build shopify.dev docs
run: pnpm update-docs
run: pnpm build-dev-docs
- name: Check if there are changes
run: 'test -z "$(git status --porcelain "docs-shopify.dev/generated/*.json" )" || { echo -e "Run (pnpm update-docs) before pushing new commands or flags." ; exit 1; }'
run: 'test -z "$(git status --porcelain "docs-shopify.dev/generated/*.json" )" || { echo -e "Run (pnpm build-dev-docs) before pushing new commands or flags." ; exit 1; }'

pr-platform-dependent:
name: '[PR] Test with Node ${{ matrix.node }} in ${{ matrix.os }}'
Expand Down
File renamed without changes.
55 changes: 27 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,39 @@
"private": true,
"type": "module",
"scripts": {
"package": "bin/package.js",
"update-bugsnag": "bin/update-bugsnag.js",
"graph": "nx graph",
"shopify": "nx build cli && node packages/cli/bin/dev.js",
"shopify:run": "node packages/cli/bin/dev.js",
"create-app": "nx build create-app && cross-env SHOPIFY_FLAG_PACKAGE_MANAGER=npm node packages/create-app/bin/dev.js",
"build-api-docs": "nx run-many --target=build-api-docs --all --skip-nx-cache",
"build-dev-docs": "pnpm shopify docs generate && sh ./bin/docs/build-dev-docs.sh",
"build:affected": "nx affected --target=build",
"build": "nx run-many --target=build --all --skip-nx-cache",
"bundle-for-release": "nx run-many --target=bundle --all --skip-nx-cache",
"changeset-build-no-docs": "changeset version && pnpm install --no-frozen-lockfile && pnpm build && bin/update-cli-kit-version.js",
"changeset-manifests": "changeset version && pnpm install --no-frozen-lockfile && pnpm refresh-manifests && pnpm refresh-readme && pnpm refresh-code-documentation && bin/update-cli-kit-version.js",
"clean": "nx run-many --target=clean --all --skip-nx-cache && nx reset",
"docs:generate": "nx run-many --target=docs:generate --all --skip-nx-cache",
"lint": "nx run-many --target=lint --all --skip-nx-cache",
"create-app": "nx build create-app && cross-env SHOPIFY_FLAG_PACKAGE_MANAGER=npm node packages/create-app/bin/dev.js",
"deploy-experimental": "node bin/deploy-experimental.js",
"graph": "nx graph",
"graphql-codegen:get-graphql-schemas": "bin/get-graphql-schemas.js",
"graphql-codegen": "nx run-many --target=graphql-codegen --all",
"knip": "knip",
"lint:affected": "nx affected --target=lint",
"lint:fix": "nx run-many --target=lint:fix --all --skip-nx-cache",
"lint:fix:affected": "nx affected --target=lint:fix",
"test": "nx run-many --target=test --all --skip-nx-cache",
"test:unit": "nx run-many --target=test --all --skip-nx-cache --exclude=features",
"test:features": "pnpm nx run features:test",
"lint:fix": "nx run-many --target=lint:fix --all --skip-nx-cache",
"lint": "nx run-many --target=lint --all --skip-nx-cache",
"package": "bin/package.js",
"refresh-code-documentation": "nx run-many --target=refresh-code-documentation --all --skip-nx-cache",
"refresh-manifests": "nx run-many --target=refresh-manifests --all --skip-nx-cache && bin/prettify-manifests.js && pnpm refresh-readme",
"refresh-readme": "nx run-many --target=refresh-readme --all --skip-nx-cache",
"refresh-templates": "nx run-many --target=refresh-templates --all --skip-nx-cache",
"shopify:run": "node packages/cli/bin/dev.js",
"shopify": "nx build cli && node packages/cli/bin/dev.js",
"test:affected": "nx affected --target=test",
"test:features": "pnpm nx run features:test",
"test:regenerate-snapshots": "nx build cli && packages/features/snapshots/regenerate.sh",
"type-check": "nx run-many --target=type-check --all --skip-nx-cache",
"test:unit": "nx run-many --target=test --all --skip-nx-cache --exclude=features",
"test": "nx run-many --target=test --all --skip-nx-cache",
"type-check:affected": "nx affected --target=type-check",
"build": "nx run-many --target=build --all --skip-nx-cache",
"bundle-for-release": "nx run-many --target=bundle --all --skip-nx-cache",
"build:affected": "nx affected --target=build",
"refresh-templates": "nx run-many --target=refresh-templates --all --skip-nx-cache",
"refresh-manifests": "nx run-many --target=refresh-manifests --all --skip-nx-cache && bin/prettify-manifests.js && pnpm refresh-readme",
"changeset-manifests": "changeset version && pnpm install --no-frozen-lockfile && pnpm refresh-manifests && pnpm refresh-readme && pnpm refresh-documentation && bin/update-cli-kit-version.js",
"changeset-build-no-docs": "changeset version && pnpm install --no-frozen-lockfile && pnpm build && bin/update-cli-kit-version.js",
"refresh-documentation": "nx run-many --target=refresh-documentation --all --skip-nx-cache",
"refresh-readme": "nx run-many --target=refresh-readme --all --skip-nx-cache",
"build-docs": "sh ./bin/docs/build-docs.sh",
"knip": "knip",
"graphql-codegen": "nx run-many --target=graphql-codegen --all",
"graphql-codegen:get-graphql-schemas": "bin/get-graphql-schemas.js",
"deploy-experimental": "node bin/deploy-experimental.js",
"update-docs": "pnpm shopify docs generate && pnpm build-docs"
"type-check": "nx run-many --target=type-check --all --skip-nx-cache",
"update-bugsnag": "bin/update-bugsnag.js"
},
"devDependencies": {
"@bugsnag/source-maps": "^2.3.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"scripts": {
"build": "nx build",
"clean": "nx clean",
"docs:generate": "nx docs:generate",
"docs:open": "nx docs:open",
"build-api-docs": "nx build-api-docs",
"open-api-docs": "nx open-api-docs",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "cross-env NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
Expand All @@ -56,7 +56,7 @@
"test:coverage": "nx test:coverage",
"test:watch": "nx test:watch",
"type-check": "nx type-check",
"refresh-documentation": "nx refresh-documentation"
"refresh-code-documentation": "nx refresh-code-documentation"
},
"eslintConfig": {
"extends": [
Expand Down
12 changes: 6 additions & 6 deletions packages/cli-kit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
"cwd": "packages/cli-kit"
}
},
"docs:generate": {
"build-api-docs": {
"executor": "nx:run-commands",
"outputs": [
"{workspaceRoot}/docs"
],
"options": {
"command": "node ./scripts/generate-docs.js",
"command": "node ./scripts/build-api-docs.js",
"cwd": "packages/cli-kit"
}
},
"docs:open": {
"open-api-docs": {
"executor": "nx:run-commands",
"dependsOn": [
"docs:generate"
"build-api-docs"
],
"options": {
"command": "open ../../docs/api/cli-kit/index.html",
Expand Down Expand Up @@ -102,10 +102,10 @@
"cwd": "packages/cli-kit"
}
},
"refresh-documentation": {
"refresh-code-documentation": {
"executor": "nx:run-commands",
"options": {
"command": "FORCE_HYPERLINK=0 node --loader ts-node/esm ./bin/refresh-documentation.ts",
"command": "FORCE_HYPERLINK=0 node --loader ts-node/esm ./bin/refresh-code-documentation.ts",
"cwd": "packages/cli-kit"
}
},
Expand Down
File renamed without changes.

0 comments on commit 95b8209

Please sign in to comment.