create-jst 0.4.29 → 0.4.30
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-jst",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.30",
|
|
4
4
|
"description": "Create a web application from the JST template.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "npm@11.6.2",
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"audit:sources": "node scripts/audit-sources.mjs",
|
|
19
|
+
"canary:migrate": "node scripts/migration-canary.mjs",
|
|
19
20
|
"lint": "eslint . --max-warnings 0",
|
|
20
21
|
"benchmark": "node scripts/run-benchmarks.mjs",
|
|
21
22
|
"benchmark:update": "node scripts/run-benchmarks.mjs --write-baseline",
|
|
22
|
-
"test": "node --test test/integration.test.mjs test/migration.test.mjs test/nodeProjectGateway.test.mjs test/options.test.mjs test/projectInitializer.test.mjs",
|
|
23
|
+
"test": "node --test test/integration.test.mjs test/migration.test.mjs test/nodeMigrationGateway.test.mjs test/nodeProjectGateway.test.mjs test/options.test.mjs test/projectInitializer.test.mjs",
|
|
23
24
|
"test:generated": "node --test test/generatedProject.test.mjs",
|
|
24
25
|
"check": "npm run lint && npm test && npm pack --dry-run",
|
|
25
26
|
"prepublishOnly": "npm run check"
|
|
@@ -7,23 +7,35 @@ export const migrations = Object.freeze([
|
|
|
7
7
|
files: Object.freeze(['eslint.config.js']),
|
|
8
8
|
apply(files) {
|
|
9
9
|
const eslintConfig = files.get('eslint.config.js')
|
|
10
|
-
if (!eslintConfig?.includes(
|
|
10
|
+
if (!eslintConfig?.includes('jst.configs.recommended')) {
|
|
11
11
|
throw new Error(
|
|
12
|
-
|
|
12
|
+
'Migration requires eslint.config.js to use jst.configs.recommended; migrate custom ESLint composition manually.',
|
|
13
13
|
)
|
|
14
14
|
}
|
|
15
15
|
const withPolicy = eslintConfig.includes("from './jst.config.ts'")
|
|
16
16
|
? eslintConfig
|
|
17
|
-
:
|
|
18
|
-
files.set('eslint.config.js', withPolicy.replace(
|
|
17
|
+
: addPolicyImport(eslintConfig)
|
|
18
|
+
files.set('eslint.config.js', withPolicy.replace('jst.configs.recommended', 'jst.createConfig(policy)'))
|
|
19
19
|
files.set(
|
|
20
20
|
'jst.config.ts',
|
|
21
|
-
"import { defineConfig } from '@jst-stack/eslint-plugin
|
|
21
|
+
"import { defineConfig } from '@jst-stack/eslint-plugin'\n\nexport default defineConfig({})\n",
|
|
22
22
|
)
|
|
23
23
|
},
|
|
24
24
|
}),
|
|
25
25
|
])
|
|
26
26
|
|
|
27
|
+
function addPolicyImport(source) {
|
|
28
|
+
const lines = source.split('\n')
|
|
29
|
+
let importEnd = 0
|
|
30
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
31
|
+
if (lines[index].startsWith('import ')) {
|
|
32
|
+
importEnd = index + 1
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
lines.splice(importEnd, 0, "import policy from './jst.config.ts'")
|
|
36
|
+
return lines.join('\n')
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
export function resolveMigrationPath(from, to = CURRENT_PROJECT_VERSION) {
|
|
28
40
|
const path = []
|
|
29
41
|
let version = from
|
|
@@ -18,7 +18,7 @@ export const PRIMARY_COLORS = [
|
|
|
18
18
|
export const PACKAGE_MANAGERS = ['npm', 'pnpm']
|
|
19
19
|
export const STYLE_LANGUAGES = ['css', 'scss']
|
|
20
20
|
export const EXAMPLES = ['clean', 'showcase']
|
|
21
|
-
export const TEMPLATE_SOURCE = 'jst-stack/jst#v0.4.
|
|
21
|
+
export const TEMPLATE_SOURCE = 'jst-stack/jst#v0.4.30'
|
|
22
22
|
export const SHOWCASE_SOURCE = 'jst-stack/jst-showcase#da0fbe07b2a2d529dce7a0178ea756caa87238f4'
|
|
23
23
|
|
|
24
24
|
export function buildProjectSpecification(input) {
|