frontpl 0.4.1 → 0.6.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/README.md CHANGED
@@ -59,6 +59,72 @@ When `pnpm workspace mode` is enabled:
59
59
  - Root contains `pnpm-workspace.yaml` and the workspace `package.json`
60
60
  - `oxlint`/`oxfmt` scripts, dependencies, and config files are generated at the workspace root
61
61
  - App/library package is scaffolded under `packages/<name>/` with its own `package.json`, `src`, and `tsconfig.json`
62
+ - If root `oxlint` is enabled, package `package.json` does not add redundant `typecheck: tsc --noEmit`
63
+
64
+ ### `frontpl add [name]`
65
+
66
+ Add a new package under `packages/<name>/` in an existing `pnpm workspace`.
67
+
68
+ What it does:
69
+
70
+ - Requires workspace root (`pnpm-workspace.yaml`) and `pnpm` package manager
71
+ - Generates package baseline files:
72
+ - `packages/<name>/package.json`
73
+ - `packages/<name>/README.md`
74
+ - `packages/<name>/src/index.ts`
75
+ - `packages/<name>/tsconfig.json`
76
+ - Optionally adds `vitest` (`src/index.test.ts`) and `tsdown` (`tsdown.config.ts`)
77
+ - Reuses root toolchain strategy:
78
+ - package does not scaffold `oxlint`/`oxfmt` scripts
79
+ - if root `oxlint` exists, package does not scaffold `typecheck: tsc --noEmit`
80
+
81
+ Use `--yes` (or `-y`) to skip confirmations and use defaults inferred from root scripts.
82
+
83
+ ### `frontpl pkg`
84
+
85
+ Normalize current directory `package.json` for npm publishing (requires `github.com` git remote).
86
+
87
+ What it does:
88
+
89
+ - Requires current directory to contain `package.json`
90
+ - Requires git repository with `remote.origin.url` on `github.com`
91
+ - Updates publish metadata:
92
+ - `homepage`
93
+ - `bugs.url`
94
+ - `repository` (`type`, `url`, and `directory` when run in monorepo subfolder)
95
+ - Applies publish defaults when missing:
96
+ - `private: false`, `version: "0.0.0"`
97
+ - `license`:
98
+ - interactive select on each run (`MIT` / `Apache-2.0`)
99
+ - with `--yes`, keeps existing license; defaults to `MIT` only when missing
100
+ - option keys aligned with GitHub Licenses API: `mit` / `apache-2.0`
101
+ - `type: "module"`, `files: ["dist"]`
102
+ - `main`, `types`, and `exports` pointing to `dist/index`
103
+ - `publishConfig.access: "public"`
104
+ - `engines.node: ">=22.0.0"`
105
+ - `scripts.prepublishOnly` from existing `scripts.build`
106
+
107
+ Use `--yes` (or `-y`) to skip confirmation.
108
+
109
+ ### `frontpl bump [target]`
110
+
111
+ Update current `package.json#version` without opening an editor.
112
+
113
+ Interactive mode (`frontpl bump`):
114
+
115
+ - Shows concrete candidate versions for `patch` / `minor` / `major`
116
+ - e.g. current `1.2.3` -> `1.2.4` / `1.3.0` / `2.0.0`
117
+ - `custom`: set explicit version text
118
+
119
+ Direct mode (`frontpl bump <target>`):
120
+
121
+ - `frontpl bump patch`
122
+ - `frontpl bump minor`
123
+ - `frontpl bump major`
124
+ - `frontpl bump 1.8.0`
125
+
126
+ When using `minor`/`major`, trailing segments are reset to `0`.
127
+ Use `--dry-run` to preview from/to version without writing `package.json`.
62
128
 
63
129
  ### `frontpl ci`
64
130
 
@@ -109,8 +175,6 @@ What it does:
109
175
  - Ensures `package.json` scripts use:
110
176
  - `format`: `oxfmt`
111
177
  - `format:check`: `oxfmt --check`
112
- - `fmt`: `oxfmt`
113
- - `fmt:check`: `oxfmt --check`
114
178
  - Ensures `devDependencies.oxfmt` exists (defaults to `latest` when missing)
115
179
  - Creates or updates `.oxfmtrc.json`
116
180
  - Optionally removes `prettier` / `prettier-plugin-*` / `@prettier/plugin-*` dependencies, `package.json#prettier`, and Prettier config files (`.prettierrc*`, `prettier.config.*`)
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as runCi, n as runOxlint, r as runInit, t as runOxfmt } from "./oxfmt-DlwbhnpJ.mjs";
2
+ import { a as runBump, i as runCi, n as runOxfmt, o as runAdd, r as runOxlint, s as runInit, t as runPackage } from "./package-D5wcPeH8.mjs";
3
3
  import bin from "tiny-bin";
4
4
 
5
5
  //#region src/cli.ts
@@ -10,10 +10,22 @@ async function main() {
10
10
  await runInit({ nameArg: args[0] });
11
11
  }).command("ci", "Add CI/release workflows to an existing project").action(async () => {
12
12
  await runCi();
13
+ }).command("add", "Add a new package to an existing pnpm workspace").argument("[name]", "Package name (directory name under packages/)").option("--yes, -y", "Skip confirmations and use defaults").action(async (options, args) => {
14
+ await runAdd({
15
+ nameArg: args[0],
16
+ yes: options.yes === true
17
+ });
13
18
  }).command("oxlint", "Add/migrate linter to oxlint in current project").option("--yes, -y", "Skip confirmations and use defaults").action(async (options) => {
14
19
  await runOxlint({ yes: options.yes === true });
15
20
  }).command("oxfmt", "Add/migrate formatter to oxfmt in current project").option("--yes, -y", "Skip confirmations and use defaults").action(async (options) => {
16
21
  await runOxfmt({ yes: options.yes === true });
22
+ }).command("bump", "Bump package.json version").argument("[target]", "patch | minor | major | <version>").option("--dry-run", "Show the next version without writing package.json").action(async (options, args) => {
23
+ await runBump({
24
+ targetArg: args[0],
25
+ dryRun: options.dryRun === true
26
+ });
27
+ }).command("pkg", "Normalize package.json for npm publishing using GitHub remote").option("--yes, -y", "Skip confirmations and use defaults").action(async (options) => {
28
+ await runPackage({ yes: options.yes === true });
17
29
  }).run();
18
30
  }
19
31
  main();
package/dist/index.d.mts CHANGED
@@ -1,3 +1,23 @@
1
+ //#region src/commands/add.d.ts
2
+ type CommandOptions$4 = {
3
+ nameArg?: string;
4
+ yes?: boolean;
5
+ };
6
+ declare function runAdd({
7
+ nameArg,
8
+ yes
9
+ }?: CommandOptions$4): Promise<void>;
10
+ //#endregion
11
+ //#region src/commands/bump.d.ts
12
+ type CommandOptions$3 = {
13
+ targetArg?: string;
14
+ dryRun?: boolean;
15
+ };
16
+ declare function runBump({
17
+ targetArg,
18
+ dryRun
19
+ }?: CommandOptions$3): Promise<void>;
20
+ //#endregion
1
21
  //#region src/commands/ci.d.ts
2
22
  declare function runCi(): Promise<undefined>;
3
23
  //#endregion
@@ -10,19 +30,27 @@ declare function runInit({
10
30
  declare function validateProjectName(value: string | undefined): "Project name is required" | "Project name is too long" | "Project name cannot start with '.'" | "Project name cannot start with '_'" | "Use letters, numbers, '.', '_' or '-'" | undefined;
11
31
  //#endregion
12
32
  //#region src/commands/oxlint.d.ts
13
- type CommandOptions$1 = {
33
+ type CommandOptions$2 = {
14
34
  yes?: boolean;
15
35
  };
16
36
  declare function runOxlint({
17
37
  yes
18
- }?: CommandOptions$1): Promise<void>;
38
+ }?: CommandOptions$2): Promise<void>;
19
39
  //#endregion
20
40
  //#region src/commands/oxfmt.d.ts
21
- type CommandOptions = {
41
+ type CommandOptions$1 = {
22
42
  yes?: boolean;
23
43
  };
24
44
  declare function runOxfmt({
25
45
  yes
46
+ }?: CommandOptions$1): Promise<void>;
47
+ //#endregion
48
+ //#region src/commands/package.d.ts
49
+ type CommandOptions = {
50
+ yes?: boolean;
51
+ };
52
+ declare function runPackage({
53
+ yes
26
54
  }?: CommandOptions): Promise<void>;
27
55
  //#endregion
28
56
  //#region src/lib/templates.d.ts
@@ -36,6 +64,7 @@ declare function packageJsonTemplate(opts: {
36
64
  packageManager: string;
37
65
  typescriptVersion: string;
38
66
  useOxlint: boolean;
67
+ includeTypecheckWithoutOxlint?: boolean;
39
68
  oxlintVersion?: string;
40
69
  oxlintTsgolintVersion?: string;
41
70
  kingswordLintConfigVersion?: string;
@@ -77,4 +106,4 @@ declare function githubDependabotTemplate(opts: {
77
106
  workingDirectory: string;
78
107
  }): string;
79
108
  //#endregion
80
- export { githubCliCiWorkflowTemplate, githubDependabotTemplate, oxlintConfigTemplate, packageJsonTemplate, runCi, runInit, runOxfmt, runOxlint, validateProjectName, workspaceRootPackageJsonTemplate };
109
+ export { githubCliCiWorkflowTemplate, githubDependabotTemplate, oxlintConfigTemplate, packageJsonTemplate, runAdd, runBump, runCi, runInit, runOxfmt, runOxlint, runPackage, validateProjectName, workspaceRootPackageJsonTemplate };
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as runCi, c as oxlintConfigTemplate, i as validateProjectName, l as packageJsonTemplate, n as runOxlint, o as githubCliCiWorkflowTemplate, r as runInit, s as githubDependabotTemplate, t as runOxfmt, u as workspaceRootPackageJsonTemplate } from "./oxfmt-DlwbhnpJ.mjs";
1
+ import { a as runBump, c as validateProjectName, d as oxlintConfigTemplate, f as packageJsonTemplate, i as runCi, l as githubCliCiWorkflowTemplate, n as runOxfmt, o as runAdd, p as workspaceRootPackageJsonTemplate, r as runOxlint, s as runInit, t as runPackage, u as githubDependabotTemplate } from "./package-D5wcPeH8.mjs";
2
2
 
3
- export { githubCliCiWorkflowTemplate, githubDependabotTemplate, oxlintConfigTemplate, packageJsonTemplate, runCi, runInit, runOxfmt, runOxlint, validateProjectName, workspaceRootPackageJsonTemplate };
3
+ export { githubCliCiWorkflowTemplate, githubDependabotTemplate, oxlintConfigTemplate, packageJsonTemplate, runAdd, runBump, runCi, runInit, runOxfmt, runOxlint, runPackage, validateProjectName, workspaceRootPackageJsonTemplate };