create-bestax 3.2.0 → 3.3.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/dist/constants.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const MESSAGES: {
|
|
|
13
13
|
readonly PROJECT_NAME_TOO_LONG: "Project name too long";
|
|
14
14
|
readonly PROJECT_NAME_INVALID_CHARS: "Project name can only contain letters, numbers, dots, dashes and underscores";
|
|
15
15
|
readonly OPERATION_CANCELLED: "✖ Operation cancelled";
|
|
16
|
+
readonly NO_TTY: string;
|
|
16
17
|
readonly DIRECTORY_NOT_EMPTY: (dir: string) => string;
|
|
17
18
|
readonly EMPTYING_DIRECTORY: (dir: string) => string;
|
|
18
19
|
readonly CREATING_PROJECT: (path: string) => string;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS,EAAE,QAAQ,EAG/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,kBAAkB,QAAsB,CAAC;AAEtD,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,KAAK,CAAC,MAAM,C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|
11
11
|
PROJECT_NAME_TOO_LONG: 'Project name too long',
|
|
12
12
|
PROJECT_NAME_INVALID_CHARS: 'Project name can only contain letters, numbers, dots, dashes and underscores',
|
|
13
13
|
OPERATION_CANCELLED: '✖ Operation cancelled',
|
|
14
|
+
NO_TTY: 'No interactive terminal detected — cannot prompt for input.\n' +
|
|
15
|
+
'Re-run non-interactively with a project name and flags, e.g.:\n' +
|
|
16
|
+
' npm create bestax@latest my-app -- -t vite-ts -b complete -i none -y\n' +
|
|
17
|
+
'Run with --help to see all options.',
|
|
14
18
|
DIRECTORY_NOT_EMPTY: (dir) => `Directory ${chalk.yellow(dir)} is not empty. Remove existing files and continue?`,
|
|
15
19
|
EMPTYING_DIRECTORY: (dir) => `\n Emptying ${dir}...`,
|
|
16
20
|
CREATING_PROJECT: (path) => `✔ Creating project in ${chalk.bold(path)}`,
|
|
@@ -72,8 +76,8 @@ ${setupLines.join('\n')}
|
|
|
72
76
|
|
|
73
77
|
- Never inline \`style={{}}\` — use the helper props every component accepts (\`m*\`/\`p*\`
|
|
74
78
|
spacing, \`textColor\`/\`bgColor\`, \`display="flex"\`, \`flexDirection\`, \`alignItems\`).
|
|
75
|
-
Flex layouts have no \`gap\` helper — space children with margins (\`Grid\`
|
|
76
|
-
\`gap\` prop
|
|
79
|
+
Flex layouts have no \`gap\` helper — space children with margins (\`Grid\` and \`Columns\`
|
|
80
|
+
take a \`gap\` prop, so prefer that there).
|
|
77
81
|
- Compose existing components before writing custom CSS; theme via \`Theme\` and \`--bulma-*\`
|
|
78
82
|
variables, never hardcoded colors.
|
|
79
83
|
- There is no test runner or Storybook in this app — don't assume one.
|
|
@@ -87,6 +91,7 @@ automatically when the task matches:
|
|
|
87
91
|
- **bestax-form** — build forms with the bestax form components (no form library).
|
|
88
92
|
- **bestax-theming** — colors, branding, and dark mode via the \`Theme\` component (\`colorMode\`).
|
|
89
93
|
- **bestax-layout-scaffold** — scaffold full pages (app shell, landing, centered, card grid).
|
|
94
|
+
- **bestax-icons** — icons via \`Icon\`/\`IconText\`: library setup, name formats, variants, a11y.
|
|
90
95
|
|
|
91
96
|
Prefer the library's components and these skills over hand-written Bulma markup or custom CSS.
|
|
92
97
|
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAwBA,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWhE;AAED,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAU5D;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAa7D;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAchE;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBhE"}
|
package/dist/prompts.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import prompts from 'prompts';
|
|
2
2
|
import { TEMPLATES, DEFAULT_PROJECT_NAME, PROMPTS as PROMPT_MESSAGES, MESSAGES, ICON_LIBRARIES, BULMA_FLAVORS, } from './constants.js';
|
|
3
3
|
import { validateProjectName } from './validators.js';
|
|
4
|
+
import { displayError } from './display.js';
|
|
5
|
+
/**
|
|
6
|
+
* Guard against hanging forever in non-interactive environments (CI, agents,
|
|
7
|
+
* piped stdin): every interactive question must fail fast with actionable
|
|
8
|
+
* guidance when stdin is not a TTY (#192).
|
|
9
|
+
*/
|
|
10
|
+
function ensureInteractive() {
|
|
11
|
+
if (!process.stdin.isTTY) {
|
|
12
|
+
displayError(MESSAGES.NO_TTY);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
4
16
|
export async function promptProjectName() {
|
|
17
|
+
ensureInteractive();
|
|
5
18
|
const response = await prompts({
|
|
6
19
|
type: 'text',
|
|
7
20
|
name: 'projectName',
|
|
@@ -12,6 +25,7 @@ export async function promptProjectName() {
|
|
|
12
25
|
return response.projectName || null;
|
|
13
26
|
}
|
|
14
27
|
export async function promptOverwriteDirectory(targetDir) {
|
|
28
|
+
ensureInteractive();
|
|
15
29
|
const response = await prompts({
|
|
16
30
|
type: 'confirm',
|
|
17
31
|
name: 'overwrite',
|
|
@@ -21,6 +35,7 @@ export async function promptOverwriteDirectory(targetDir) {
|
|
|
21
35
|
return response.overwrite === true;
|
|
22
36
|
}
|
|
23
37
|
export async function promptInstallSkills() {
|
|
38
|
+
ensureInteractive();
|
|
24
39
|
const response = await prompts({
|
|
25
40
|
type: 'confirm',
|
|
26
41
|
name: 'skills',
|
|
@@ -30,6 +45,7 @@ export async function promptInstallSkills() {
|
|
|
30
45
|
return response.skills === true;
|
|
31
46
|
}
|
|
32
47
|
export async function promptTemplate() {
|
|
48
|
+
ensureInteractive();
|
|
33
49
|
const response = await prompts({
|
|
34
50
|
type: 'select',
|
|
35
51
|
name: 'template',
|
|
@@ -42,6 +58,7 @@ export async function promptTemplate() {
|
|
|
42
58
|
return response.template || null;
|
|
43
59
|
}
|
|
44
60
|
export async function promptIconLibrary() {
|
|
61
|
+
ensureInteractive();
|
|
45
62
|
const response = await prompts({
|
|
46
63
|
type: 'select',
|
|
47
64
|
name: 'iconLibrary',
|
|
@@ -55,6 +72,7 @@ export async function promptIconLibrary() {
|
|
|
55
72
|
return response.iconLibrary || null;
|
|
56
73
|
}
|
|
57
74
|
export async function promptBulmaFlavor() {
|
|
75
|
+
ensureInteractive();
|
|
58
76
|
const response = await prompts({
|
|
59
77
|
type: 'select',
|
|
60
78
|
name: 'bulmaFlavor',
|
package/package.json
CHANGED
|
@@ -91,15 +91,15 @@ The responsive grid. `Columns` is the row; `Column` is a cell.
|
|
|
91
91
|
|
|
92
92
|
**Columns**
|
|
93
93
|
|
|
94
|
-
| Prop
|
|
95
|
-
|
|
|
96
|
-
| `isMultiline`
|
|
97
|
-
| `isCentered`
|
|
98
|
-
| `isVCentered`
|
|
99
|
-
| `isGapless`
|
|
100
|
-
| `isMobile`
|
|
101
|
-
| `isDesktop`
|
|
102
|
-
| `
|
|
94
|
+
| Prop | Type |
|
|
95
|
+
| -------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
96
|
+
| `isMultiline` | `boolean` (wrap cells onto new rows) |
|
|
97
|
+
| `isCentered` | `boolean` (center the row) |
|
|
98
|
+
| `isVCentered` | `boolean` (vertical centering — capital V) |
|
|
99
|
+
| `isGapless` | `boolean` |
|
|
100
|
+
| `isMobile` | `boolean` (stay side-by-side on mobile) |
|
|
101
|
+
| `isDesktop` | `boolean` |
|
|
102
|
+
| `gap` / `gapMobile` / `gapTablet` / `gapDesktop` / `gapWidescreen` / `gapFullhd` | `0`–`8` (number or string, same scale as `Grid`'s `gap`) |
|
|
103
103
|
|
|
104
104
|
**Column**
|
|
105
105
|
|