@shopify/cli-hydrogen 3.0.13 → 3.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/commands/hydrogen/add/eslint.js +1 -1
- package/dist/commands/hydrogen/add/tailwind.js +1 -1
- package/dist/commands/hydrogen/info.js +1 -1
- package/dist/{hydrogen-6abf62e1.js → hydrogen-9efd5ae6.js} +3 -8
- package/dist/{hydrogen-6abf62e1.js.map → hydrogen-9efd5ae6.js.map} +1 -1
- package/package.json +5 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @shopify/cli-hydrogen
|
|
2
2
|
|
|
3
|
+
## 3.0.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eb915dee: Loose version requirements to help dependency managers dedupe dependencies
|
|
8
|
+
- Updated dependencies [eb915dee]
|
|
9
|
+
- Updated dependencies [85ee088d]
|
|
10
|
+
- Updated dependencies [2ecbff43]
|
|
11
|
+
- Updated dependencies [a750e67c]
|
|
12
|
+
- @shopify/cli-kit@3.0.16
|
|
13
|
+
|
|
14
|
+
## 3.0.15
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [c3b711ec]
|
|
19
|
+
- Updated dependencies [99378ca0]
|
|
20
|
+
- @shopify/cli-kit@3.0.15
|
|
21
|
+
|
|
22
|
+
## 3.0.14
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [8f82bd36]
|
|
27
|
+
- Updated dependencies [ae3823c8]
|
|
28
|
+
- Updated dependencies [8f82bd36]
|
|
29
|
+
- Updated dependencies [c383ed42]
|
|
30
|
+
- @shopify/cli-kit@3.0.14
|
|
31
|
+
|
|
3
32
|
## 3.0.13
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as hydrogenFlags } from '../../../flags-39d1e3c2.js';
|
|
2
|
-
import { g as genericConfigurationFileNames, l as load } from '../../../hydrogen-
|
|
2
|
+
import { g as genericConfigurationFileNames, l as load } from '../../../hydrogen-9efd5ae6.js';
|
|
3
3
|
import { ui, dependency, path, file, error, npm, vscode, cli } from '@shopify/cli-kit';
|
|
4
4
|
import stream from 'node:stream';
|
|
5
5
|
import { Flags, Command } from '@oclif/core';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h as hydrogenFlags } from '../../../flags-39d1e3c2.js';
|
|
2
2
|
import { ui, dependency, path, file, error, system, vscode, cli } from '@shopify/cli-kit';
|
|
3
3
|
import stream from 'node:stream';
|
|
4
|
-
import { l as load } from '../../../hydrogen-
|
|
4
|
+
import { l as load } from '../../../hydrogen-9efd5ae6.js';
|
|
5
5
|
import { Flags, Command } from '@oclif/core';
|
|
6
6
|
import 'vite';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { output, string, os, cli, path } from '@shopify/cli-kit';
|
|
2
|
-
import { l as load } from '../../hydrogen-
|
|
2
|
+
import { l as load } from '../../hydrogen-9efd5ae6.js';
|
|
3
3
|
import { h as hydrogenFlags } from '../../flags-39d1e3c2.js';
|
|
4
4
|
import { Flags, Command } from '@oclif/core';
|
|
5
5
|
import 'vite';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { path, file,
|
|
1
|
+
import { dependency, path, file, error } from '@shopify/cli-kit';
|
|
2
2
|
import { createServer } from 'vite';
|
|
3
3
|
|
|
4
4
|
const configurationFileNames = {
|
|
@@ -12,12 +12,7 @@ const genericConfigurationFileNames = {
|
|
|
12
12
|
typescript: {
|
|
13
13
|
config: "tsconfig.json"
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
lockfile: "yarn.lock"
|
|
17
|
-
},
|
|
18
|
-
pnpm: {
|
|
19
|
-
lockfile: "pnpm-lock.yaml"
|
|
20
|
-
}
|
|
15
|
+
...dependency.genericConfigurationFileNames
|
|
21
16
|
};
|
|
22
17
|
|
|
23
18
|
class AppErrors {
|
|
@@ -123,4 +118,4 @@ async function load(directory, mode = "strict") {
|
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
export { genericConfigurationFileNames as g, load as l };
|
|
126
|
-
//# sourceMappingURL=hydrogen-
|
|
121
|
+
//# sourceMappingURL=hydrogen-9efd5ae6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrogen-
|
|
1
|
+
{"version":3,"file":"hydrogen-9efd5ae6.js","sources":["../src/cli/constants.ts","../src/cli/models/hydrogen.ts"],"sourcesContent":["import {dependency} from '@shopify/cli-kit'\n\nexport const configurationFileNames = {\n hydrogen: 'hydrogen.config',\n} as const\n\nexport const supportedConfigExtensions = ['ts', 'js', 'mjs', 'cjs', 'json']\n\nexport const dotEnvFileNames = {\n production: '.env',\n}\n\nexport const genericConfigurationFileNames = {\n tailwind: 'tailwind.config',\n postCSS: 'postcss.config',\n eslint: '.eslintrc.js',\n typescript: {\n config: 'tsconfig.json',\n },\n ...dependency.genericConfigurationFileNames,\n} as const\n","import {configurationFileNames, genericConfigurationFileNames, supportedConfigExtensions} from '../constants'\nimport {HydrogenConfig} from '@shopify/hydrogen/config'\nimport {dependency, path, file, error} from '@shopify/cli-kit'\nimport {createServer} from 'vite'\n\nexport interface HydrogenApp {\n name: string\n directory: string\n dependencyManager: dependency.DependencyManager\n configuration: HydrogenConfig\n configurationPath: string\n nodeDependencies: {[key: string]: string}\n language: 'javascript' | 'typescript'\n errors?: AppErrors\n}\n\nexport type AppLoaderMode = 'strict' | 'report'\n\ninterface AppLoaderConstructorArgs {\n directory: string\n mode: AppLoaderMode\n}\n\nclass AppErrors {\n private errors: {\n [key: string]: string\n } = {}\n\n addError(path: string, message: string): void {\n this.errors[path] = message\n }\n\n getError(path: string): string {\n return this.errors[path]\n }\n\n isEmpty() {\n return Object.keys(this.errors).length === 0\n }\n\n toJSON(): string[] {\n return Object.values(this.errors)\n }\n}\n\nclass AppLoader {\n private directory: string\n private mode: AppLoaderMode\n private appDirectory = ''\n private configurationPath = ''\n private errors: AppErrors = new AppErrors()\n\n constructor({directory, mode}: AppLoaderConstructorArgs) {\n this.mode = mode\n this.directory = directory\n }\n\n async loaded() {\n this.appDirectory = await this.findAppDirectory()\n const configurationPath = await this.getConfigurationPath()\n const configuration = await this.loadConfigurationFile<HydrogenConfig>(configurationPath)\n const yarnLockPath = path.join(this.appDirectory, genericConfigurationFileNames.yarn.lockfile)\n const yarnLockExists = await file.exists(yarnLockPath)\n const pnpmLockPath = path.join(this.appDirectory, genericConfigurationFileNames.pnpm.lockfile)\n const pnpmLockExists = await file.exists(pnpmLockPath)\n const packageJSONPath = path.join(this.appDirectory, 'package.json')\n const name = await dependency.getPackageName(packageJSONPath)\n const nodeDependencies = await dependency.getDependencies(packageJSONPath)\n const tsConfigExists = await file.exists(path.join(this.appDirectory, 'tsconfig.json'))\n const language = tsConfigExists && nodeDependencies.typescript ? 'typescript' : 'javascript'\n\n let dependencyManager: dependency.DependencyManager\n if (yarnLockExists) {\n dependencyManager = 'yarn'\n } else if (pnpmLockExists) {\n dependencyManager = 'pnpm'\n } else {\n dependencyManager = 'npm'\n }\n\n const app: HydrogenApp = {\n name,\n directory: this.appDirectory,\n configuration,\n configurationPath,\n dependencyManager,\n nodeDependencies,\n language,\n }\n if (!this.errors.isEmpty()) app.errors = this.errors\n\n return app\n }\n\n async findAppDirectory() {\n if (!(await file.exists(this.directory))) {\n throw new error.Abort(`Couldn't find directory ${this.directory}`)\n }\n return path.dirname(await this.getConfigurationPath())\n }\n\n async getConfigurationPath() {\n if (this.configurationPath) return this.configurationPath\n\n const promises = supportedConfigExtensions.map((ext) =>\n path.findUp([configurationFileNames.hydrogen, ext].join('.'), {\n cwd: this.directory,\n type: 'file',\n }),\n )\n\n const configurationPathResults = await Promise.all(promises)\n\n const configurationPath = configurationPathResults.find((result) => result !== undefined)\n\n if (!configurationPath) {\n throw new error.Abort(`Couldn't find the configuration file for ${this.directory}, are you in an app directory?`)\n }\n\n this.configurationPath = configurationPath\n return configurationPath\n }\n\n async loadConfigurationFile<T>(filepath: string): Promise<T> {\n const server = await createServer({\n server: {middlewareMode: 'ssr'},\n })\n\n const config = (await server.ssrLoadModule(filepath)).default\n\n await server.close()\n\n return config\n }\n\n abortOrReport<T>(errorMessage: string, fallback: T, configurationPath: string): T {\n if (this.mode === 'strict') {\n throw new error.Abort(errorMessage)\n } else {\n this.errors.addError(configurationPath, errorMessage)\n return fallback\n }\n }\n}\n\nexport async function load(directory: string, mode: AppLoaderMode = 'strict'): Promise<HydrogenApp> {\n const loader = new AppLoader({directory, mode})\n return loader.loaded()\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,sBAAyB,GAAA;AAAA,EACpC,QAAU,EAAA,iBAAA;AACZ,CAAA,CAAA;AAEO,MAAM,4BAA4B,CAAC,IAAA,EAAM,IAAM,EAAA,KAAA,EAAO,OAAO,MAAM,CAAA,CAAA;AAMnE,MAAM,6BAAgC,GAAA;AAAA,EAC3C,QAAU,EAAA,iBAAA;AAAA,EACV,OAAS,EAAA,gBAAA;AAAA,EACT,MAAQ,EAAA,cAAA;AAAA,EACR,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,eAAA;AAAA,GACV;AAAA,EACA,GAAG,UAAW,CAAA,6BAAA;AAChB;;ACGA,MAAM,SAAU,CAAA;AAAA,EAAhB,WAAA,GAAA;AACE,IAAA,IAAA,CAAQ,SAEJ,EAAC,CAAA;AAAA,GAAA;AAAA,EAEL,QAAA,CAAS,OAAc,OAAuB,EAAA;AAC5C,IAAA,IAAA,CAAK,OAAO,KAAQ,CAAA,GAAA,OAAA,CAAA;AAAA,GACtB;AAAA,EAEA,SAAS,KAAsB,EAAA;AAC7B,IAAA,OAAO,KAAK,MAAO,CAAA,KAAA,CAAA,CAAA;AAAA,GACrB;AAAA,EAEA,OAAU,GAAA;AACR,IAAA,OAAO,M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AAM,EAAA,CAAA;AAEnB,IAAO,OAAA,MAAA,CAAA;AAAA,GACT;AAAA,EAEA,aAAA,CAAiB,YAAsB,EAAA,QAAA,EAAa,iBAA8B,EAAA;AAChF,IAAI,IAAA,IAAA,CAAK,SAAS,QAAU,EAAA;AAC1B,MAAM,MAAA,IAAI,KAAM,CAAA,KAAA,CAAM,YAAY,CAAA,CAAA;AAAA,KAC7B,MAAA;AACL,MAAK,IAAA,CAAA,MAAA,CAAO,QAAS,CAAA,iBAAA,EAAmB,YAAY,CAAA,CAAA;AACpD,MAAO,OAAA,QAAA,CAAA;AAAA,KACT;AAAA,GACF;AACF,CAAA;AAE2B,eAAA,IAAA,CAAA,SAAA,EAAmB,OAAsB,QAAgC,EAAA;AAClG,EAAA,MAAM,SAAS,IAAI,SAAA,CAAU,EAAC,SAAA,EAAW,MAAK,CAAA,CAAA;AAC9C,EAAA,OAAO,OAAO,MAAO,EAAA,CAAA;AACvB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli-hydrogen",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Commands for building Hydrogen storefronts",
|
|
6
6
|
"type": "module",
|
|
@@ -33,20 +33,18 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@oclif/core": "1.
|
|
36
|
+
"@oclif/core": "^1.0.0",
|
|
37
37
|
"@shopify/hydrogen": "^0.22.1",
|
|
38
38
|
"@shopify/mini-oxygen": "^0.0.5",
|
|
39
39
|
"@types/prettier": "^2.6.3",
|
|
40
40
|
"prettier": "^2.6.1",
|
|
41
|
-
"vite": "^2.9.9"
|
|
42
|
-
|
|
43
|
-
"peerDependencies": {
|
|
44
|
-
"@shopify/cli-kit": "3.0.13"
|
|
41
|
+
"vite": "^2.9.9",
|
|
42
|
+
"@shopify/cli-kit": "^3.0.16"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"@babel/core": "^7.17.10",
|
|
48
46
|
"@shopify/ast-utilities": "^1.3.4",
|
|
49
|
-
"@shopify/cli-testing": "3.0.
|
|
47
|
+
"@shopify/cli-testing": "3.0.16",
|
|
50
48
|
"@shopify/prettier-config": "^1.1.2",
|
|
51
49
|
"@types/change-case": "^2.3.1",
|
|
52
50
|
"@types/connect": "^3.4.35",
|