@pugi/cli 1.0.0-alpha.26 → 1.0.0-alpha.261
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 +19 -8
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/bin/pugi +95 -8
- package/models.json +1 -0
- package/package.json +30 -10
- package/postinstall.mjs +158 -23
- package/release.json +8 -0
- package/skills/a11y/SKILL.md +27 -0
- package/skills/ab-test-analysis/SKILL.md +15 -0
- package/skills/ai-sdk/SKILL.md +27 -0
- package/skills/api-integration/SKILL.md +27 -0
- package/skills/architecture-review/SKILL.md +19 -0
- package/skills/brand-voice/SKILL.md +27 -0
- package/skills/ci-cd-pipeline/SKILL.md +15 -0
- package/skills/code-review/SKILL.md +27 -0
- package/skills/competitor-analysis/SKILL.md +27 -0
- package/skills/content-design/SKILL.md +35 -0
- package/skills/css-tailwind/SKILL.md +39 -0
- package/skills/css-tailwind/quirks.md +86 -0
- package/skills/db-vector/SKILL.md +27 -0
- package/skills/design-radix/SKILL.md +35 -0
- package/skills/design-system/SKILL.md +35 -0
- package/skills/detecting-data-anomalies/SKILL.md +15 -0
- package/skills/docker-deploy/SKILL.md +15 -0
- package/skills/edge-case-finder/SKILL.md +27 -0
- package/skills/fonts/SKILL.md +34 -0
- package/skills/framework-grammy/SKILL.md +27 -0
- package/skills/framework-mastra/SKILL.md +27 -0
- package/skills/framework-nestjs/SKILL.md +27 -0
- package/skills/framework-prisma/SKILL.md +27 -0
- package/skills/funnel-optimization/SKILL.md +19 -0
- package/skills/ha-prototype-web/LICENSE-APACHE-2.0 +201 -0
- package/skills/ha-prototype-web/NOTICE.md +126 -0
- package/skills/ha-prototype-web/SKILL.md +25 -0
- package/skills/icons/SKILL.md +34 -0
- package/skills/landing-templates/SKILL.md +35 -0
- package/skills/market-research/SKILL.md +27 -0
- package/skills/metrics-dashboard/SKILL.md +19 -0
- package/skills/monitoring-setup/SKILL.md +15 -0
- package/skills/motion/SKILL.md +27 -0
- package/skills/nestjs-api/SKILL.md +38 -0
- package/skills/nestjs-api/quirks.md +36 -0
- package/skills/nextjs-page/SKILL.md +27 -0
- package/skills/od-blog-post/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-blog-post/NOTICE.md +126 -0
- package/skills/od-blog-post/SKILL.md +81 -0
- package/skills/od-contact-widget/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-contact-widget/NOTICE.md +126 -0
- package/skills/od-contact-widget/SKILL.md +132 -0
- package/skills/od-craft/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-craft/NOTICE.md +126 -0
- package/skills/od-craft/SKILL.md +58 -0
- package/skills/od-craft/references/README.md +108 -0
- package/skills/od-craft/references/accessibility-baseline.md +203 -0
- package/skills/od-craft/references/animation-discipline.md +156 -0
- package/skills/od-craft/references/anti-ai-slop.md +86 -0
- package/skills/od-craft/references/color.md +90 -0
- package/skills/od-craft/references/form-validation.md +223 -0
- package/skills/od-craft/references/laws-of-ux.md +298 -0
- package/skills/od-craft/references/rtl-and-bidi.md +188 -0
- package/skills/od-craft/references/state-coverage.md +136 -0
- package/skills/od-craft/references/typography-hierarchy-editorial.md +184 -0
- package/skills/od-craft/references/typography-hierarchy.md +167 -0
- package/skills/od-craft/references/typography.md +124 -0
- package/skills/od-critique/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-critique/NOTICE.md +126 -0
- package/skills/od-critique/SKILL.md +259 -0
- package/skills/od-dashboard/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-dashboard/NOTICE.md +126 -0
- package/skills/od-dashboard/SKILL.md +77 -0
- package/skills/od-design-brief/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-design-brief/NOTICE.md +126 -0
- package/skills/od-design-brief/SKILL.md +260 -0
- package/skills/od-docs-page/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-docs-page/NOTICE.md +126 -0
- package/skills/od-docs-page/SKILL.md +81 -0
- package/skills/od-email-marketing/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-email-marketing/NOTICE.md +126 -0
- package/skills/od-email-marketing/SKILL.md +85 -0
- package/skills/od-eng-runbook/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-eng-runbook/NOTICE.md +126 -0
- package/skills/od-eng-runbook/SKILL.md +52 -0
- package/skills/od-faq-page/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-faq-page/NOTICE.md +126 -0
- package/skills/od-faq-page/SKILL.md +113 -0
- package/skills/od-finance-report/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-finance-report/NOTICE.md +126 -0
- package/skills/od-finance-report/SKILL.md +62 -0
- package/skills/od-frontend-design/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-frontend-design/LICENSE.txt +177 -0
- package/skills/od-frontend-design/NOTICE.md +126 -0
- package/skills/od-frontend-design/SKILL.md +86 -0
- package/skills/od-hr-onboarding/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-hr-onboarding/NOTICE.md +126 -0
- package/skills/od-hr-onboarding/SKILL.md +53 -0
- package/skills/od-invoice/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-invoice/NOTICE.md +126 -0
- package/skills/od-invoice/SKILL.md +49 -0
- package/skills/od-kanban-board/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-kanban-board/NOTICE.md +126 -0
- package/skills/od-kanban-board/SKILL.md +51 -0
- package/skills/od-login-flow/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-login-flow/NOTICE.md +126 -0
- package/skills/od-login-flow/SKILL.md +49 -0
- package/skills/od-login-flow/references/checklist.md +19 -0
- package/skills/od-magazine-poster/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-magazine-poster/NOTICE.md +126 -0
- package/skills/od-magazine-poster/SKILL.md +90 -0
- package/skills/od-meeting-notes/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-meeting-notes/NOTICE.md +126 -0
- package/skills/od-meeting-notes/SKILL.md +48 -0
- package/skills/od-mobile-app/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-mobile-app/NOTICE.md +126 -0
- package/skills/od-mobile-app/SKILL.md +103 -0
- package/skills/od-mobile-app/assets/template.html +442 -0
- package/skills/od-mobile-app/references/checklist.md +46 -0
- package/skills/od-mobile-app/references/layouts.md +312 -0
- package/skills/od-mobile-onboarding/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-mobile-onboarding/NOTICE.md +126 -0
- package/skills/od-mobile-onboarding/SKILL.md +54 -0
- package/skills/od-pm-spec/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-pm-spec/NOTICE.md +126 -0
- package/skills/od-pm-spec/SKILL.md +53 -0
- package/skills/od-pricing-page/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-pricing-page/NOTICE.md +126 -0
- package/skills/od-pricing-page/SKILL.md +80 -0
- package/skills/od-redesign-skill/LICENSE +21 -0
- package/skills/od-redesign-skill/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-redesign-skill/NOTICE.md +126 -0
- package/skills/od-redesign-skill/SKILL.md +205 -0
- package/skills/od-reference-design-contract/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-reference-design-contract/NOTICE.md +126 -0
- package/skills/od-reference-design-contract/SKILL.md +131 -0
- package/skills/od-reference-design-contract/references/checklist.md +26 -0
- package/skills/od-saas-landing/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-saas-landing/NOTICE.md +126 -0
- package/skills/od-saas-landing/SKILL.md +125 -0
- package/skills/od-social-carousel/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-social-carousel/NOTICE.md +126 -0
- package/skills/od-social-carousel/SKILL.md +92 -0
- package/skills/od-team-okrs/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-team-okrs/NOTICE.md +126 -0
- package/skills/od-team-okrs/SKILL.md +48 -0
- package/skills/od-waitlist-page/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-waitlist-page/NOTICE.md +126 -0
- package/skills/od-waitlist-page/SKILL.md +229 -0
- package/skills/od-waitlist-page/assets/template.html +457 -0
- package/skills/od-waitlist-page/references/checklist.md +42 -0
- package/skills/od-web-design-guidelines/LICENSE +21 -0
- package/skills/od-web-design-guidelines/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-web-design-guidelines/NOTICE.md +126 -0
- package/skills/od-web-design-guidelines/SKILL.md +66 -0
- package/skills/od-web-design-guidelines/references/guidelines.md +133 -0
- package/skills/od-web-prototype/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-web-prototype/NOTICE.md +126 -0
- package/skills/od-web-prototype/SKILL.md +102 -0
- package/skills/od-web-prototype/assets/template.html +348 -0
- package/skills/od-web-prototype/references/checklist.md +47 -0
- package/skills/od-web-prototype/references/layouts.md +247 -0
- package/skills/od-web-prototype-taste-brutalist/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-web-prototype-taste-brutalist/LICENSE-MIT-Leonxlnx +21 -0
- package/skills/od-web-prototype-taste-brutalist/NOTICE.md +126 -0
- package/skills/od-web-prototype-taste-brutalist/SKILL.md +64 -0
- package/skills/od-web-prototype-taste-editorial/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-web-prototype-taste-editorial/LICENSE-MIT-Leonxlnx +21 -0
- package/skills/od-web-prototype-taste-editorial/NOTICE.md +126 -0
- package/skills/od-web-prototype-taste-editorial/SKILL.md +61 -0
- package/skills/od-web-prototype-taste-soft/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-web-prototype-taste-soft/LICENSE-MIT-Leonxlnx +21 -0
- package/skills/od-web-prototype-taste-soft/NOTICE.md +126 -0
- package/skills/od-web-prototype-taste-soft/SKILL.md +64 -0
- package/skills/od-webgl-experience/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-webgl-experience/NOTICE.md +126 -0
- package/skills/od-webgl-experience/SKILL.md +81 -0
- package/skills/od-wireframe-annotated/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-wireframe-annotated/NOTICE.md +126 -0
- package/skills/od-wireframe-annotated/SKILL.md +90 -0
- package/skills/od-wireframe-greybox/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-wireframe-greybox/NOTICE.md +126 -0
- package/skills/od-wireframe-greybox/SKILL.md +90 -0
- package/skills/od-wireframe-mobile-flow/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-wireframe-mobile-flow/NOTICE.md +126 -0
- package/skills/od-wireframe-mobile-flow/SKILL.md +96 -0
- package/skills/od-wireframe-sketch/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-wireframe-sketch/NOTICE.md +126 -0
- package/skills/od-wireframe-sketch/SKILL.md +98 -0
- package/skills/orchestrating-multi-agent-systems/SKILL.md +19 -0
- package/skills/preprocessing-data/SKILL.md +15 -0
- package/skills/project-memory-keeper/SKILL.md +19 -0
- package/skills/public-apis/SKILL.md +27 -0
- package/skills/pugi-patterns/SKILL.md +19 -0
- package/skills/react-component/SKILL.md +27 -0
- package/skills/sprint-planning/SKILL.md +19 -0
- package/skills/stack-selection/SKILL.md +15 -0
- package/skills/standup-summary/SKILL.md +15 -0
- package/skills/task-decomposition/SKILL.md +19 -0
- package/skills/team-routing/SKILL.md +15 -0
- package/skills/tech-survey/SKILL.md +15 -0
- package/skills/test-plan/SKILL.md +15 -0
- package/skills/typescript-refactor/SKILL.md +15 -0
- package/skills/ui-components/SKILL.md +35 -0
- package/skills/ux-patterns/SKILL.md +35 -0
- package/skills/web-platform/SKILL.md +27 -0
- package/skills/web-scrape/SKILL.md +27 -0
- package/skills/web-search/SKILL.md +15 -0
- package/skills/webapp-testing/SKILL.md +37 -0
- package/skills/webapp-testing/quirks.md +26 -0
package/README.md
CHANGED
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pugi CLI
|
|
2
2
|
|
|
3
|
-
Pugi
|
|
3
|
+
Pugi is an AI product team in your terminal. Describe what you want in plain words and a team of AI specialists plans it, builds it, tests it and checks its security, then you publish it. Works on your own repository or a new project, on macOS and Linux.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
curl -fsSL https://pugi.io/install | sh # macOS and Linux, no Node needed
|
|
9
|
+
npm install -g @pugi/cli # or with npm
|
|
10
|
+
brew install pugi-io/tap/pugi # or with Homebrew
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
## Usage
|
|
12
14
|
|
|
13
15
|
```bash
|
|
16
|
+
pugi # interactive session in the current folder
|
|
17
|
+
pugi run "..." # one-shot task
|
|
18
|
+
pugi login # sign in with your Pugi account
|
|
14
19
|
pugi --help
|
|
15
|
-
pugi # interactive TUI
|
|
16
|
-
pugi run "..." # one-shot prompt
|
|
17
20
|
```
|
|
18
21
|
|
|
22
|
+
## What else is Pugi
|
|
23
|
+
|
|
24
|
+
- Web console: https://app.pugi.io (build sites and apps from a brief, preview, publish)
|
|
25
|
+
- Desktop apps, editor and browser extensions: https://pugi.io/download
|
|
26
|
+
- Free logo maker and brand kit: https://logo.pugi.io
|
|
27
|
+
- For AI agents (MCP server, Claude Code and Cursor plugins): https://pugi.io/agents.md
|
|
28
|
+
- Plans: https://pugi.io/pricing
|
|
29
|
+
|
|
19
30
|
## License
|
|
20
31
|
|
|
21
|
-
MIT - see LICENSE for upstream attribution.
|
|
32
|
+
MIT - see LICENSE for upstream attribution and THIRD_PARTY_NOTICES.md for ported code.
|
|
22
33
|
|
|
23
|
-
##
|
|
34
|
+
## Support
|
|
24
35
|
|
|
25
|
-
https://pugi.io
|
|
36
|
+
support@pugi.io · https://pugi.io
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
Code in this repository that was copied or ported from other open-source
|
|
4
|
+
projects, with the licence it was taken under. (The upstream OpenCode fork
|
|
5
|
+
itself is described in `NOTICE.md`.)
|
|
6
|
+
|
|
7
|
+
## cloudflare/vibesdk — deterministic TypeScript code fixer
|
|
8
|
+
|
|
9
|
+
| Field | Value |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Source | https://github.com/cloudflare/vibesdk, `worker/services/code-fixer/` |
|
|
12
|
+
| Commit | `9da158d82c597a0e8f4bf033cdccd1053fb6fb15` (2026-09-07) |
|
|
13
|
+
| License | MIT |
|
|
14
|
+
| Where | `packages/opencode/src/code-fixer/vibesdk/` (every file carries a header naming its source file) |
|
|
15
|
+
| Pugi changes | Logger shim (`logger.ts`), local `CodeIssue` type, statement-level splice printing that keeps untouched code and comments byte for byte (`utils/ast.ts`), import-first TS2304 (`../resolve-name.ts`), the `allowStubs` switch (no invented code before publish), the `PUGI-STUB` marker on invented code, exact-name-only default→named conversion, no silent removal of an unresolved import, unique-candidate typo fixes (TS2614), in-place TS2724 edits. Each change is marked `Pugi:` in the source. |
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
MIT License
|
|
19
|
+
|
|
20
|
+
Copyright (c) 2025 Cloudflare
|
|
21
|
+
|
|
22
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
24
|
+
in the Software without restriction, including without limitation the rights
|
|
25
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
27
|
+
furnished to do so, subject to the following conditions:
|
|
28
|
+
|
|
29
|
+
The above copyright notice and this permission notice shall be included in all
|
|
30
|
+
copies or substantial portions of the Software.
|
|
31
|
+
|
|
32
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
+
SOFTWARE.
|
|
39
|
+
```
|
package/bin/pugi
CHANGED
|
@@ -1,8 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `bin/pugi` of the @pugi/cli npm package (PUG-44). It runs the native Pugi
|
|
3
|
+
// binary from the platform package @pugi/cli-<os>-<arch>.
|
|
4
|
+
//
|
|
5
|
+
// Why a Node launcher: npm's Windows shims run the bin target by its name, and
|
|
6
|
+
// cmd and PowerShell will not start an exe without the .exe extension, so a
|
|
7
|
+
// native binary copied to `bin/pugi` never started from them. The shebang makes
|
|
8
|
+
// npm's cmd-shim run this file with node. It also works when install scripts
|
|
9
|
+
// are blocked (npm 12 does that by default for global installs): it needs no
|
|
10
|
+
// postinstall. On POSIX under npm or bun, the postinstall replaces this file
|
|
11
|
+
// with the native binary so no extra process runs (postinstall.mjs).
|
|
12
|
+
//
|
|
13
|
+
// The engine finds files that ship in the wrapper (the bundled skills) through
|
|
14
|
+
// PUGI_CLI_PACKAGE_DIR, because the binary it runs lives in another package.
|
|
15
|
+
"use strict"
|
|
16
|
+
|
|
17
|
+
const childProcess = require("child_process")
|
|
18
|
+
const fs = require("fs")
|
|
19
|
+
const path = require("path")
|
|
20
|
+
|
|
21
|
+
const PACKAGE_DIR_ENV = "PUGI_CLI_PACKAGE_DIR"
|
|
22
|
+
const PLATFORMS = { darwin: "darwin", linux: "linux", win32: "windows" }
|
|
23
|
+
const ARCHES = { x64: "x64", arm64: "arm64" }
|
|
24
|
+
|
|
25
|
+
function platformPackage(platform, arch) {
|
|
26
|
+
return `@pugi/cli-${PLATFORMS[platform] || platform}-${ARCHES[arch] || arch}`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The platform package's binary, resolved from the wrapper whether npm nested or hoisted it. */
|
|
30
|
+
function resolveBinary(packageDir, platform, arch) {
|
|
31
|
+
const name = platformPackage(platform, arch)
|
|
32
|
+
const manifest = (() => {
|
|
33
|
+
try {
|
|
34
|
+
return require.resolve(`${name}/package.json`, { paths: [packageDir] })
|
|
35
|
+
} catch {
|
|
36
|
+
return undefined
|
|
37
|
+
}
|
|
38
|
+
})()
|
|
39
|
+
if (!manifest) return { name }
|
|
40
|
+
const binary = path.join(path.dirname(manifest), "bin", platform === "win32" ? "pugi.exe" : "pugi")
|
|
41
|
+
return fs.existsSync(binary) ? { name, binary } : { name }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function run() {
|
|
45
|
+
const packageDir = path.dirname(path.dirname(fs.realpathSync(__filename)))
|
|
46
|
+
const found = resolveBinary(packageDir, process.platform, process.arch)
|
|
47
|
+
if (!found.binary) {
|
|
48
|
+
console.error(`Pugi could not find its program for ${process.platform}-${process.arch}: the package ${found.name} is not installed.`)
|
|
49
|
+
console.error("It is an optional dependency of @pugi/cli, so it must not be skipped. Reinstall with:")
|
|
50
|
+
console.error(" npm install -g @pugi/cli")
|
|
51
|
+
process.exit(1)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const child = childProcess.spawn(found.binary, process.argv.slice(2), {
|
|
55
|
+
stdio: "inherit",
|
|
56
|
+
env: { ...process.env, [PACKAGE_DIR_ENV]: packageDir },
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// Windows: the child shares the console and gets Ctrl+C, Ctrl+Break and the
|
|
60
|
+
// close event itself; child.kill() would be TerminateProcess, so the launcher
|
|
61
|
+
// only keeps itself alive and waits. POSIX: forward, so a signal sent to the
|
|
62
|
+
// launcher's pid alone also reaches the engine. A Ctrl+C the terminal sends
|
|
63
|
+
// to the whole group then arrives twice; the engine coalesces it.
|
|
64
|
+
const handlers = new Map()
|
|
65
|
+
const ignored = process.platform === "win32" ? ["SIGINT", "SIGBREAK"] : []
|
|
66
|
+
const forwarded = process.platform === "win32" ? [] : ["SIGINT", "SIGTERM", "SIGHUP"]
|
|
67
|
+
for (const signal of ignored) handlers.set(signal, () => {})
|
|
68
|
+
for (const signal of forwarded) {
|
|
69
|
+
handlers.set(signal, () => {
|
|
70
|
+
try {
|
|
71
|
+
child.kill(signal)
|
|
72
|
+
} catch {
|
|
73
|
+
// The child has already exited.
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
for (const [signal, handler] of handlers) process.on(signal, handler)
|
|
78
|
+
|
|
79
|
+
child.on("error", (error) => {
|
|
80
|
+
console.error(`Pugi could not start ${found.binary}: ${error.message}`)
|
|
81
|
+
process.exit(1)
|
|
82
|
+
})
|
|
83
|
+
child.on("exit", (code, signal) => {
|
|
84
|
+
for (const [name, handler] of handlers) process.removeListener(name, handler)
|
|
85
|
+
if (signal && process.platform !== "win32") {
|
|
86
|
+
process.kill(process.pid, signal)
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
process.exit(typeof code === "number" ? code : 1)
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (require.main === module) run()
|
|
94
|
+
|
|
95
|
+
module.exports = { PACKAGE_DIR_ENV, platformPackage, resolveBinary }
|