create-agentic-dev-env 0.2.7 → 0.2.8

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.
Files changed (2) hide show
  1. package/lib/runner.js +16 -15
  2. package/package.json +1 -1
package/lib/runner.js CHANGED
@@ -60,7 +60,21 @@ function removeManaged(cwd) {
60
60
  }
61
61
 
62
62
  function install(cwd, srcDir, wsOverride) {
63
- // 先驗證再動手:update 只清理 ade- 前綴,非前綴 skill 裝了就清不掉
63
+ // 先驗證再動手:解析不到 source 就整個不裝——目錄保持乾淨,init 可重跑
64
+ const prevPath = path.join(cwd, '.ade.json')
65
+ const prev = fs.existsSync(prevPath) ? JSON.parse(fs.readFileSync(prevPath, 'utf8')) : {}
66
+ let source = null
67
+ try {
68
+ const pkg = JSON.parse(fs.readFileSync(path.join(srcDir, 'package.json'), 'utf8'))
69
+ source = typeof pkg.repository === 'string' ? pkg.repository : (pkg.repository || {}).url || null
70
+ if (source) source = source.replace(/^git\+/, '')
71
+ if (source && source.includes('FILL_ME')) source = null
72
+ } catch {}
73
+ if (!source && !prev.source) {
74
+ throw new Error('repository.url is not set in the ADE repo package.json; update would not work — fill it in and retry')
75
+ }
76
+
77
+ // update 只清理 ade- 前綴,非前綴 skill 裝了就清不掉
64
78
  const srcSkills = path.join(srcDir, 'skills')
65
79
  const skillDirs = fs.existsSync(srcSkills)
66
80
  ? fs.readdirSync(srcSkills).filter((d) => fs.statSync(path.join(srcSkills, d)).isDirectory())
@@ -92,9 +106,6 @@ function install(cwd, srcDir, wsOverride) {
92
106
  }
93
107
  fs.writeFileSync(claudePath, md)
94
108
 
95
- const prevPath = path.join(cwd, '.ade.json')
96
- const prev = fs.existsSync(prevPath) ? JSON.parse(fs.readFileSync(prevPath, 'utf8')) : {}
97
-
98
109
  // 作業區固定叫 workspaces/;指定既有 repo 存放資料夾時(--workspaces 或 .ade.json 的
99
110
  // workspaces),workspaces 建成指向它的 symlink,cd workspaces 即達、已下載的 repo 直接沿用
100
111
  const ws = wsOverride || prev.workspaces || null
@@ -115,13 +126,6 @@ function install(cwd, srcDir, wsOverride) {
115
126
  if (!gi.split('\n').some((l) => l.trim() === 'workspaces')) {
116
127
  fs.writeFileSync(giPath, (gi ? gi.trimEnd() + '\n' : '') + 'workspaces\n')
117
128
  }
118
- let source = null
119
- try {
120
- const pkg = JSON.parse(fs.readFileSync(path.join(srcDir, 'package.json'), 'utf8'))
121
- source = typeof pkg.repository === 'string' ? pkg.repository : (pkg.repository || {}).url || null
122
- if (source) source = source.replace(/^git\+/, '')
123
- if (source && source.includes('FILL_ME')) source = null
124
- } catch {}
125
129
  let commit = null
126
130
  try {
127
131
  commit = execSync('git rev-parse HEAD', { cwd: srcDir, stdio: ['ignore', 'pipe', 'ignore'] })
@@ -130,11 +134,8 @@ function install(cwd, srcDir, wsOverride) {
130
134
  } catch {}
131
135
  fs.writeFileSync(
132
136
  prevPath,
133
- JSON.stringify({ source: source || prev.source || null, commit, workspaces: ws }, null, 2) + '\n'
137
+ JSON.stringify({ source: source || prev.source, commit, workspaces: ws }, null, 2) + '\n'
134
138
  )
135
- if (!source && !prev.source) {
136
- console.warn('Warning: repository.url is not set in the ADE repo package.json; update will not work — set source in .ade.json manually')
137
- }
138
139
  }
139
140
 
140
141
  module.exports = { run, init, update }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agentic-dev-env",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Scaffold and manage team Agentic Dev Environment (ADE) knowledge repos",
5
5
  "repository": {
6
6
  "type": "git",