Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable] Include theme-check-docs-updater data folder in final bundled dist #3865

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/real-ravens-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/theme': patch
---

Fix theme check failing when there is a network issue
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"eslint-plugin-react-hooks",
"esbuild",
"@shopify/cli-hydrogen",
"@shopify/theme-check-node"
"@shopify/theme-check-node",
"@shopify/theme-check-docs-updater"
],
"ignoreWorkspaces": [
"packages/eslint-plugin-cli"
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@shopify/plugin-cloudflare": "3.60.0",
"@shopify/polaris": "12.10.0",
"@shopify/polaris-icons": "8.0.0",
"@shopify/theme-check-node": "2.5.0",
"@shopify/theme-check-node": "2.5.1",
"body-parser": "1.20.2",
"chokidar": "3.5.3",
"diff": "5.1.0",
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/bin/bundle.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @shopify/cli/specific-imports-in-bootstrap-code */
/* eslint-disable import/no-extraneous-dependencies */
import cleanBundledDependencies from '../../../bin/bundling/clean-bundled-dependencies.js'
import ShopifyStacktraceyPlugin from '../../../bin/bundling/esbuild-plugin-stacktracey.js'
import ShopifyVSCodePlugin from '../../../bin/bundling/esbuild-plugin-vscode.js'
import GraphiQLImportsPlugin from '../../../bin/bundling/esbuild-plugin-graphiql-imports.js'
import cleanBundledDependencies from '../../../bin/bundling/clean-bundled-dependencies.js'
import {build as esBuild} from 'esbuild'
import {copy} from 'esbuild-plugin-copy'
import glob from 'fast-glob'
Expand All @@ -27,6 +27,9 @@ const yogafile = glob.sync('../../node_modules/.pnpm/**/yoga.wasm')[0]
const themePath = require.resolve('@shopify/theme-check-node')
const configYmlPath = joinPath(themePath, '..', '..', 'configs/*.yml')

const themeUpdaterPath = require.resolve('@shopify/theme-check-docs-updater')
const themeUpdaterDataPath = joinPath(themeUpdaterPath, '..', '..', 'data/*')

esBuild({
bundle: true,
entryPoints: ['./src/**/*.ts'],
Expand Down Expand Up @@ -74,6 +77,10 @@ esBuild({
from: [configYmlPath],
to: ['./dist/configs/'],
},
{
from: [themeUpdaterDataPath],
to: ['./dist/data/'],
},
],
}),
],
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"dependencies": {
"@oclif/core": "3.26.5",
"@shopify/cli-kit": "3.60.0",
"@shopify/theme-check-node": "2.5.0",
"@shopify/theme-language-server-node": "1.11.0",
"@shopify/theme-check-node": "2.5.1",
"@shopify/theme-language-server-node": "1.11.1",
"yaml": "2.3.2"
},
"devDependencies": {
Expand Down
11 changes: 9 additions & 2 deletions packages/theme/src/cli/commands/theme/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import ThemeCommand from '../../utilities/theme-command.js'
import {Flags} from '@oclif/core'
import {globalFlags} from '@shopify/cli-kit/node/cli'
import {outputInfo} from '@shopify/cli-kit/node/output'
import {outputInfo, consoleError} from '@shopify/cli-kit/node/output'
import {renderInfo, renderSuccess} from '@shopify/cli-kit/node/ui'
import {themeCheckRun, LegacyIdentifiers} from '@shopify/theme-check-node'
import {findPathUp} from '@shopify/cli-kit/node/fs'
Expand Down Expand Up @@ -133,7 +133,14 @@ export default class Check extends ThemeCommand {
return
}

const {offenses, theme} = await themeCheckRun(path, config)
const {offenses, theme} = await themeCheckRun(path, config, (message) => {
// We should replace this with outputDebug when it logs to STDERR by default.
// We need this right now because the --verbose flags pollutes STDOUT
// when used with --output=json with the current outputDebug defaults.
if (process.env.SHOPIFY_TMP_FLAG_DEBUG) {
consoleError(message)
}
})

const offensesByFile = sortOffenses(offenses)

Expand Down
46 changes: 23 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.