@xylabs/ts-scripts-yarn3 7.4.19 → 7.4.21

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.
Files changed (52) hide show
  1. package/dist/actions/claude-commands.mjs +5 -1
  2. package/dist/actions/claude-commands.mjs.map +1 -1
  3. package/dist/actions/claude-rules.mjs +5 -1
  4. package/dist/actions/claude-rules.mjs.map +1 -1
  5. package/dist/actions/claude-skills.mjs +120 -0
  6. package/dist/actions/claude-skills.mjs.map +1 -0
  7. package/dist/actions/index.mjs +229 -127
  8. package/dist/actions/index.mjs.map +1 -1
  9. package/dist/bin/xy.mjs +239 -140
  10. package/dist/bin/xy.mjs.map +1 -1
  11. package/dist/index.d.ts +5 -1
  12. package/dist/index.mjs +299 -197
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/lib/claudeMdTemplate.mjs +27 -2
  15. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  16. package/dist/lib/index.mjs +26 -1
  17. package/dist/lib/index.mjs.map +1 -1
  18. package/dist/xy/build-commands/build.mjs +502 -0
  19. package/dist/xy/build-commands/build.mjs.map +1 -0
  20. package/dist/xy/{build → build-commands}/index.mjs +40 -45
  21. package/dist/xy/build-commands/index.mjs.map +1 -0
  22. package/dist/xy/common/claude/commandsCommand.mjs +5 -1
  23. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -1
  24. package/dist/xy/common/claude/index.mjs +111 -2
  25. package/dist/xy/common/claude/index.mjs.map +1 -1
  26. package/dist/xy/common/claude/initCommand.mjs +111 -1
  27. package/dist/xy/common/claude/initCommand.mjs.map +1 -1
  28. package/dist/xy/common/claude/rulesCommand.mjs +5 -1
  29. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -1
  30. package/dist/xy/common/claude/skillsCommand.mjs +129 -0
  31. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -0
  32. package/dist/xy/common/index.mjs +128 -19
  33. package/dist/xy/common/index.mjs.map +1 -1
  34. package/dist/xy/index.mjs +239 -140
  35. package/dist/xy/index.mjs.map +1 -1
  36. package/dist/xy/xy.mjs +239 -140
  37. package/dist/xy/xy.mjs.map +1 -1
  38. package/package.json +2 -2
  39. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +197 -0
  40. package/dist/xy/build/buildCommand.mjs +0 -161
  41. package/dist/xy/build/buildCommand.mjs.map +0 -1
  42. package/dist/xy/build/compileCommand.mjs +0 -174
  43. package/dist/xy/build/compileCommand.mjs.map +0 -1
  44. package/dist/xy/build/compileOnlyCommand.mjs +0 -175
  45. package/dist/xy/build/compileOnlyCommand.mjs.map +0 -1
  46. package/dist/xy/build/copyAssetsCommand.mjs +0 -84
  47. package/dist/xy/build/copyAssetsCommand.mjs.map +0 -1
  48. package/dist/xy/build/index.mjs.map +0 -1
  49. package/dist/xy/build/rebuildCommand.mjs +0 -114
  50. package/dist/xy/build/rebuildCommand.mjs.map +0 -1
  51. package/dist/xy/build/recompileCommand.mjs +0 -204
  52. package/dist/xy/build/recompileCommand.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/ts-scripts-yarn3",
3
- "version": "7.4.19",
3
+ "version": "7.4.21",
4
4
  "description": "TypeScript project scripts",
5
5
  "keywords": [
6
6
  "xylabs",
@@ -93,7 +93,7 @@
93
93
  "@types/parse-git-config": "~3.0.4",
94
94
  "@types/picomatch": "~4.0.2",
95
95
  "@types/yargs": "~17.0.35",
96
- "@xylabs/tsconfig": "~7.4.19",
96
+ "@xylabs/tsconfig": "~7.4.21",
97
97
  "esbuild": "0.27.3",
98
98
  "types-package-json": "~2.0.39",
99
99
  "typescript": "~5.9.3",
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: xylabs-e2e-setup
3
+ description: >
4
+ Sets up a complete Playwright end-to-end testing package for a React/Vite monorepo app.
5
+ Use this skill whenever the user asks to add e2e tests, set up Playwright, add browser testing,
6
+ or create a test package for a React app — even if they just say something like "add e2e" or
7
+ "I want to test this in Safari too". The skill creates the full packages/e2e/ directory with
8
+ page object models, a Playwright config covering Chromium, Firefox, and WebKit, and a webkit-safe
9
+ home page title test. It adapts to the existing repo's package naming, dev server port, and
10
+ workspace conventions rather than using generic defaults.
11
+ ---
12
+ # xylabs-e2e-setup
13
+ Scaffolds a `packages/e2e/` Playwright testing package that fits neatly into an existing
14
+ React/Vite Yarn-workspaces monorepo. The generated package uses the Page Object Model pattern,
15
+ targets all three browser engines, and includes a WebKit-safe title assertion.
16
+ ---
17
+ ## Step 1 — Read the repo before writing anything
18
+ Before generating any files, collect these four pieces of information from the repo root:
19
+ 1. **App package name** — read `package.json` → `name` field (e.g. `web-explore.xyo.network-react`)
20
+ 2. **Dev-server port** — read `vite.config.ts`; look for the parsed `port` variable or the `server.port` value. Default is `3000` if not set.
21
+ 3. **Existing e2e scripts** — check whether `package.json` already has `"e2e"` scripts so you don't duplicate them.
22
+ 4. **Workspace glob** — confirm `"workspaces": ["packages/*"]` is present so `packages/e2e` will be picked up automatically.
23
+ The e2e package name should be derived from the app name by stripping any leading scope/path noise
24
+ and appending `-e2e`. For example, `web-explore.xyo.network-react` → `web-explore-e2e`.
25
+ ---
26
+ ## Step 2 — Create `packages/e2e/`
27
+ Create every file below. Adapt the port and package name to what you found in Step 1.
28
+ ### `packages/e2e/package.json`
29
+ ```json
30
+ {
31
+ "name": "<derived-e2e-name>",
32
+ "private": true,
33
+ "type": "module",
34
+ "scripts": {
35
+ "test": "playwright test",
36
+ "test:debug": "playwright test --debug",
37
+ "test:headed": "playwright test --headed",
38
+ "test:ui": "playwright test --ui"
39
+ },
40
+ "devDependencies": {
41
+ "@playwright/test": "^1.49.0"
42
+ }
43
+ }
44
+ ```
45
+ ### `packages/e2e/tsconfig.json`
46
+ ```json
47
+ {
48
+ "compilerOptions": {
49
+ "esModuleInterop": true,
50
+ "lib": ["ES2022", "DOM"],
51
+ "module": "ESNext",
52
+ "moduleResolution": "bundler",
53
+ "noEmit": true,
54
+ "strict": true,
55
+ "target": "ES2022"
56
+ },
57
+ "exclude": ["node_modules", "test-results", "playwright-report"],
58
+ "include": ["playwright.config.ts", "tests/**/*.ts", "pages/**/*.ts", "fixtures/**/*.ts"]
59
+ }
60
+ ```
61
+ ### `packages/e2e/playwright.config.ts`
62
+ Key points:
63
+ - `baseURL` falls back to `http://localhost:<PORT>` (use the port you found)
64
+ - `webServer` restarts the app's own dev server when needed, with `reuseExistingServer: true`
65
+ - `webServer.cwd` is `'../..'` — two levels up from `packages/e2e/` to the repo root
66
+ - `webServer.command` is `'yarn start'` (the standard React/Vite dev-server script)
67
+ - CI mode: `forbidOnly`, 1 worker, 2 retries, `github` reporter
68
+ ```typescript
69
+ import { defineConfig, devices } from '@playwright/test'
70
+ const baseURL = process.env['BASE_URL'] ?? 'http://localhost:<PORT>'
71
+ export default defineConfig({
72
+ forbidOnly: !!process.env['CI'],
73
+ fullyParallel: true,
74
+ projects: [
75
+ {
76
+ name: 'chromium',
77
+ use: { ...devices['Desktop Chrome'] },
78
+ },
79
+ {
80
+ name: 'firefox',
81
+ use: { ...devices['Desktop Firefox'] },
82
+ },
83
+ {
84
+ name: 'webkit',
85
+ use: { ...devices['Desktop Safari'] },
86
+ },
87
+ ],
88
+ reporter: process.env['CI'] ? 'github' : 'html',
89
+ retries: process.env['CI'] ? 2 : 0,
90
+ testDir: './tests',
91
+ use: {
92
+ baseURL,
93
+ screenshot: 'only-on-failure',
94
+ trace: 'on-first-retry',
95
+ video: 'on-first-retry',
96
+ },
97
+ webServer: {
98
+ command: 'yarn start',
99
+ cwd: '../..',
100
+ reuseExistingServer: true,
101
+ url: baseURL,
102
+ },
103
+ workers: process.env['CI'] ? 1 : undefined,
104
+ })
105
+ ```
106
+ ### `packages/e2e/pages/BasePage.ts`
107
+ The `goto` base method navigates and waits for `networkidle`. Subclasses override `goto()` with
108
+ no arguments and call `super.goto('/<path>')`.
109
+ ```typescript
110
+ import type { Page } from '@playwright/test'
111
+ export class BasePage {
112
+ readonly page: Page
113
+ constructor(page: Page) {
114
+ this.page = page
115
+ }
116
+ async goto(path: string): Promise<void> {
117
+ await this.page.goto(path)
118
+ await this.page.waitForLoadState('networkidle')
119
+ }
120
+ }
121
+ ```
122
+ ### `packages/e2e/pages/HomePage.ts`
123
+ ```typescript
124
+ import type { Locator, Page } from '@playwright/test'
125
+ import { BasePage } from './BasePage.js'
126
+ export class HomePage extends BasePage {
127
+ readonly nav: Locator
128
+ constructor(page: Page) {
129
+ super(page)
130
+ this.nav = page.locator('nav')
131
+ }
132
+ override async goto(): Promise<void> {
133
+ await super.goto('/')
134
+ }
135
+ }
136
+ ```
137
+ ### `packages/e2e/tests/home.spec.ts`
138
+ > **Why the `waitForFunction` call?**
139
+ > In WebKit (Safari), `networkidle` can fire before React (or react-helmet) has written
140
+ > `document.title`. Adding `waitForFunction(() => document.title.length > 0)` polls inside
141
+ > the browser until the title is actually set, so the `toHaveTitle` assertion is always
142
+ > racing against a non-empty string rather than timing out on an empty one.
143
+ ```typescript
144
+ import { expect, test } from '@playwright/test'
145
+ import { HomePage } from '../pages/HomePage.js'
146
+ test.describe('Home page', () => {
147
+ test('loads successfully', async ({ page }) => {
148
+ const home = new HomePage(page)
149
+ await home.goto()
150
+ await page.waitForFunction(() => document.title.length > 0, { timeout: 5000 })
151
+ await expect(page).toHaveTitle(/.+/)
152
+ })
153
+ })
154
+ ```
155
+ ### `packages/e2e/tests/navigation.spec.ts`
156
+ Minimal smoke test — extend the `routes` array as the app grows.
157
+ ```typescript
158
+ import { expect, test } from '@playwright/test'
159
+ const routes = [
160
+ { name: 'Home', path: '/' },
161
+ ]
162
+ test.describe('Navigation', () => {
163
+ for (const route of routes) {
164
+ test(`${route.name} route renders without errors`, async ({ page }) => {
165
+ await page.goto(route.path)
166
+ await expect(page.locator('body')).toBeVisible()
167
+ })
168
+ }
169
+ })
170
+ ```
171
+ ---
172
+ ## Step 3 — Wire up root `package.json`
173
+ Add convenience scripts to the root `package.json` so developers can run tests without `cd`-ing
174
+ into `packages/e2e`. Use the e2e package name you derived in Step 1.
175
+ ```json
176
+ "e2e": "yarn workspace <derived-e2e-name> test",
177
+ "e2e:debug": "yarn workspace <derived-e2e-name> test:debug",
178
+ "e2e:headed": "yarn workspace <derived-e2e-name> test:headed",
179
+ "e2e:ui": "yarn workspace <derived-e2e-name> test:ui"
180
+ ```
181
+ Only add scripts that don't already exist.
182
+ ---
183
+ ## Step 4 — Install Playwright browsers
184
+ After scaffolding, run the following command via the Bash tool:
185
+ ```bash
186
+ yarn workspace <derived-e2e-name> playwright install
187
+ ```
188
+ This downloads the Chromium, Firefox, and WebKit browser binaries. Without this step the tests
189
+ will fail immediately with a "browser not found" error. Do not skip this step or ask the user
190
+ to run it manually — execute it directly as part of the setup.
191
+ ---
192
+ ## Conventions to preserve
193
+ - All files use ESM (`import`/`export`), never CommonJS.
194
+ - Import paths include the `.js` extension (e.g. `'./BasePage.js'`) — required for ESM + `moduleResolution: bundler`.
195
+ - Playwright bracket notation for env vars: `process.env['CI']`, not `process.env.CI` — avoids TypeScript strict-mode complaints.
196
+ - `strict: true` in `tsconfig.json`.
197
+ - No `dist/` output — `noEmit: true` because Playwright compiles on the fly via its own ESM loader.
@@ -1,161 +0,0 @@
1
- // src/actions/build.ts
2
- import chalk4 from "chalk";
3
-
4
- // src/lib/checkResult.ts
5
- import chalk from "chalk";
6
- var checkResult = (name, result, level = "error", exitOnFail = false) => {
7
- if (result) {
8
- const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
9
- const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
10
- console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
11
- if (exitOnFail) {
12
- process.exit(result);
13
- }
14
- }
15
- };
16
-
17
- // src/lib/processEx.ts
18
- import chalk2 from "chalk";
19
-
20
- // src/lib/withError.ts
21
- var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
22
- return predicate(ex) ? closure(ex) : void 0;
23
- };
24
-
25
- // src/lib/withErrnoException.ts
26
- var withErrnoException = (ex, closure) => {
27
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
28
- };
29
-
30
- // src/lib/processEx.ts
31
- var processEx = (ex) => {
32
- const error = typeof ex === "string" ? new Error(ex) : ex;
33
- const exitCode = withErrnoException(error, (error2) => {
34
- if (error2.code === "ENOENT") {
35
- console.error(chalk2.red(`'${error2.path}' not found.`));
36
- } else {
37
- console.error(chalk2.red(`Errno: ${error2.code}`));
38
- }
39
- return error2.errno ?? -1;
40
- }) ?? withError(error, (error2) => {
41
- console.error(chalk2.red(`${error2.name}: ${error2.message}`));
42
- return -1;
43
- }) ?? (() => {
44
- console.error(chalk2.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
45
- return -1;
46
- })();
47
- process.exit(process.exitCode ?? exitCode);
48
- };
49
-
50
- // src/lib/safeExit.ts
51
- var safeExitAsync = async (func, exitOnFail = true) => {
52
- try {
53
- const result = await func();
54
- if (result && exitOnFail) {
55
- process.exit(result);
56
- }
57
- return result;
58
- } catch (ex) {
59
- return processEx(ex);
60
- }
61
- };
62
-
63
- // src/lib/runStepsAsync.ts
64
- import { spawn } from "child_process";
65
- import { existsSync } from "fs";
66
- import chalk3 from "chalk";
67
- var runStepAsync = (name, step, exitOnFail = true, message) => {
68
- return new Promise((resolve) => {
69
- const [command, args, config] = step;
70
- if (message) {
71
- console.log(chalk3.gray(message));
72
- }
73
- const argList = Array.isArray(args) ? args : args.split(" ");
74
- if (command === "node" && !existsSync(argList[0])) {
75
- throw new Error(`File not found [${argList[0]}]`);
76
- }
77
- spawn(command, Array.isArray(args) ? args : args.split(" "), {
78
- ...config,
79
- env: { FORCE_COLOR: "3", ...process.env },
80
- shell: true,
81
- stdio: "inherit"
82
- }).on("close", (code) => {
83
- if (code) {
84
- console.error(
85
- chalk3.red(
86
- `Command Exited With Non-Zero Result [${chalk3.gray(code)}] | ${chalk3.yellow(command)} ${chalk3.white(
87
- Array.isArray(args) ? args.join(" ") : args
88
- )}`
89
- )
90
- );
91
- checkResult(name, code, "error", exitOnFail);
92
- resolve(code);
93
- } else {
94
- resolve(0);
95
- }
96
- });
97
- });
98
- };
99
- var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
100
- return await safeExitAsync(async () => {
101
- const pkgName = process.env.npm_package_name;
102
- console.log(chalk3.green(`${name} [${pkgName}]`));
103
- let result = 0;
104
- for (const [i, step] of steps.entries()) {
105
- result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
106
- }
107
- return result;
108
- });
109
- };
110
-
111
- // src/actions/build.ts
112
- var build = async ({
113
- incremental,
114
- jobs,
115
- target,
116
- verbose,
117
- pkg
118
- }) => {
119
- const start = Date.now();
120
- const pkgOptions = pkg === void 0 ? [] : [pkg];
121
- const incrementalOptions = incremental ? ["-i"] : [];
122
- const verboseOptions = verbose ? ["-v"] : [];
123
- const targetOptions = target === void 0 ? [] : ["-t", target];
124
- const jobsOptions = jobs === void 0 ? [] : ["-j", `${jobs}`];
125
- if (jobs !== void 0) {
126
- console.log(chalk4.blue(`Jobs set to [${jobs}]`));
127
- }
128
- const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
129
- ["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, "--types", "tsup"]],
130
- ["yarn", ["xy", "publint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
131
- ["yarn", ["xy", "deplint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
132
- ["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]]
133
- ]);
134
- console.log(`${chalk4.gray("Built in")} [${chalk4.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk4.gray("seconds")}`);
135
- return result;
136
- };
137
-
138
- // src/xy/build/buildCommand.ts
139
- var buildCommand = {
140
- command: "build [package]",
141
- describe: "Build - Compile & Lint",
142
- builder: (yargs) => {
143
- return yargs.positional("package", { describe: "Specific package to build" });
144
- },
145
- handler: async (argv) => {
146
- if (argv.verbose) {
147
- console.log(`Building: ${argv.package ?? "all"}`);
148
- }
149
- process.exitCode = await build({
150
- incremental: !!argv.incremental,
151
- jobs: argv.jobs,
152
- pkg: argv.package,
153
- target: argv.target,
154
- verbose: !!argv.verbose
155
- });
156
- }
157
- };
158
- export {
159
- buildCommand
160
- };
161
- //# sourceMappingURL=buildCommand.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/build.ts","../../../src/lib/checkResult.ts","../../../src/lib/processEx.ts","../../../src/lib/withError.ts","../../../src/lib/withErrnoException.ts","../../../src/lib/safeExit.ts","../../../src/lib/runStepsAsync.ts","../../../src/xy/build/buildCommand.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { runStepsAsync } from '../lib/index.ts'\n\nexport interface BuildParams {\n incremental?: boolean\n jobs?: number\n pkg?: string\n target?: 'esm' | 'cjs'\n verbose?: boolean\n}\n\nexport const build = async ({\n incremental, jobs, target, verbose, pkg,\n}: BuildParams) => {\n const start = Date.now()\n const pkgOptions = (pkg === undefined) ? [] : [pkg] // must go first\n const incrementalOptions = incremental ? ['-i'] : []\n const verboseOptions = verbose ? ['-v'] : []\n const targetOptions = (target === undefined) ? [] : ['-t', target]\n const jobsOptions = (jobs === undefined) ? [] : ['-j', `${jobs}`]\n if (jobs !== undefined) {\n console.log(chalk.blue(`Jobs set to [${jobs}]`))\n }\n\n const result = await runStepsAsync(`Build${incremental ? '-Incremental' : ''} [${pkg ?? 'All'}]`, [\n ['yarn', ['xy', 'compile', ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, '--types', 'tsup']],\n ['yarn', ['xy', 'publint', ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],\n ['yarn', ['xy', 'deplint', ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],\n ['yarn', ['xy', 'lint', ...pkgOptions, ...verboseOptions, ...incrementalOptions]],\n ])\n console.log(`${chalk.gray('Built in')} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`)\n return result\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { spawn } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport type { ScriptStep } from './runSteps.ts'\nimport { safeExitAsync } from './safeExit.ts'\n\nexport const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true, message?: string) => {\n return new Promise<number>((resolve) => {\n const [command, args, config] = step\n if (message) {\n console.log(chalk.gray(message))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n spawn(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).on('close', (code) => {\n if (code) {\n console.error(\n chalk.red(\n `Command Exited With Non-Zero Result [${chalk.gray(code)}] | ${chalk.yellow(command)} ${chalk.white(\n Array.isArray(args) ? args.join(' ') : args,\n )}`,\n ),\n )\n checkResult(name, code, 'error', exitOnFail)\n resolve(code)\n } else {\n resolve(0)\n }\n })\n })\n}\n\nexport const runStepsAsync = async (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]) => {\n return await safeExitAsync(async () => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let result = 0\n for (const [i, step] of steps.entries()) {\n result += await runStepAsync(name, step, exitOnFail, messages?.[i])\n }\n return result\n })\n}\n","import type { CommandModule } from 'yargs'\n\nimport { build } from '../../actions/index.ts'\n\nexport const buildCommand: CommandModule = {\n command: 'build [package]',\n describe: 'Build - Compile & Lint',\n builder: (yargs) => {\n return yargs.positional('package', { describe: 'Specific package to build' })\n },\n handler: async (argv) => {\n if (argv.verbose) {\n console.log(`Building: ${argv.package ?? 'all'}`)\n }\n\n process.exitCode = await build({\n incremental: !!argv.incremental,\n jobs: argv.jobs as number,\n pkg: argv.package as string,\n target: argv.target as 'esm' | 'cjs',\n verbose: !!argv.verbose,\n })\n },\n}\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAEX,IAAM,cAAc,CAAC,MAAc,QAAgB,QAA0B,SAAS,aAAa,UAAU;AAClH,MAAI,QAAQ;AACV,UAAM,UAAU,aAAa,sBAAsB;AACnD,UAAM,YAAY,UAAU,UAAU,MAAM,MAAM,MAAM;AACxD,YAAQ,KAAK,EAAE,UAAU,GAAG,IAAI,QAAQ,MAAM,aAAa,OAAO,EAAE,CAAC;AACrE,QAAI,YAAY;AACd,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AACF;;;ACXA,OAAOC,YAAW;;;ACAX,IAAM,YAAY,CAEvB,IACA,SACA,YAAY,CAACC,QAAW,CAAC,CAACA,IAAG,QAAQ,CAAC,CAACA,IAAG,YACvC;AACH,SAAO,UAAU,EAAO,IAAI,QAAQ,EAAO,IAAI;AACjD;;;ACLO,IAAM,qBAAqB,CAChC,IAAa,YACV;AACH,SAAO,UAAa,IAAI,SAAS,CAACC,QAAiBA,IAA6B,UAAU,MAAS;AACrG;;;AFDO,IAAM,YAAY,CAAC,OAAgB;AACxC,QAAM,QAAQ,OAAO,OAAO,WAAW,IAAI,MAAM,EAAE,IAAI;AACvD,QAAM,WACF,mBAAmB,OAAO,CAACC,WAAU;AACrC,QAAIA,OAAM,SAAS,UAAU;AAC3B,cAAQ,MAAMC,OAAM,IAAI,IAAID,OAAM,IAAI,cAAc,CAAC;AAAA,IACvD,OAAO;AACL,cAAQ,MAAMC,OAAM,IAAI,UAAUD,OAAM,IAAI,EAAE,CAAC;AAAA,IACjD;AACA,WAAOA,OAAM,SAAS;AAAA,EACxB,CAAC,KACE,UAAU,OAAO,CAACA,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","ex","error","chalk","chalk","chalk","chalk"]}
@@ -1,174 +0,0 @@
1
- // src/lib/checkResult.ts
2
- import chalk from "chalk";
3
- var checkResult = (name, result, level = "error", exitOnFail = false) => {
4
- if (result) {
5
- const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
6
- const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
7
- console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
8
- if (exitOnFail) {
9
- process.exit(result);
10
- }
11
- }
12
- };
13
-
14
- // src/lib/processEx.ts
15
- import chalk2 from "chalk";
16
-
17
- // src/lib/withError.ts
18
- var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
19
- return predicate(ex) ? closure(ex) : void 0;
20
- };
21
-
22
- // src/lib/withErrnoException.ts
23
- var withErrnoException = (ex, closure) => {
24
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
25
- };
26
-
27
- // src/lib/processEx.ts
28
- var processEx = (ex) => {
29
- const error = typeof ex === "string" ? new Error(ex) : ex;
30
- const exitCode = withErrnoException(error, (error2) => {
31
- if (error2.code === "ENOENT") {
32
- console.error(chalk2.red(`'${error2.path}' not found.`));
33
- } else {
34
- console.error(chalk2.red(`Errno: ${error2.code}`));
35
- }
36
- return error2.errno ?? -1;
37
- }) ?? withError(error, (error2) => {
38
- console.error(chalk2.red(`${error2.name}: ${error2.message}`));
39
- return -1;
40
- }) ?? (() => {
41
- console.error(chalk2.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
42
- return -1;
43
- })();
44
- process.exit(process.exitCode ?? exitCode);
45
- };
46
-
47
- // src/lib/safeExit.ts
48
- var safeExit = (func, exitOnFail = true) => {
49
- try {
50
- const result = func();
51
- if (result && exitOnFail) {
52
- process.exit(result);
53
- }
54
- return result;
55
- } catch (ex) {
56
- return processEx(ex);
57
- }
58
- };
59
-
60
- // src/lib/runSteps.ts
61
- import { spawnSync } from "child_process";
62
- import { existsSync } from "fs";
63
- import chalk3 from "chalk";
64
- var runSteps = (name, steps, exitOnFail = true, messages) => {
65
- return safeExit(() => {
66
- const pkgName = process.env.npm_package_name;
67
- console.log(chalk3.green(`${name} [${pkgName}]`));
68
- let totalStatus = 0;
69
- for (const [i, [command, args, config]] of steps.entries()) {
70
- if (messages?.[i]) {
71
- console.log(chalk3.gray(messages?.[i]));
72
- }
73
- const argList = Array.isArray(args) ? args : args.split(" ");
74
- if (command === "node" && !existsSync(argList[0])) {
75
- throw new Error(`File not found [${argList[0]}]`);
76
- }
77
- const status = spawnSync(command, Array.isArray(args) ? args : args.split(" "), {
78
- ...config,
79
- encoding: "utf8",
80
- env: { FORCE_COLOR: "3", ...process.env },
81
- shell: true,
82
- stdio: "inherit"
83
- }).status ?? 0;
84
- checkResult(name, status, "error", exitOnFail);
85
- totalStatus += status ?? 0;
86
- }
87
- return totalStatus;
88
- }, !!exitOnFail);
89
- };
90
-
91
- // src/actions/compile.ts
92
- import chalk4 from "chalk";
93
- var compile = ({
94
- verbose,
95
- target,
96
- pkg,
97
- incremental,
98
- publint,
99
- jobs
100
- }) => {
101
- return pkg ? compilePackage({
102
- pkg,
103
- publint,
104
- target,
105
- verbose
106
- }) : compileAll({
107
- incremental,
108
- publint,
109
- target,
110
- verbose,
111
- jobs
112
- });
113
- };
114
- var compilePackage = ({ target, pkg }) => {
115
- const targetOptions = target ? ["-t", target] : [];
116
- return runSteps(
117
- `Compile [${pkg}]`,
118
- [["yarn", ["workspace", pkg, "run", "package-compile", ...targetOptions]]]
119
- );
120
- };
121
- var compileAll = ({
122
- jobs,
123
- verbose,
124
- target,
125
- incremental
126
- }) => {
127
- const start = Date.now();
128
- const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
129
- const targetOptions = target ? ["-t", target] : [];
130
- const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
131
- const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
132
- if (jobs) {
133
- console.log(chalk4.blue(`Jobs set to [${jobs}]`));
134
- }
135
- const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
136
- ["yarn", [
137
- "workspaces",
138
- "foreach",
139
- ...incrementalOptions,
140
- ...jobsOptions,
141
- ...verboseOptions,
142
- "run",
143
- "package-compile",
144
- ...targetOptions
145
- ]]
146
- ]);
147
- console.log(`${chalk4.gray("Compiled in")} [${chalk4.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk4.gray("seconds")}`);
148
- return result;
149
- };
150
-
151
- // src/xy/build/compileCommand.ts
152
- var compileCommand = {
153
- command: "compile [package]",
154
- describe: "Compile with Typescript & Copy Images",
155
- builder: (yargs) => {
156
- return yargs.positional("package", { describe: "Specific package to compile" });
157
- },
158
- handler: (argv) => {
159
- if (argv.verbose) {
160
- console.log(`Compiling: ${argv.package ?? "all"}`);
161
- }
162
- process.exitCode = compile({
163
- incremental: !!argv.incremental,
164
- jobs: argv.jobs,
165
- pkg: argv.package,
166
- target: argv.target,
167
- verbose: !!argv.verbose
168
- });
169
- }
170
- };
171
- export {
172
- compileCommand
173
- };
174
- //# sourceMappingURL=compileCommand.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/checkResult.ts","../../../src/lib/processEx.ts","../../../src/lib/withError.ts","../../../src/lib/withErrnoException.ts","../../../src/lib/safeExit.ts","../../../src/lib/runSteps.ts","../../../src/actions/compile.ts","../../../src/xy/build/compileCommand.ts"],"sourcesContent":["import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep\n = | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'npm' | 'vitest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import chalk from 'chalk'\n\nimport { runSteps } from '../lib/index.ts'\n\nexport interface CompileParams {\n incremental?: boolean\n jobs?: number\n pkg?: string\n publint?: boolean\n target?: 'esm' | 'cjs'\n verbose?: boolean\n}\n\ninterface CompilePackageParams {\n pkg: string\n publint?: boolean\n target?: 'esm' | 'cjs'\n verbose?: boolean\n}\n\nexport const compile = ({\n verbose, target, pkg, incremental, publint, jobs,\n}: CompileParams) => {\n return pkg\n ? compilePackage({\n pkg, publint, target, verbose,\n })\n : compileAll({\n incremental, publint, target, verbose, jobs,\n })\n}\n\nexport const compilePackage = ({ target, pkg }: CompilePackageParams) => {\n const targetOptions = target ? ['-t', target] : []\n\n return runSteps(\n `Compile [${pkg}]`,\n [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]],\n )\n}\n\nexport const compileAll = ({\n jobs, verbose, target, incremental,\n}: CompileParams) => {\n const start = Date.now()\n const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']\n const targetOptions = target ? ['-t', target] : []\n const incrementalOptions = incremental ? ['--since', '-Ap', '--topological-dev'] : ['--parallel', '-Ap', '--topological-dev']\n const jobsOptions = jobs ? ['-j', `${jobs}`] : []\n if (jobs) {\n console.log(chalk.blue(`Jobs set to [${jobs}]`))\n }\n\n const result = runSteps(`Compile${incremental ? '-Incremental' : ''} [All]`, [\n ['yarn', ['workspaces',\n 'foreach',\n ...incrementalOptions,\n ...jobsOptions,\n ...verboseOptions,\n 'run',\n 'package-compile',\n ...targetOptions,\n ]],\n ])\n console.log(`${chalk.gray('Compiled in')} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`)\n return result\n}\n","import type { CommandModule } from 'yargs'\n\nimport { compile } from '../../actions/index.ts'\n\nexport const compileCommand: CommandModule = {\n command: 'compile [package]',\n describe: 'Compile with Typescript & Copy Images',\n builder: (yargs) => {\n return yargs.positional('package', { describe: 'Specific package to compile' })\n },\n handler: (argv) => {\n if (argv.verbose) {\n console.log(`Compiling: ${argv.package ?? 'all'}`)\n }\n process.exitCode = compile({\n incremental: !!argv.incremental,\n jobs: argv.jobs as number,\n pkg: argv.package as string,\n target: argv.target as 'esm' | 'cjs',\n verbose: !!argv.verbose,\n })\n },\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAEX,IAAM,cAAc,CAAC,MAAc,QAAgB,QAA0B,SAAS,aAAa,UAAU;AAClH,MAAI,QAAQ;AACV,UAAM,UAAU,aAAa,sBAAsB;AACnD,UAAM,YAAY,UAAU,UAAU,MAAM,MAAM,MAAM;AACxD,YAAQ,KAAK,EAAE,UAAU,GAAG,IAAI,QAAQ,MAAM,aAAa,OAAO,EAAE,CAAC;AACrE,QAAI,YAAY;AACd,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AACF;;;ACXA,OAAOA,YAAW;;;ACAX,IAAM,YAAY,CAEvB,IACA,SACA,YAAY,CAACC,QAAW,CAAC,CAACA,IAAG,QAAQ,CAAC,CAACA,IAAG,YACvC;AACH,SAAO,UAAU,EAAO,IAAI,QAAQ,EAA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