@stjoseph/prumo 0.1.0 → 0.1.1

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/dist/cli.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from 'node:fs';
3
- import { join, resolve } from 'node:path';
2
+ import { resolve } from 'node:path';
4
3
  import { parseArgs } from 'node:util';
5
4
  import * as prompt from '@clack/prompts';
6
5
  import { terminalAsker } from "./asker.js";
@@ -13,11 +12,7 @@ import { generate } from "./generate.js";
13
12
  import { validateProjectName } from "./names.js";
14
13
  import { CliError, errorEnvelope, writeEnvelope } from "./output.js";
15
14
  import { resolveAnswers } from "./questions.js";
16
- function version() {
17
- // src/cli.ts and dist/cli.js both sit one level below package.json.
18
- const pkg = JSON.parse(readFileSync(join(import.meta.dirname, '..', 'package.json'), 'utf8'));
19
- return pkg.version;
20
- }
15
+ import { cliVersion } from "./version.js";
21
16
  function help(name) {
22
17
  if (name === undefined) {
23
18
  return { data: { commands: COMMANDS }, text: helpText() };
@@ -130,7 +125,7 @@ async function main(argv) {
130
125
  result = help(topic);
131
126
  }
132
127
  else if (name === 'version') {
133
- const current = version();
128
+ const current = cliVersion();
134
129
  result = { data: { version: current }, text: current };
135
130
  }
136
131
  else if (name === 'doctor') {
package/dist/context.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { cp, mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
+ import { cliVersion } from "./version.js";
3
4
  const CLIENTS = ['web', 'mobile', 'site'];
4
5
  export function areasFor(answers) {
5
6
  const has = (type) => answers.types.includes(type);
@@ -28,7 +29,9 @@ export async function writeContext(knowledge, root, answers) {
28
29
  }
29
30
  }
30
31
  await writeFile(join(prumo, 'INDEX.md'), `# Conventions\n\n${lines.join('\n')}\n`);
32
+ // The version that wrote the project, so a tool reading it can tell a project made by an older Prumo.
31
33
  const config = {
34
+ prumo: cliVersion(),
32
35
  types: answers.types,
33
36
  architecture: answers.architecture,
34
37
  multiTenant: answers.multiTenant,
@@ -0,0 +1,7 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ /** This CLI's own version. src/*.ts and dist/*.js both sit one level below package.json. */
4
+ export function cliVersion() {
5
+ const pkg = JSON.parse(readFileSync(join(import.meta.dirname, '..', 'package.json'), 'utf8'));
6
+ return pkg.version;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stjoseph/prumo",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Scaffolds a TypeScript project and ships it the conventions it follows, in a .prumo/ folder any AI assistant reads.",
5
5
  "keywords": [
6
6
  "scaffolding",