protoyard 0.0.0 → 1.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dailybot, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,11 +1,22 @@
1
1
  # protoyard
2
2
 
3
- **Protoyard: build prototypes that feel real.** Real behavior. Fake infrastructure.
3
+ The Protoyard command line under its short name. `protoyard` is a thin
4
+ wrapper that runs [`@protoyard/cli`](../cli/README.md) at exactly the same
5
+ version (lockstep, [ADR-028](../../docs/DECISIONS.md)):
4
6
 
5
- This `0.0.0` version only reserves the package name. The first npm release is
6
- in preparation. Until then, use Protoyard from its repository:
7
+ ```bash
8
+ npx protoyard --version
9
+ npx protoyard doctor --json
10
+ npm install --save-dev protoyard # then: npx protoyard <command>
11
+ ```
7
12
 
8
- - Live showcase: https://protoyard.app
9
- - Source and docs: https://github.com/DailybotHQ/protoyard
13
+ Every command, flag and `--json` envelope is the CLI's own. The wrapper loads
14
+ `@protoyard/cli` in the same process, so arguments, standard input and output,
15
+ signals and the exit code pass through unchanged. If `@protoyard/cli` is
16
+ missing, the wrapper says so and exits 1.
10
17
 
11
- MIT © Dailybot, Inc.
18
+ Inside the Protoyard repository, use `pnpm protoyard <command>`. That root
19
+ script runs the CLI from source, and no workspace package installs a second
20
+ `protoyard` bin.
21
+
22
+ See the [Protoyard documentation](https://protoyard.app/docs/) for the commands.
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ // `protoyard` (unscoped): hand over to @protoyard/cli in this same process,
3
+ // so argv, stdin/stdout/stderr, signals and the exit code are the CLI's own.
4
+ import { pathToFileURL } from 'node:url';
5
+ import { resolveCliBin } from '../index.js';
6
+
7
+ let bin;
8
+ try {
9
+ bin = resolveCliBin();
10
+ } catch (error) {
11
+ process.stderr.write(`protoyard: ${error instanceof Error ? error.message : String(error)}\n`);
12
+ process.exit(1);
13
+ }
14
+ await import(pathToFileURL(bin).href);
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The absolute path of the installed @protoyard/cli executable (its
3
+ * package.json `bin.protoyard`). `entry` is the resolved @protoyard/cli
4
+ * module; by default it is resolved from this package.
5
+ */
6
+ export declare function resolveCliBin(entry?: string): string;
package/index.js ADDED
@@ -0,0 +1,55 @@
1
+ // @ts-check
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const CLI = '@protoyard/cli';
7
+
8
+ /**
9
+ * @protoyard/cli exports only its API (and only the `import` condition when
10
+ * packed), so its manifest is found from the resolved entry: walk up to the
11
+ * package.json named @protoyard/cli, then read its `bin.protoyard`. That is
12
+ * ./bin/protoyard.mjs in this repository and ./dist/bin.js when installed.
13
+ *
14
+ * @param {string} [entry]
15
+ * @returns {string}
16
+ */
17
+ export function resolveCliBin(entry) {
18
+ let resolved = entry;
19
+ if (!resolved) {
20
+ try {
21
+ resolved = fileURLToPath(import.meta.resolve(CLI));
22
+ } catch {
23
+ throw new Error(
24
+ `${CLI} is not installed next to protoyard. Reinstall protoyard (npm install protoyard), or run npx protoyard.`
25
+ );
26
+ }
27
+ }
28
+ for (let dir = dirname(resolved); ; dir = dirname(dir)) {
29
+ const manifestPath = join(dir, 'package.json');
30
+ if (existsSync(manifestPath)) {
31
+ /** @type {{ name?: unknown, bin?: unknown }} */
32
+ let manifest = {};
33
+ try {
34
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
35
+ } catch {
36
+ // unreadable manifest: keep walking
37
+ }
38
+ if (manifest.name === CLI) {
39
+ const bin =
40
+ typeof manifest.bin === 'string'
41
+ ? manifest.bin
42
+ : manifest.bin && typeof manifest.bin === 'object'
43
+ ? /** @type {Record<string, unknown>} */ (manifest.bin).protoyard
44
+ : undefined;
45
+ if (typeof bin !== 'string') throw new Error(`${manifestPath} declares no protoyard bin.`);
46
+ const path = resolve(dir, bin);
47
+ if (!path.startsWith(`${dir}/`) && !path.startsWith(`${dir}\\`)) {
48
+ throw new Error(`${manifestPath} points its bin outside the package.`);
49
+ }
50
+ return path;
51
+ }
52
+ }
53
+ if (dirname(dir) === dir) throw new Error(`No ${CLI} package.json above ${resolved}.`);
54
+ }
55
+ }
package/package.json CHANGED
@@ -1,12 +1,47 @@
1
1
  {
2
2
  "name": "protoyard",
3
- "version": "0.0.0",
4
- "description": "Protoyard: build prototypes that feel real. Real behavior. Fake infrastructure. This version only reserves the name; the first release is coming.",
5
- "homepage": "https://protoyard.app",
6
- "repository": { "type": "git", "url": "git+https://github.com/DailybotHQ/protoyard.git" },
7
- "bugs": { "url": "https://github.com/DailybotHQ/protoyard/issues" },
3
+ "version": "1.1.1",
4
+ "description": "The protoyard command line under its short name: `npx protoyard` runs @protoyard/cli at the same version.",
8
5
  "license": "MIT",
9
- "author": "Dailybot, Inc.",
10
- "keywords": ["prototype", "prototyping", "svelte", "vite", "mock-data", "agents"],
11
- "files": ["README.md"]
12
- }
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "homepage": "https://protoyard.app",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/DailybotHQ/protoyard.git",
12
+ "directory": "packages/protoyard"
13
+ },
14
+ "keywords": [
15
+ "protoyard",
16
+ "prototype",
17
+ "cli"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./index.d.ts",
22
+ "default": "./index.js"
23
+ }
24
+ },
25
+ "bin": {
26
+ "protoyard": "./bin/protoyard.mjs"
27
+ },
28
+ "files": [
29
+ "LICENSE",
30
+ "bin",
31
+ "index.js",
32
+ "index.d.ts",
33
+ "README.md"
34
+ ],
35
+ "dependencies": {
36
+ "@protoyard/cli": "1.1.1"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "engines": {
42
+ "node": ">=24.20.0"
43
+ },
44
+ "scripts": {
45
+ "typecheck": "tsc -p tsconfig.json"
46
+ }
47
+ }