@invinite-org/create-chartlang 0.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/chartlangVersions.d.ts +36 -0
- package/dist/chartlangVersions.d.ts.map +1 -0
- package/dist/chartlangVersions.js +45 -0
- package/dist/chartlangVersions.js.map +1 -0
- package/dist/createApp.d.ts +198 -0
- package/dist/createApp.d.ts.map +1 -0
- package/dist/createApp.js +392 -0
- package/dist/createApp.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/rewritePackageJson.d.ts +59 -0
- package/dist/rewritePackageJson.d.ts.map +1 -0
- package/dist/rewritePackageJson.js +128 -0
- package/dist/rewritePackageJson.js.map +1 -0
- package/dist/seamTemplates.d.ts +51 -0
- package/dist/seamTemplates.d.ts.map +1 -0
- package/dist/seamTemplates.js +318 -0
- package/dist/seamTemplates.js.map +1 -0
- package/dist/starterTsconfig.d.ts +54 -0
- package/dist/starterTsconfig.d.ts.map +1 -0
- package/dist/starterTsconfig.js +83 -0
- package/dist/starterTsconfig.js.map +1 -0
- package/package.json +48 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# create-chartlang
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 24946e4: Scaffolded project now installs, typechecks, builds and runs out of the box.
|
|
8
|
+
Four standalone-clone fixes: a baked standalone `tsconfig.base.json` with the
|
|
9
|
+
cloned `tsconfig.json` `extends` repointed (the old monorepo-relative
|
|
10
|
+
`../../tsconfig.base.json` broke `vite build` + `tsc`); a `.npmrc` with
|
|
11
|
+
`legacy-peer-deps=true` to clear the `vite@8` / `chartlang-compiler` esbuild
|
|
12
|
+
optional-peer conflict; the vendored adapter's `package.json` `main`/`types`/
|
|
13
|
+
`exports` repointed from `./dist/*` to `./src/*.ts` so it resolves with no
|
|
14
|
+
build step; and dropping the unused adapter-matrix chart libs
|
|
15
|
+
(`echarts`/`konva`/`lightweight-charts`/`uplot`), keeping only the chosen one.
|
|
16
|
+
|
|
17
|
+
## 0.1.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- c7fd749: New package `create-chartlang` — the `npm create chartlang@latest my-app`
|
|
22
|
+
installer. It clones the `apps/react-starter` TanStack Start starter from
|
|
23
|
+
GitHub, prompts for a chart library (default echarts, or
|
|
24
|
+
lightweight-charts / uplot / konva / canvas2d), vendors the chosen adapter
|
|
25
|
+
from the CLI's offline `BUNDLED_ADAPTERS`, rewrites the single
|
|
26
|
+
`activeAdapter.ts` seam + the `package.json` workspace deps to published
|
|
27
|
+
versions, writes a `.env`, and prints next steps. Flags: `[dir]`,
|
|
28
|
+
`--library <id>`, `--pm <npm|pnpm|yarn|bun>`, `--no-install`, `--yes`. Only
|
|
29
|
+
the GitHub clone + optional install touch the network; adapter vendoring +
|
|
30
|
+
seam rewrite are offline. The emitted seam for every library is
|
|
31
|
+
byte-identical to the matrix-proven `SEAM_VARIANTS` (guarded by a parity
|
|
32
|
+
test).
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [a165b3b]
|
|
37
|
+
- Updated dependencies [c7fd749]
|
|
38
|
+
- @invinite-org/chartlang-cli@1.3.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Invinite
|
|
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,68 @@
|
|
|
1
|
+
# @invinite-org/create-chartlang
|
|
2
|
+
|
|
3
|
+
> **Stability: experimental.**
|
|
4
|
+
|
|
5
|
+
The `npm create @invinite-org/chartlang` installer — scaffold a runnable chartlang starter
|
|
6
|
+
app (TanStack Start editor + live chart + EODData + SQLite) with your chosen
|
|
7
|
+
chart library wired in.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm create @invinite-org/chartlang@latest my-app
|
|
13
|
+
# or: pnpm create @invinite-org/chartlang my-app · npx @invinite-org/create-chartlang my-app
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
It clones `apps/react-starter` from GitHub, prompts for a chart library
|
|
17
|
+
(default **echarts**), vendors the chosen adapter from the CLI's offline
|
|
18
|
+
bundle, rewrites the single `activeAdapter.ts` seam + the `package.json`
|
|
19
|
+
workspace deps, writes a `.env`, and (optionally) installs.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
create-chartlang [dir] [--library <id>] [--pm <npm|pnpm|yarn|bun>] [--no-install] [--yes]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- `dir` — target directory (default `./chartlang-starter`).
|
|
26
|
+
- `--library <id>` — `echarts` (default) · `lightweight-charts` · `uplot` ·
|
|
27
|
+
`konva` · `canvas2d`. Skips the prompt.
|
|
28
|
+
- `--pm` — package manager for the install + printed next steps.
|
|
29
|
+
- `--no-install` — skip the dependency install.
|
|
30
|
+
- `--yes` — accept defaults and overwrite a non-empty target dir.
|
|
31
|
+
|
|
32
|
+
## Public surface
|
|
33
|
+
|
|
34
|
+
The installer is also importable for programmatic scaffolding / testing:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add @invinite-org/create-chartlang
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { runCreateChartlang, defaultDeps } from "@invinite-org/create-chartlang";
|
|
42
|
+
|
|
43
|
+
await runCreateChartlang(["my-app", "--library", "echarts"], defaultDeps({
|
|
44
|
+
cloneStarter: async () => {/* clone the starter tree */},
|
|
45
|
+
runInstall: async () => {/* run the package install */},
|
|
46
|
+
}));
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`runCreateChartlang(argv, deps)` runs the flow against an injectable IO seam
|
|
50
|
+
(`CreateChartlangDeps`); the network clone + install are injected so the rest
|
|
51
|
+
is offline + testable. Also exported: `seamTemplateFor`,
|
|
52
|
+
`rewriteStarterPackageJson`, `bundleChartlangVersions`, `resolveAdapter`,
|
|
53
|
+
`CHARTLANG_VERSIONS`, `STARTER_CLONE_REF`.
|
|
54
|
+
|
|
55
|
+
## Switching libraries later
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx @invinite-org/chartlang-cli add-adapter <id>
|
|
59
|
+
# then edit src/lib/chart/activeAdapter.ts
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Docs
|
|
63
|
+
|
|
64
|
+
See <https://chartlang.invinite.com> for the full starter guide.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The git ref (`giget` source suffix) the installer clones the starter from.
|
|
3
|
+
* A single release-time pin point: a published `create-chartlang@x.y.z`
|
|
4
|
+
* should clone the matching tagged starter so a given installer release
|
|
5
|
+
* always produces a self-consistent project. `#main` until the first tagged
|
|
6
|
+
* release; the release pipeline bumps it.
|
|
7
|
+
*
|
|
8
|
+
* @since 0.1
|
|
9
|
+
* @experimental
|
|
10
|
+
* @example
|
|
11
|
+
* import { STARTER_CLONE_REF } from "@invinite-org/create-chartlang";
|
|
12
|
+
* const source = `github:outraday-org/chartlang/apps/react-starter${STARTER_CLONE_REF}`;
|
|
13
|
+
* void source;
|
|
14
|
+
*/
|
|
15
|
+
export declare const STARTER_CLONE_REF = "#main";
|
|
16
|
+
/**
|
|
17
|
+
* Published `^`-ranges for every `@invinite-org/chartlang-*` package the
|
|
18
|
+
* cloned starter can reference. The installer rewrites the starter's
|
|
19
|
+
* `workspace:*` chartlang deps to real ranges: it prefers the vendored
|
|
20
|
+
* adapter bundle's own (generator-pinned) dep map, then falls back to this
|
|
21
|
+
* baked manifest for packages the bundle does not list (e.g. the editor +
|
|
22
|
+
* language-service the starter's UI imports but no adapter depends on).
|
|
23
|
+
*
|
|
24
|
+
* Maintenance: bump an entry whenever the matching package publishes a new
|
|
25
|
+
* minor/major and the starter should track it. See
|
|
26
|
+
* `packages/create-chartlang/CLAUDE.md`.
|
|
27
|
+
*
|
|
28
|
+
* @since 0.1
|
|
29
|
+
* @stable
|
|
30
|
+
* @example
|
|
31
|
+
* import { CHARTLANG_VERSIONS } from "@invinite-org/create-chartlang";
|
|
32
|
+
* const range = CHARTLANG_VERSIONS["@invinite-org/chartlang-editor"];
|
|
33
|
+
* void range;
|
|
34
|
+
*/
|
|
35
|
+
export declare const CHARTLANG_VERSIONS: Readonly<Record<string, string>>;
|
|
36
|
+
//# sourceMappingURL=chartlangVersions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartlangVersions.d.ts","sourceRoot":"","sources":["../src/chartlangVersions.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright (c) 2026 Invinite. Licensed under the MIT License.
|
|
2
|
+
// See the LICENSE file in the repo root for full license text.
|
|
3
|
+
/**
|
|
4
|
+
* The git ref (`giget` source suffix) the installer clones the starter from.
|
|
5
|
+
* A single release-time pin point: a published `create-chartlang@x.y.z`
|
|
6
|
+
* should clone the matching tagged starter so a given installer release
|
|
7
|
+
* always produces a self-consistent project. `#main` until the first tagged
|
|
8
|
+
* release; the release pipeline bumps it.
|
|
9
|
+
*
|
|
10
|
+
* @since 0.1
|
|
11
|
+
* @experimental
|
|
12
|
+
* @example
|
|
13
|
+
* import { STARTER_CLONE_REF } from "@invinite-org/create-chartlang";
|
|
14
|
+
* const source = `github:outraday-org/chartlang/apps/react-starter${STARTER_CLONE_REF}`;
|
|
15
|
+
* void source;
|
|
16
|
+
*/
|
|
17
|
+
export const STARTER_CLONE_REF = "#main";
|
|
18
|
+
/**
|
|
19
|
+
* Published `^`-ranges for every `@invinite-org/chartlang-*` package the
|
|
20
|
+
* cloned starter can reference. The installer rewrites the starter's
|
|
21
|
+
* `workspace:*` chartlang deps to real ranges: it prefers the vendored
|
|
22
|
+
* adapter bundle's own (generator-pinned) dep map, then falls back to this
|
|
23
|
+
* baked manifest for packages the bundle does not list (e.g. the editor +
|
|
24
|
+
* language-service the starter's UI imports but no adapter depends on).
|
|
25
|
+
*
|
|
26
|
+
* Maintenance: bump an entry whenever the matching package publishes a new
|
|
27
|
+
* minor/major and the starter should track it. See
|
|
28
|
+
* `packages/create-chartlang/CLAUDE.md`.
|
|
29
|
+
*
|
|
30
|
+
* @since 0.1
|
|
31
|
+
* @stable
|
|
32
|
+
* @example
|
|
33
|
+
* import { CHARTLANG_VERSIONS } from "@invinite-org/create-chartlang";
|
|
34
|
+
* const range = CHARTLANG_VERSIONS["@invinite-org/chartlang-editor"];
|
|
35
|
+
* void range;
|
|
36
|
+
*/
|
|
37
|
+
export const CHARTLANG_VERSIONS = {
|
|
38
|
+
"@invinite-org/chartlang-adapter-kit": "^1.3.0",
|
|
39
|
+
"@invinite-org/chartlang-compiler": "^1.3.0",
|
|
40
|
+
"@invinite-org/chartlang-core": "^1.2.0",
|
|
41
|
+
"@invinite-org/chartlang-editor": "^2.1.3",
|
|
42
|
+
"@invinite-org/chartlang-host-worker": "^1.2.0",
|
|
43
|
+
"@invinite-org/chartlang-language-service": "^1.4.2",
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chartlangVersions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartlangVersions.js","sourceRoot":"","sources":["../src/chartlangVersions.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAqC;IAChE,qCAAqC,EAAE,QAAQ;IAC/C,kCAAkC,EAAE,QAAQ;IAC5C,8BAA8B,EAAE,QAAQ;IACxC,gCAAgC,EAAE,QAAQ;IAC1C,qCAAqC,EAAE,QAAQ;IAC/C,0CAA0C,EAAE,QAAQ;CACvD,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * The git ref (`giget` source suffix) the installer clones the starter from.\n * A single release-time pin point: a published `create-chartlang@x.y.z`\n * should clone the matching tagged starter so a given installer release\n * always produces a self-consistent project. `#main` until the first tagged\n * release; the release pipeline bumps it.\n *\n * @since 0.1\n * @experimental\n * @example\n * import { STARTER_CLONE_REF } from \"@invinite-org/create-chartlang\";\n * const source = `github:outraday-org/chartlang/apps/react-starter${STARTER_CLONE_REF}`;\n * void source;\n */\nexport const STARTER_CLONE_REF = \"#main\";\n\n/**\n * Published `^`-ranges for every `@invinite-org/chartlang-*` package the\n * cloned starter can reference. The installer rewrites the starter's\n * `workspace:*` chartlang deps to real ranges: it prefers the vendored\n * adapter bundle's own (generator-pinned) dep map, then falls back to this\n * baked manifest for packages the bundle does not list (e.g. the editor +\n * language-service the starter's UI imports but no adapter depends on).\n *\n * Maintenance: bump an entry whenever the matching package publishes a new\n * minor/major and the starter should track it. See\n * `packages/create-chartlang/CLAUDE.md`.\n *\n * @since 0.1\n * @stable\n * @example\n * import { CHARTLANG_VERSIONS } from \"@invinite-org/create-chartlang\";\n * const range = CHARTLANG_VERSIONS[\"@invinite-org/chartlang-editor\"];\n * void range;\n */\nexport const CHARTLANG_VERSIONS: Readonly<Record<string, string>> = {\n \"@invinite-org/chartlang-adapter-kit\": \"^1.3.0\",\n \"@invinite-org/chartlang-compiler\": \"^1.3.0\",\n \"@invinite-org/chartlang-core\": \"^1.2.0\",\n \"@invinite-org/chartlang-editor\": \"^2.1.3\",\n \"@invinite-org/chartlang-host-worker\": \"^1.2.0\",\n \"@invinite-org/chartlang-language-service\": \"^1.4.2\",\n};\n"]}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { type GeneratedAdapterBundle, type GeneratedAdapterMeta } from "@invinite-org/chartlang-cli";
|
|
2
|
+
declare const PACKAGE_MANAGERS: readonly ["npm", "pnpm", "yarn", "bun"];
|
|
3
|
+
type PackageManager = (typeof PACKAGE_MANAGERS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* The starter source giget clones, minus the ref suffix. The installer
|
|
6
|
+
* appends {@link STARTER_CLONE_REF} to pin the matching tagged tree.
|
|
7
|
+
*
|
|
8
|
+
* @since 0.1
|
|
9
|
+
* @stable
|
|
10
|
+
* @example
|
|
11
|
+
* import { STARTER_SOURCE_BASE } from "@invinite-org/create-chartlang";
|
|
12
|
+
* void STARTER_SOURCE_BASE;
|
|
13
|
+
*/
|
|
14
|
+
export declare const STARTER_SOURCE_BASE = "github:outraday-org/chartlang/apps/react-starter";
|
|
15
|
+
/**
|
|
16
|
+
* A minimal `node:readline/promises`-like surface — the subset the
|
|
17
|
+
* interactive library prompt needs. Lets a test inject a fixed answer
|
|
18
|
+
* instead of driving the real TTY. Mirrors the CLI's `Prompter`.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1
|
|
21
|
+
* @stable
|
|
22
|
+
* @example
|
|
23
|
+
* import type { Prompter } from "@invinite-org/create-chartlang";
|
|
24
|
+
* const p: Prompter = { question: async () => "echarts", close: () => {} };
|
|
25
|
+
* void p;
|
|
26
|
+
*/
|
|
27
|
+
export type Prompter = {
|
|
28
|
+
question(query: string): Promise<string>;
|
|
29
|
+
close(): void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Where + how to clone the starter. Passed to a {@link CloneStarter} so the
|
|
33
|
+
* caller (or a test) decides the implementation — production wires giget's
|
|
34
|
+
* `downloadTemplate`; tests write a fixture tree.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.1
|
|
37
|
+
* @stable
|
|
38
|
+
* @example
|
|
39
|
+
* import type { CloneRequest } from "@invinite-org/create-chartlang";
|
|
40
|
+
* declare const req: CloneRequest;
|
|
41
|
+
* void req.dir;
|
|
42
|
+
*/
|
|
43
|
+
export type CloneRequest = Readonly<{
|
|
44
|
+
/** The giget source (`STARTER_SOURCE_BASE` + `STARTER_CLONE_REF`). */
|
|
45
|
+
source: string;
|
|
46
|
+
/** The absolute target directory to clone into. */
|
|
47
|
+
dir: string;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Clone the starter tree into `req.dir`. Injected so the network clone stays
|
|
51
|
+
* out of the unit tests (the only networked step in the flow).
|
|
52
|
+
*
|
|
53
|
+
* @since 0.1
|
|
54
|
+
* @stable
|
|
55
|
+
* @example
|
|
56
|
+
* import type { CloneStarter } from "@invinite-org/create-chartlang";
|
|
57
|
+
* const clone: CloneStarter = async () => {};
|
|
58
|
+
* void clone;
|
|
59
|
+
*/
|
|
60
|
+
export type CloneStarter = (req: CloneRequest) => Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* The injectable IO seam for {@link runCreateChartlang} — output streams,
|
|
63
|
+
* whether stdin is a TTY (gates the interactive prompt), a prompter factory,
|
|
64
|
+
* the clone implementation, and the install runner. Tests override every
|
|
65
|
+
* field so the flow runs offline with no real stdin/network.
|
|
66
|
+
*
|
|
67
|
+
* @since 0.1
|
|
68
|
+
* @stable
|
|
69
|
+
* @example
|
|
70
|
+
* import type { CreateChartlangDeps } from "@invinite-org/create-chartlang";
|
|
71
|
+
* declare const deps: CreateChartlangDeps;
|
|
72
|
+
* void deps.isTTY;
|
|
73
|
+
*/
|
|
74
|
+
export type CreateChartlangDeps = Readonly<{
|
|
75
|
+
stdout: NodeJS.WritableStream;
|
|
76
|
+
stderr: NodeJS.WritableStream;
|
|
77
|
+
isTTY: boolean;
|
|
78
|
+
createPrompter: () => Prompter;
|
|
79
|
+
cloneStarter: CloneStarter;
|
|
80
|
+
runInstall: (pm: PackageManager, dir: string) => Promise<void>;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* A resolved adapter: its offline bundle + its registry metadata, the pair
|
|
84
|
+
* {@link resolveAdapter} returns for a bundled id.
|
|
85
|
+
*
|
|
86
|
+
* @since 0.1
|
|
87
|
+
* @stable
|
|
88
|
+
* @example
|
|
89
|
+
* import type { ResolvedAdapter } from "@invinite-org/create-chartlang";
|
|
90
|
+
* declare const r: ResolvedAdapter;
|
|
91
|
+
* void r.bundle.id;
|
|
92
|
+
*/
|
|
93
|
+
export type ResolvedAdapter = Readonly<{
|
|
94
|
+
bundle: GeneratedAdapterBundle;
|
|
95
|
+
meta: GeneratedAdapterMeta;
|
|
96
|
+
}>;
|
|
97
|
+
/**
|
|
98
|
+
* Look up an adapter's bundle + registry metadata by id, throwing if either is
|
|
99
|
+
* missing. The `runCreateChartlang` flow only calls this with an `isSeamId`-
|
|
100
|
+
* validated id (so it never throws in production), but the guard fails loudly
|
|
101
|
+
* if `SEAM_IDS` ever drifts from the generated bundle/registry set.
|
|
102
|
+
*
|
|
103
|
+
* @since 0.1
|
|
104
|
+
* @stable
|
|
105
|
+
* @example
|
|
106
|
+
* import { resolveAdapter } from "@invinite-org/create-chartlang";
|
|
107
|
+
* const { bundle, meta } = resolveAdapter("echarts");
|
|
108
|
+
* void bundle.id;
|
|
109
|
+
* void meta.library;
|
|
110
|
+
*/
|
|
111
|
+
export declare function resolveAdapter(id: string): ResolvedAdapter;
|
|
112
|
+
/**
|
|
113
|
+
* Render the library-choice prompt list from the registry, echarts first
|
|
114
|
+
* (the default) then the rest in registry order. Pure: no IO.
|
|
115
|
+
*
|
|
116
|
+
* @since 0.1
|
|
117
|
+
* @stable
|
|
118
|
+
* @example
|
|
119
|
+
* import { renderLibraryChoices } from "@invinite-org/create-chartlang";
|
|
120
|
+
* const text = renderLibraryChoices([]);
|
|
121
|
+
* void text;
|
|
122
|
+
*/
|
|
123
|
+
export declare function renderLibraryChoices(registry: ReadonlyArray<GeneratedAdapterMeta>): string;
|
|
124
|
+
/**
|
|
125
|
+
* Harvest the published `@invinite-org/chartlang-*` `^`-ranges from a bundle's
|
|
126
|
+
* own (generator-pinned) `package.json` deps + devDeps. These take precedence
|
|
127
|
+
* over the baked manifest when rewriting the starter's workspace deps.
|
|
128
|
+
*
|
|
129
|
+
* @since 0.1
|
|
130
|
+
* @stable
|
|
131
|
+
* @example
|
|
132
|
+
* import { bundleChartlangVersions } from "@invinite-org/create-chartlang";
|
|
133
|
+
* const map = bundleChartlangVersions({ id: "x", files: {} });
|
|
134
|
+
* void map;
|
|
135
|
+
*/
|
|
136
|
+
export declare function bundleChartlangVersions(bundle: GeneratedAdapterBundle): Readonly<Record<string, string>>;
|
|
137
|
+
/**
|
|
138
|
+
* Rewrite the vendored adapter `package.json`: substitute the `__PKG_NAME__`
|
|
139
|
+
* placeholder, then repoint `main`/`types` and every `exports` entry's
|
|
140
|
+
* `types`/`import` from `./dist/*` to the vendored `./src/*.ts` source. This is
|
|
141
|
+
* an intentional DIVERGENCE from `cli add-adapter`, which keeps the
|
|
142
|
+
* dist-pointing bundle (it expects a build); create-chartlang vendors source
|
|
143
|
+
* only and never builds, so the manifest must resolve straight from `src/`.
|
|
144
|
+
* Absent fields are left untouched.
|
|
145
|
+
*
|
|
146
|
+
* @since 0.1
|
|
147
|
+
* @stable
|
|
148
|
+
* @example
|
|
149
|
+
* import { repointVendoredPackageJson } from "@invinite-org/create-chartlang";
|
|
150
|
+
* const next = repointVendoredPackageJson('{"main":"./dist/index.js"}', "@local/x-adapter");
|
|
151
|
+
* void next;
|
|
152
|
+
*/
|
|
153
|
+
export declare function repointVendoredPackageJson(contents: string, localName: string): string;
|
|
154
|
+
/**
|
|
155
|
+
* The production IO seam — real process streams, a `node:readline/promises`
|
|
156
|
+
* prompter, a giget-backed clone, and a child-process install. The
|
|
157
|
+
* `cloneStarter` argument is injected (giget lives in `index.ts`) so this
|
|
158
|
+
* module carries no network dependency.
|
|
159
|
+
*
|
|
160
|
+
* @since 0.1
|
|
161
|
+
* @stable
|
|
162
|
+
* @example
|
|
163
|
+
* import { defaultDeps } from "@invinite-org/create-chartlang";
|
|
164
|
+
* const deps = defaultDeps({
|
|
165
|
+
* cloneStarter: async () => {},
|
|
166
|
+
* runInstall: async () => {},
|
|
167
|
+
* });
|
|
168
|
+
* deps.createPrompter().close();
|
|
169
|
+
*/
|
|
170
|
+
export declare function defaultDeps(io: Readonly<{
|
|
171
|
+
cloneStarter: CloneStarter;
|
|
172
|
+
runInstall: CreateChartlangDeps["runInstall"];
|
|
173
|
+
}>): CreateChartlangDeps;
|
|
174
|
+
/**
|
|
175
|
+
* Scaffold a runnable chartlang starter: clone `apps/react-starter` from
|
|
176
|
+
* GitHub (the one networked step), prompt for a chart library (default
|
|
177
|
+
* echarts), vendor the chosen adapter from the CLI's offline bundle, rewrite
|
|
178
|
+
* the single `activeAdapter.ts` seam + the `package.json` workspace deps, strip
|
|
179
|
+
* repo-internal artefacts, write `.env`, optionally install, and print next
|
|
180
|
+
* steps. Sets `process.exitCode = 1` on an unknown library or a non-empty
|
|
181
|
+
* target dir without `--yes`.
|
|
182
|
+
*
|
|
183
|
+
* Flags: `[dir]` (default `./chartlang-starter`), `--library <id>`,
|
|
184
|
+
* `--pm <npm|pnpm|yarn|bun>`, `--no-install`, `--yes` (accept defaults +
|
|
185
|
+
* overwrite a non-empty dir).
|
|
186
|
+
*
|
|
187
|
+
* @since 0.1
|
|
188
|
+
* @stable
|
|
189
|
+
* @example
|
|
190
|
+
* import { runCreateChartlang, defaultDeps } from "@invinite-org/create-chartlang";
|
|
191
|
+
* await runCreateChartlang(["my-app", "--library", "echarts"], defaultDeps({
|
|
192
|
+
* cloneStarter: async () => {},
|
|
193
|
+
* runInstall: async () => {},
|
|
194
|
+
* }));
|
|
195
|
+
*/
|
|
196
|
+
export declare function runCreateChartlang(argv: ReadonlyArray<string>, deps: CreateChartlangDeps): Promise<void>;
|
|
197
|
+
export {};
|
|
198
|
+
//# sourceMappingURL=createApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApp.d.ts","sourceRoot":"","sources":["../src/createApp.ts"],"names":[],"mappings":"AAQA,OAAO,EAGH,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC5B,MAAM,6BAA6B,CAAC;AASrC,QAAA,MAAM,gBAAgB,yCAA0C,CAAC;AACjE,KAAK,cAAc,GAAG,CAAC,OAAO,gBAA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