@postxl/cli 1.0.1 → 1.0.6

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/README.md CHANGED
@@ -40,19 +40,19 @@ The CLI will interactively prompt you for:
40
40
 
41
41
  1. **Project name**: The display name for your project
42
42
  2. **Project slug**: A URL-friendly identifier (auto-suggested from the name)
43
- 3. **Schema template**: Choose from available starter schemas (la, mca, ring, simple, subex, uspmsm)
43
+ 3. **Schema template**: Choose from available starter schemas
44
44
  4. **Project location**: Either a standalone project (outside the workspace) or a workspace project (in the `projects/` folder)
45
45
 
46
46
  ### Options
47
47
 
48
- | Option | Description |
49
- | --------------------------- | ------------------------------------------------------------- |
50
- | `-n, --name <name>` | Project name (skip interactive prompt) |
51
- | `-s, --slug <slug>` | Project slug (skip interactive prompt) |
52
- | `--schema <schema>` | Schema template to use (la, mca, ring, simple, subex, uspmsm) |
53
- | `-p, --project-path <path>` | Custom path for the generated project |
54
- | `--skip-git` | Skip initializing a git repository |
55
- | `--skip-generate` | Skip running the initial project generation |
48
+ | Option | Description |
49
+ | --------------------------- | ------------------------------------------- |
50
+ | `-n, --name <name>` | Project name (skip interactive prompt) |
51
+ | `-s, --slug <slug>` | Project slug (skip interactive prompt) |
52
+ | `--schema <schema>` | Schema template to use |
53
+ | `-p, --project-path <path>` | Custom path for the generated project |
54
+ | `--skip-git` | Skip initializing a git repository |
55
+ | `--skip-generate` | Skip running the initial project generation |
56
56
 
57
57
  ### Examples
58
58
 
@@ -151,7 +151,7 @@ async function createProject(options) {
151
151
  name: Generator.toPostXlPackageName(`@postxl/${slug}`),
152
152
  description: `A PostXL project for ${name}.`,
153
153
  dependencies: [],
154
- devDependencies: { ...baseDevDependencies, ...(projectPath.kind === 'workspace' ? workspaceDevDependencies : {}) },
154
+ devDependencies: [...baseDevDependencies, ...(projectPath.kind === 'workspace' ? workspaceDevDependencies : [])],
155
155
  scripts: [...baseScripts, ...(projectPath.kind === 'workspace' ? getWorkspaceScripts(slug) : standaloneScripts)],
156
156
  };
157
157
  await fs.writeFile(path.join(targetPath, 'package.json'), await (0, generator_1.format)({ path: 'package.json', content: Generator.generatePackageJson(packageJsonConfig) }));
@@ -169,7 +169,7 @@ function generateGenerateTs() {
169
169
  return `
170
170
  import * as Generator from '@postxl/generator'
171
171
  import {
172
- ${generators.map((g) => (typeof g === 'string' ? g : `${g.imports}`)).join(',\n ')}
172
+ ${generators.map((g) => (typeof g === 'string' ? g : g.imports)).join(',\n ')}
173
173
  } from '@postxl/generators'
174
174
 
175
175
  export default function generate(): Generator.GeneratorInterface[] {
@@ -51,7 +51,7 @@ function register(program) {
51
51
  .description('Creates a new PostXL project with a selected schema template.')
52
52
  .option('-n, --name <name>', 'Project name')
53
53
  .option('-s, --slug <slug>', 'Project slug')
54
- .option('--schema <schema>', 'Schema to use (la, mca, ring, simple, subex, uspmsm)')
54
+ .option('--schema <schema>', 'Schema to use (e.g. simple)')
55
55
  .option('-p, --project-path <path>', 'Path where the generated project should be written. If not specified, a workspace project will be created in the projects folder')
56
56
  .option('--skip-git', 'Skip initialing a git repository in the generated project directory')
57
57
  .option('--skip-generate', 'Skip running the initial project generation')
@@ -121,12 +121,7 @@ async function getProjectSchema(providedSchema) {
121
121
  const selectedSchemaIndex = await select('Which schema would you like to use as a starter?', schemaChoices, 3);
122
122
  selectedSchemaKey = schemaChoices[selectedSchemaIndex];
123
123
  }
124
- const schema = schema_1.sampleSchemas[selectedSchemaKey];
125
- if (!schema) {
126
- console.error(`Schema "${selectedSchemaKey}" not found!`);
127
- process.exit(1);
128
- }
129
- return schema;
124
+ return schema_1.sampleSchemas[selectedSchemaKey];
130
125
  }
131
126
  /**
132
127
  * If projectPath is provided:
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postxl/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.6",
4
4
  "description": "Command-line interface for PostXL code generation framework",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -35,24 +35,18 @@
35
35
  "files": [
36
36
  "dist"
37
37
  ],
38
- "scripts": {
39
- "build": "tsc -b tsconfig.build.json",
40
- "lint": "eslint .",
41
- "prettier:check": "prettier --check \"**/*.{ts,tsx}\" --config ../../prettier.config.js --ignore-path ../../.prettierignore",
42
- "test:types": "tsc --noEmit"
43
- },
44
38
  "repository": {
45
39
  "type": "git",
46
40
  "url": "https://github.com/postxl/pxl",
47
41
  "directory": "packages/cli"
48
42
  },
49
43
  "dependencies": {
50
- "@postxl/generator": "workspace:*",
51
- "@postxl/generators": "workspace:*",
52
- "@postxl/schema": "workspace:*",
53
44
  "commander": "12.1.0",
54
45
  "dotenv": "16.4.7",
55
- "zod-validation-error": "3.4.0"
46
+ "zod-validation-error": "3.4.0",
47
+ "@postxl/generator": "1.0.1",
48
+ "@postxl/generators": "1.0.1",
49
+ "@postxl/schema": "1.0.0"
56
50
  },
57
51
  "devDependencies": {},
58
52
  "wallaby": {
@@ -62,5 +56,11 @@
62
56
  "runner": "--experimental-vm-modules"
63
57
  }
64
58
  }
59
+ },
60
+ "scripts": {
61
+ "build": "tsc -b tsconfig.build.json",
62
+ "lint": "eslint .",
63
+ "prettier:check": "prettier --check \"**/*.{ts,tsx}\" --config ../../prettier.config.js --ignore-path ../../.prettierignore",
64
+ "test:types": "tsc --noEmit"
65
65
  }
66
- }
66
+ }