@iwsdk/create 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -0
  3. package/dist/cli.js +17313 -0
  4. package/package.json +51 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Meta Platforms, Inc. and affiliates.
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 ADDED
@@ -0,0 +1,42 @@
1
+ # @iwsdk/create
2
+
3
+ Interactive CLI to scaffold Immersive Web SDK starter apps. Intended to be invoked via:
4
+
5
+ - `npm create @iwsdk@latest`
6
+ - `pnpm dlx @iwsdk/create@latest`
7
+
8
+ This package is CLI-only: no programmatic API exports. TypeScript sources live in `src/` and are bundled to `dist/` with Rollup.
9
+
10
+ The CLI uses @pmndrs/chef to apply recipes fetched from the CDN (no local fallback). Recipes live at:
11
+
12
+ - `${ASSETS_BASE}/recipes/index.json` (default base: `https://iwsdk-assets.pages.dev`)
13
+ - `${ASSETS_BASE}/recipes/<variant>.recipe.json`
14
+
15
+ ## Usage (local dev)
16
+
17
+ - Build once: `pnpm --filter @iwsdk/create build`
18
+ - Watch mode: `pnpm --filter @iwsdk/create dev`
19
+
20
+ The CLI fetches recipes and assets from a public CDN by default: `https://iwsdk-assets.pages.dev`. Override with:
21
+
22
+ - `--assets-base <url>` or env `IWSDK_ASSET_BASE` (e.g., your own CDN root that serves `/recipes` and `/assets`)
23
+
24
+ Notes:
25
+
26
+ - Network required during scaffold; Chef downloads binary assets from the CDN.
27
+ - Local fallback recipes and the `run-recipe` dev helper have been removed in favor of Chef-only execution.
28
+
29
+ ## Module Layout
30
+
31
+ - `src/cli.ts` — entrypoint: parses flags, runs prompts, selects recipe, applies edits, scaffolds the project, optionally installs deps, and prints next steps.
32
+ - `src/prompts.ts` — all interactive questions and defaults.
33
+ - `src/recipes.ts` — tiny fetch helpers (`DEFAULT_ASSETS_BASE`, `fetchRecipesIndex`, `fetchRecipeByFileName`). Internal use only.
34
+ - `src/scaffold.ts` — wraps Chef’s `buildProject` and writes files to disk with status spinners.
35
+ - `src/installer.ts` — installs dependencies with npm and prints next steps.
36
+ - `src/types.ts` — shared types (`VariantId`, `TriState`, `PromptResult`).
37
+
38
+ There is no `index.ts` and no exported library API.
39
+
40
+ ## Publishing
41
+
42
+ This package is public under the `@iwsdk` scope. Ensure the version is bumped and `pnpm -r build` passes before publishing. Recipes and heavy assets are not bundled here; they live in `@iwsdk/starter-assets`.