@joshuafolkken/kit 1.1003.0 ā 1.1005.0
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,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.1005.0",
|
|
3
3
|
"name": "@joshuafolkken/kit",
|
|
4
4
|
"description": "Development toolkit for AI-assisted projects: formatting, AI assistant rules and a Git/GitHub Issue workflow for any repository, plus lint, type check, tests and hooks for Node projects",
|
|
5
5
|
"keywords": [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { existsSync, readFileSync, realpathSync } from 'node:fs'
|
|
1
|
+
import { existsSync, readFileSync, realpathSync, writeFileSync } from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
import { z } from 'zod'
|
|
4
|
+
import { init_basic } from './init-basic'
|
|
4
5
|
import { init_install, type InstallStep } from './init-install'
|
|
5
6
|
import { init_logic_workspace } from './init-logic-workspace'
|
|
6
7
|
import { project_profile } from './project-profile'
|
|
@@ -73,6 +74,14 @@ function handoff_step(args: ReadonlyArray<string>): InstallStep {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
// pnpm walks up to the nearest `package.json`, so without one here it installs kit into whatever
|
|
78
|
+
// project an ancestor directory holds and rewrites that project's files (joshuafolkken/kit#2866).
|
|
79
|
+
function ensure_project_manifest(project_root: string): void {
|
|
80
|
+
const manifest_path = path.join(project_root, PACKAGE_JSON)
|
|
81
|
+
|
|
82
|
+
if (!existsSync(manifest_path)) writeFileSync(manifest_path, init_basic.initial_manifest())
|
|
83
|
+
}
|
|
84
|
+
|
|
76
85
|
// Returns the failure to report, or undefined once the project-installed kit finished the setup.
|
|
77
86
|
function hand_off(
|
|
78
87
|
package_directory: string,
|
|
@@ -83,6 +92,8 @@ function hand_off(
|
|
|
83
92
|
console.info('\nš Installing @joshuafolkken/kit into the project, then running its josh init')
|
|
84
93
|
const template = readFileSync(path.join(package_directory, KIT_BUILDS_TEMPLATE), 'utf8')
|
|
85
94
|
const install = kit_install_step(has_kit_dependency(project_root), template)
|
|
95
|
+
|
|
96
|
+
ensure_project_manifest(project_root)
|
|
86
97
|
if (!init_install.did_step_succeed(install, project_root)) return `${install.label} failed`
|
|
87
98
|
if (!init_install.did_step_succeed(handoff_step(args), project_root)) return HANDOFF_FAILURE
|
|
88
99
|
|