create-pincast 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pincast, 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,3 +1,59 @@
1
- # Temporary Holding Version
1
+ # create-pincast
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ One command gets you a working Placecard app with its own test key, and you don't need an account to run it.
4
+
5
+ ```sh
6
+ npm create pincast my-app
7
+ ```
8
+
9
+ You need Node 20.12 or later. The folder has to be new or empty. Leave its name off and the app goes in `pincast-app`.
10
+
11
+ ## What it does
12
+
13
+ 1. Copies a small starter app, Lantern Walk. It comes inside `@pincast/cli`, the one package this one installs, so nothing is downloaded from GitHub. That package's `template.json` records the commit it came from.
14
+ 2. Asks Pincast for one test app.
15
+ 3. Writes your key to `.env`, which only your account can read and git ignores, along with the test person `test_demo` and your claim link.
16
+ 4. Puts the new app's id in `shared/app.js`.
17
+ 5. Sends the starter's set and one collect for `test_demo`, so the app's first screen shows a real card.
18
+ 6. Prints the claim link and the commands that start the app.
19
+
20
+ The command never prints your key.
21
+
22
+ ## Your test app
23
+
24
+ A test key writes only to its own app, and only for test people, whose ids start with `test_`. A test app is never listed and never counts toward anything public.
25
+
26
+ It ends after a few days unless you claim it, and the command prints the exact date. To keep it, open the claim link while signed in to Pincast. The link works once, and it's saved in `.env` as `PINCAST_CLAIM_URL` in case you close the terminal.
27
+
28
+ ## If something goes wrong
29
+
30
+ Each call to make an app makes a new one, so the command never repeats that call by itself. If the answer gets lost on the way back, it tells you and stops. Any app made that way has no key anyone can use, and it ends on its own, so you can run the command again.
31
+
32
+ Pincast limits how many test apps it makes. If you reach a limit, the command tells you how long to wait.
33
+
34
+ If the set or the collect doesn't go through, you still get your app. The command says which one is missing and prints the commands that send it.
35
+
36
+ ## Working on this package
37
+
38
+ From 0.2.0 on, this package is a shim. The command's code, its starter app and its text are in `@pincast/cli`, and the `pincast init` command there runs the same code. This package gives it the name `npm create pincast`, and depends on one exact version of `@pincast/cli`.
39
+
40
+ ```sh
41
+ npm install
42
+ npm test
43
+ ```
44
+
45
+ The tests run against a local stand-in for the API and never reach Pincast. Set `PINCAST_CREATE_API` to point the command at another address.
46
+
47
+ To move the starter to a newer commit of the example app, sync it in `@pincast/cli` and release that, then move this package's pin to the new version. [RELEASING.md](RELEASING.md) has the steps, and [CHANGELOG.md](CHANGELOG.md) lists what each release changed.
48
+
49
+ ## Versions
50
+
51
+ - **Patch** (0.2.0 to 0.2.1): a fix, or a change a script can't see, such as clearer text.
52
+ - **Minor** (0.2.1 to 0.3.0): something new, and everything that worked still works.
53
+ - **Major** (0.3.0 to 1.0.0): something that worked can stop working, such as an exit code that changes meaning or a higher lowest Node version.
54
+
55
+ A release that moves the `@pincast/cli` pin takes the larger of the two changes. While the version starts with 0, a range like `^0.2.0` takes patches only.
56
+
57
+ ## License
58
+
59
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../src/cli.js'
3
+
4
+ // Node's default crash report prints the error's message and source. Neither may ever carry a key.
5
+ const crash = () => {
6
+ process.stderr.write('Something went wrong. No key was printed. Run the command again in a new or empty folder.\n')
7
+ process.exit(1)
8
+ }
9
+ process.on('uncaughtException', crash)
10
+ process.on('unhandledRejection', crash)
11
+
12
+ run(process.argv.slice(2)).then((code) => { process.exitCode = code }, crash)
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "create-pincast",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "One command to a working Placecard app with its own test key.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/pincastFM/create-pincast.git"
9
+ },
10
+ "homepage": "https://github.com/pincastFM/create-pincast#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/pincastFM/create-pincast/issues"
13
+ },
14
+ "type": "module",
15
+ "bin": {
16
+ "create-pincast": "bin/create-pincast.js"
17
+ },
18
+ "files": [
19
+ "bin",
20
+ "src"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public",
24
+ "registry": "https://registry.npmjs.org"
25
+ },
26
+ "engines": {
27
+ "node": ">=20.12"
28
+ },
29
+ "dependencies": {
30
+ "@pincast/cli": "0.1.0"
31
+ },
32
+ "scripts": {
33
+ "test": "node --test test/*.test.js",
34
+ "link-cli": "node scripts/link-cli.mjs",
35
+ "changelog": "node scripts/changelog.mjs"
36
+ },
37
+ "keywords": [
38
+ "pincast",
39
+ "placecard",
40
+ "create"
41
+ ]
42
+ }
package/src/cli.js ADDED
@@ -0,0 +1,7 @@
1
+ // create-pincast is a shim from 0.2.0 on. The whole command, with its text and its exit codes, lives in
2
+ // @pincast/cli, whose `pincast init` runs the same code. This file gives it this package's name.
3
+ import { runCreate } from '@pincast/cli/init'
4
+ import { COMMAND, PACKAGE_NAME } from './name.js'
5
+
6
+ /** Runs the command and answers its exit code. Nothing here prints an error's own message. */
7
+ export const run = (argv, options = {}) => runCreate(argv, { command: COMMAND, userAgent: PACKAGE_NAME, ...options })
package/src/name.js ADDED
@@ -0,0 +1,7 @@
1
+ // The one place the package's name lives. package.json has to spell it too, and a test holds the two
2
+ // together. The command's text follows from it: create-x runs as `npm create x`, a scoped name with npx.
3
+ export const PACKAGE_NAME = 'create-pincast'
4
+
5
+ export const COMMAND = PACKAGE_NAME.startsWith('@')
6
+ ? `npx ${PACKAGE_NAME}`
7
+ : `npm create ${PACKAGE_NAME.replace(/^create-/, '')}`