create-bestax 3.8.0 → 4.0.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/README.md CHANGED
@@ -3,11 +3,21 @@
3
3
  [![npm version](https://img.shields.io/npm/v/create-bestax.svg)](https://www.npmjs.com/package/create-bestax)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/create-bestax.svg)](https://www.npmjs.com/package/create-bestax)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/create-bestax)](https://socket.dev/npm/package/create-bestax/overview)
7
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/allxsmith/bestax/badge)](https://scorecard.dev/viewer/?uri=github.com/allxsmith/bestax)
8
+ [![npm provenance](https://img.shields.io/badge/npm-provenance-3fb950.svg)](https://www.npmjs.com/package/create-bestax#provenance)
9
+ [![Security policy](https://img.shields.io/badge/security-policy-blue.svg)](https://github.com/allxsmith/bestax/blob/main/SECURITY.md)
6
10
 
7
11
  The scaffolder for [`@allxsmith/bestax-bulma`](https://www.npmjs.com/package/@allxsmith/bestax-bulma) — spin up a Vite app pre-wired for the **Bulma v1** React component library in one command. Picks your framework (JS or TypeScript), CSS flavor, and icon library, and can drop in the bestax **AI skills** so an agent like Claude Code knows the library from the first prompt.
8
12
 
9
13
  Part of the [bestax monorepo](https://github.com/allxsmith/bestax) — see also [`@allxsmith/bestax-bulma`](https://www.npmjs.com/package/@allxsmith/bestax-bulma) for the components themselves.
10
14
 
15
+ ## Requirements
16
+
17
+ - **Node.js 22 or newer.** Node 18 and 20 are both past end-of-life. On an older runtime the
18
+ CLI exits immediately with an explicit upgrade message.
19
+ - npm 10 or newer (ships with Node 22), or yarn/pnpm.
20
+
11
21
  ## Usage
12
22
 
13
23
  ### Quick Start
@@ -127,6 +137,20 @@ npm run typecheck # Type check CLI source code
127
137
 
128
138
  **Note on Templates:** Template files in `templates/` are excluded from linting. They should be manually validated by scaffolding a test project and running lint/build there before releasing.
129
139
 
140
+ ## Hardened by default
141
+
142
+ A scaffolder runs with write access to your filesystem and picks your starting dependencies, so how it is built and published matters:
143
+
144
+ - **Signed provenance** — every release carries a sigstore attestation linking the tarball to the exact commit and CI run that built it. Check the **Provenance** section on the [npm page](https://www.npmjs.com/package/create-bestax#provenance), or run `npm audit signatures`.
145
+ - **npm OIDC trusted publishing** — short-lived, per-run credentials; no long-lived `NPM_TOKEN` exists to be stolen. Release commits and tags are GPG-signed.
146
+ - **Socket.dev scans every PR** for malware, install scripts, obfuscated code, and privilege escalation before it can reach `main`.
147
+ - **Dependencies are a deliberate act** — install scripts are blocked unless individually allow-listed, freshly published versions are refused for 3 days, and CI installs only what the reviewed lockfile resolves.
148
+ - **Every GitHub Action is pinned to a full commit SHA**, so a compromised action release can't roll silently into a build of this CLI.
149
+ - **CodeQL, Dependency Review, and Dependabot** run continuously, alongside a high-severity `pnpm audit` gate.
150
+ - **Layered AI review before merge** — [CodeRabbit](https://coderabbit.ai) plus an independent adversarial Claude review (a different model from the one writing AI-authored changes), on top of required green CI, an approving review, and a human merge.
151
+
152
+ Full detail: [`SECURITY.md`](https://github.com/allxsmith/bestax/blob/main/SECURITY.md) · [Security guide](https://bestax.io/docs/guides/security)
153
+
130
154
  ## Publishing
131
155
 
132
156
  This package uses semantic-release with scope-based rules. Only commits with `feat(create-bestax)` or `fix(create-bestax)` will trigger releases.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAuBA,OAAO,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1,15 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import { createCLI } from './cli.js';
3
- import chalk from 'chalk';
4
- // Check Node.js version requirement (Breaking change for v2.0.0)
2
+ // The version guard deliberately runs before anything else is imported, and
3
+ // deliberately does not use chalk. `import` declarations are hoisted and
4
+ // evaluated before any statement in this module, and chalk >= 6 itself
5
+ // requires Node >= 22 — so a static import would fail to load on exactly the
6
+ // runtimes this guard exists to catch, replacing the message below with an
7
+ // opaque loader error. ./cli.js is pulled in dynamically for the same reason.
5
8
  const currentNodeVersion = process.versions.node;
6
9
  const majorVersion = parseInt(currentNodeVersion.split('.')[0], 10);
7
- const MINIMUM_NODE_VERSION = 18;
10
+ const MINIMUM_NODE_VERSION = 22;
8
11
  if (majorVersion < MINIMUM_NODE_VERSION) {
9
- console.error(chalk.red(`Error: create-bestax requires Node.js v${MINIMUM_NODE_VERSION}.0.0 or higher.\n` +
12
+ console.error(`Error: create-bestax requires Node.js v${MINIMUM_NODE_VERSION}.0.0 or higher.\n` +
10
13
  `You are currently running Node.js v${currentNodeVersion}.\n` +
11
- `Please upgrade your Node.js version.`));
14
+ `Please upgrade your Node.js version.`);
12
15
  process.exit(1);
13
16
  }
17
+ const { createCLI } = await import('./cli.js');
14
18
  const program = createCLI();
15
19
  program.parse();
20
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bestax",
3
- "version": "3.8.0",
3
+ "version": "4.0.1",
4
4
  "description": "Create a new bestax-bulma project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,7 +40,7 @@
40
40
  "author": "Alex Smith",
41
41
  "license": "MIT",
42
42
  "engines": {
43
- "node": ">=18.0.0"
43
+ "node": ">=22"
44
44
  },
45
45
  "repository": {
46
46
  "type": "git",
@@ -53,22 +53,22 @@
53
53
  "url": "https://github.com/allxsmith/bestax/issues"
54
54
  },
55
55
  "dependencies": {
56
- "chalk": "^5.6.2",
56
+ "chalk": "^6.0.0",
57
57
  "commander": "^15.0.0",
58
58
  "figures": "^6.1.0",
59
- "fs-extra": "^11.2.0",
59
+ "fs-extra": "^11.4.0",
60
60
  "prompts": "^2.4.2"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@jest/globals": "^30.0.0",
64
- "@playwright/test": "^1.57.0",
64
+ "@playwright/test": "^1.62.0",
65
65
  "@types/fs-extra": "^11.0.4",
66
66
  "@types/jest": "^30.0.0",
67
- "@types/node": "^26.1.1",
67
+ "@types/node": "^26.1.2",
68
68
  "@types/prompts": "^2.4.9",
69
69
  "@types/wait-on": "^5.3.4",
70
70
  "jest": "^30.2.0",
71
- "ts-jest": "^29.4.6",
71
+ "ts-jest": "^29.4.12",
72
72
  "typescript": "^6.0.3",
73
73
  "wait-on": "^9.1.0"
74
74
  },
@@ -144,17 +144,16 @@ function SignupForm() {
144
144
  const [email, setEmail] = useState('');
145
145
  const [touched, setTouched] = useState(false);
146
146
 
147
+ const valid = /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email);
147
148
  const error =
148
- touched && !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)
149
- ? 'Please enter a valid email address.'
150
- : undefined;
149
+ touched && !valid ? 'Please enter a valid email address.' : undefined;
151
150
 
152
151
  return (
153
152
  <form
154
153
  onSubmit={e => {
155
154
  e.preventDefault();
156
155
  setTouched(true);
157
- if (!error && email) {
156
+ if (valid) {
158
157
  // submit…
159
158
  }
160
159
  }}
@@ -169,6 +168,8 @@ function SignupForm() {
169
168
  message={error}
170
169
  messageColor={error ? 'danger' : undefined}
171
170
  iconLeftName="envelope"
171
+ id="signup-email"
172
+ labelProps={{ htmlFor: 'signup-email' }}
172
173
  />
173
174
  <Button color="primary" type="submit" mt="3">
174
175
  Sign up