create-wervt 0.2.0 → 0.2.2
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/index.js +19 -0
- package/package.json +1 -1
- package/template/.claude/skills/review-logging-patterns/SKILL.md +1249 -0
- package/template/.claude/skills/review-logging-patterns/references/code-review.md +342 -0
- package/template/.claude/skills/review-logging-patterns/references/drain-pipeline.md +166 -0
- package/template/.claude/skills/review-logging-patterns/references/structured-errors.md +468 -0
- package/template/.claude/skills/review-logging-patterns/references/wide-events.md +340 -0
- package/template/.claude/skills/wervt-logs/SKILL.md +77 -0
- package/template/AGENTS.md +8 -2
- package/template/package.json +1 -1
package/index.js
CHANGED
|
@@ -12,6 +12,22 @@ import { installDependencies } from 'nypm'
|
|
|
12
12
|
const BUNDLED_TEMPLATE = new URL('./template', import.meta.url).pathname
|
|
13
13
|
const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* The newest @wervt/nuxt on npm. Releases of the module don't release this package, so new apps
|
|
17
|
+
* ask the registry instead of keeping the version bundled at pack time (the fallback, offline).
|
|
18
|
+
*/
|
|
19
|
+
async function latestModule() {
|
|
20
|
+
const registry = (process.env.npm_config_registry ?? 'https://registry.npmjs.org').replace(
|
|
21
|
+
/\/$/,
|
|
22
|
+
'',
|
|
23
|
+
)
|
|
24
|
+
try {
|
|
25
|
+
const res = await fetch(`${registry}/@wervt/nuxt/latest`, { signal: AbortSignal.timeout(3000) })
|
|
26
|
+
if (res.ok) return (await res.json()).version
|
|
27
|
+
} catch {}
|
|
28
|
+
return undefined
|
|
29
|
+
}
|
|
30
|
+
|
|
15
31
|
/** Root of the wervt repo when running inside it, so apps are created as workspace packages. */
|
|
16
32
|
function findMonorepo(from) {
|
|
17
33
|
for (let dir = resolve(from); ; dir = dirname(dir)) {
|
|
@@ -74,6 +90,9 @@ const main = defineCommand({
|
|
|
74
90
|
pkg.dependencies['@wervt/nuxt'] = 'workspace:*'
|
|
75
91
|
delete pkg.devDependencies['vite-plus']
|
|
76
92
|
await rm(join(dir, 'vite.config.ts'), { force: true })
|
|
93
|
+
} else if (pkg.dependencies?.['@wervt/nuxt']) {
|
|
94
|
+
const version = await latestModule()
|
|
95
|
+
if (version) pkg.dependencies['@wervt/nuxt'] = `^${version}`
|
|
77
96
|
}
|
|
78
97
|
await writeFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`)
|
|
79
98
|
spinner.stop(`Created ${relative(process.cwd(), dir) || '.'}`)
|