@visulima/vis 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +90 -57
- package/LICENSE.md +44 -1
- package/README.md +56 -0
- package/dist/bin.js +1 -1003
- package/dist/config.d.ts +1073 -68
- package/dist/config.js +1 -1
- package/dist/generate/index.d.ts +155 -30
- package/dist/packem_chunks/handler.js +1 -0
- package/dist/packem_chunks/handler10.js +1 -0
- package/dist/packem_chunks/handler11.js +1 -0
- package/dist/packem_chunks/handler12.js +153 -0
- package/dist/packem_chunks/handler13.js +1 -0
- package/dist/packem_chunks/handler14.js +3 -0
- package/dist/packem_chunks/handler15.js +1 -0
- package/dist/packem_chunks/handler16.js +2 -0
- package/dist/packem_chunks/handler17.js +7 -0
- package/dist/packem_chunks/handler18.js +1 -0
- package/dist/packem_chunks/handler19.js +19 -0
- package/dist/packem_chunks/handler2.js +1 -0
- package/dist/packem_chunks/handler20.js +428 -0
- package/dist/packem_chunks/handler21.js +22 -0
- package/dist/packem_chunks/handler22.js +3 -0
- package/dist/packem_chunks/handler23.js +5 -0
- package/dist/packem_chunks/handler24.js +1 -0
- package/dist/packem_chunks/handler25.js +20 -0
- package/dist/packem_chunks/handler26.js +1 -0
- package/dist/packem_chunks/handler27.js +1 -0
- package/dist/packem_chunks/handler28.js +1 -0
- package/dist/packem_chunks/handler29.js +2 -0
- package/dist/packem_chunks/handler3.js +2 -0
- package/dist/packem_chunks/handler30.js +22 -0
- package/dist/packem_chunks/handler31.js +1 -0
- package/dist/packem_chunks/handler32.js +1 -0
- package/dist/packem_chunks/handler33.js +37 -0
- package/dist/packem_chunks/handler34.js +3 -0
- package/dist/packem_chunks/handler35.js +23 -0
- package/dist/packem_chunks/handler36.js +5 -0
- package/dist/packem_chunks/handler37.js +27 -0
- package/dist/packem_chunks/handler38.js +1 -0
- package/dist/packem_chunks/handler39.js +2 -0
- package/dist/packem_chunks/handler4.js +5 -0
- package/dist/packem_chunks/handler40.js +1 -0
- package/dist/packem_chunks/handler41.js +5 -0
- package/dist/packem_chunks/handler42.js +1 -0
- package/dist/packem_chunks/handler43.js +24 -0
- package/dist/packem_chunks/handler44.js +3 -0
- package/dist/packem_chunks/handler45.js +1 -0
- package/dist/packem_chunks/handler5.js +4 -0
- package/dist/packem_chunks/handler6.js +2 -0
- package/dist/packem_chunks/handler7.js +24 -0
- package/dist/packem_chunks/handler8.js +6 -0
- package/dist/packem_chunks/handler9.js +8 -0
- package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +1 -0
- package/dist/packem_shared/ai-analysis-DDqXRFxY.js +67 -0
- package/dist/packem_shared/bin-BaZZ32BK.js +93 -0
- package/dist/packem_shared/cache-directory-DL8hfXeG.js +1 -0
- package/dist/packem_shared/catalog-CuSpuB_R.js +12 -0
- package/dist/packem_shared/dependency-scan-BoLG2Fez.js +1 -0
- package/dist/packem_shared/docker-BcfqH4Av.js +2 -0
- package/dist/packem_shared/flakiness-DSIHZGBT.js +1 -0
- package/dist/packem_shared/otelPlugin-DxyvBcXO.js +1 -0
- package/dist/packem_shared/runtime-check-CGHal8SO.js +1 -0
- package/dist/packem_shared/selectors-CfH9ZY08.js +3 -0
- package/dist/packem_shared/symbols-CIMw60-G.js +1 -0
- package/dist/packem_shared/toolchain-C3ZG0o_X.js +5 -0
- package/dist/packem_shared/typosquats-Bpq4zcWL.js +1 -0
- package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
- package/index.js +555 -727
- package/package.json +27 -19
- package/schemas/project.schema.json +1 -1
- package/schemas/vis-config.schema.json +47 -1
- package/dist/ai-analysis.d.ts +0 -26
- package/dist/ai-cache.d.ts +0 -21
- package/dist/ai-types.d.ts +0 -16
- package/dist/audit-config.d.ts +0 -24
- package/dist/bin.d.ts +0 -1
- package/dist/cache-directory.d.ts +0 -73
- package/dist/catalog.d.ts +0 -136
- package/dist/codeowners.d.ts +0 -30
- package/dist/commands/action-graph.d.ts +0 -8
- package/dist/commands/add.d.ts +0 -3
- package/dist/commands/affected.d.ts +0 -3
- package/dist/commands/ai.d.ts +0 -3
- package/dist/commands/analyze.d.ts +0 -3
- package/dist/commands/approve-builds.d.ts +0 -3
- package/dist/commands/audit.d.ts +0 -23
- package/dist/commands/cache.d.ts +0 -86
- package/dist/commands/check.d.ts +0 -3
- package/dist/commands/ci.d.ts +0 -19
- package/dist/commands/clean.d.ts +0 -3
- package/dist/commands/create/discovery.d.ts +0 -42
- package/dist/commands/create/index.d.ts +0 -13
- package/dist/commands/create/prompts.d.ts +0 -31
- package/dist/commands/create/random-name.d.ts +0 -15
- package/dist/commands/create/templates/builtin.d.ts +0 -15
- package/dist/commands/create/templates/generator.d.ts +0 -14
- package/dist/commands/create/templates/index.d.ts +0 -13
- package/dist/commands/create/templates/monorepo.d.ts +0 -16
- package/dist/commands/create/templates/remote.d.ts +0 -41
- package/dist/commands/create/templates/types.d.ts +0 -46
- package/dist/commands/create/utils.d.ts +0 -42
- package/dist/commands/dedupe.d.ts +0 -3
- package/dist/commands/devcontainer.d.ts +0 -3
- package/dist/commands/dlx.d.ts +0 -3
- package/dist/commands/docker.d.ts +0 -22
- package/dist/commands/doctor.d.ts +0 -15
- package/dist/commands/exec.d.ts +0 -3
- package/dist/commands/generate.d.ts +0 -10
- package/dist/commands/graph.d.ts +0 -3
- package/dist/commands/hook/constants.d.ts +0 -13
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/list.d.ts +0 -28
- package/dist/commands/hook/migrate.d.ts +0 -30
- package/dist/commands/hook/prek-builtins.d.ts +0 -8
- package/dist/commands/hook/prek.d.ts +0 -129
- package/dist/commands/hook/run.d.ts +0 -21
- package/dist/commands/hook/uninstall.d.ts +0 -3
- package/dist/commands/hook/validate.d.ts +0 -17
- package/dist/commands/ignore-helpers.d.ts +0 -157
- package/dist/commands/ignore.d.ts +0 -17
- package/dist/commands/implode.d.ts +0 -3
- package/dist/commands/info.d.ts +0 -3
- package/dist/commands/init.d.ts +0 -14
- package/dist/commands/install.d.ts +0 -3
- package/dist/commands/link.d.ts +0 -3
- package/dist/commands/list.d.ts +0 -3
- package/dist/commands/migrate/backup.d.ts +0 -8
- package/dist/commands/migrate/constants.d.ts +0 -16
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/gitleaks.d.ts +0 -29
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -22
- package/dist/commands/migrate/kingfisher.d.ts +0 -14
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/moon.d.ts +0 -5
- package/dist/commands/migrate/nano-staged.d.ts +0 -30
- package/dist/commands/migrate/nx.d.ts +0 -12
- package/dist/commands/migrate/prompt.d.ts +0 -2
- package/dist/commands/migrate/secretlint.d.ts +0 -14
- package/dist/commands/migrate/shared.d.ts +0 -29
- package/dist/commands/migrate/turborepo.d.ts +0 -11
- package/dist/commands/migrate/types.d.ts +0 -27
- package/dist/commands/migrate/verify.d.ts +0 -12
- package/dist/commands/optimize.d.ts +0 -38
- package/dist/commands/pm.d.ts +0 -3
- package/dist/commands/remove.d.ts +0 -3
- package/dist/commands/run.d.ts +0 -16
- package/dist/commands/sbom.d.ts +0 -10
- package/dist/commands/secrets.d.ts +0 -3
- package/dist/commands/sort-package-json.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -10
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/sync.d.ts +0 -16
- package/dist/commands/task-why.d.ts +0 -3
- package/dist/commands/unlink.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/upgrade.d.ts +0 -3
- package/dist/commands/why.d.ts +0 -3
- package/dist/docker.d.ts +0 -73
- package/dist/flakiness.d.ts +0 -40
- package/dist/generate/discover.d.ts +0 -29
- package/dist/generate/loader.d.ts +0 -15
- package/dist/generate/moon-adapter/filename-interp.d.ts +0 -42
- package/dist/generate/moon-adapter/filters.d.ts +0 -22
- package/dist/generate/moon-adapter/frontmatter.d.ts +0 -39
- package/dist/generate/moon-adapter/index.d.ts +0 -19
- package/dist/generate/moon-adapter/tera-subset.d.ts +0 -85
- package/dist/generate/moon-adapter/util.d.ts +0 -14
- package/dist/generate/prompts.d.ts +0 -25
- package/dist/generate/remote.d.ts +0 -43
- package/dist/generate/runner.d.ts +0 -37
- package/dist/generate/types.d.ts +0 -152
- package/dist/hooks.d.ts +0 -118
- package/dist/native-binding.d.ts +0 -158
- package/dist/output.d.ts +0 -40
- package/dist/overrides.d.ts +0 -82
- package/dist/package-manager.d.ts +0 -23
- package/dist/packem_shared/otelPlugin-CJLkguJ8.js +0 -1
- package/dist/plugins/config-loader.d.ts +0 -3
- package/dist/plugins/otel.d.ts +0 -63
- package/dist/plugins/post-command.d.ts +0 -3
- package/dist/plugins/security-enforcement.d.ts +0 -3
- package/dist/pm-runner.d.ts +0 -44
- package/dist/run-report.d.ts +0 -40
- package/dist/runtime-check.d.ts +0 -27
- package/dist/sbom/cyclonedx.d.ts +0 -39
- package/dist/sbom/installed-package.d.ts +0 -49
- package/dist/sbom/license.d.ts +0 -31
- package/dist/sbom/lockfile.d.ts +0 -34
- package/dist/sbom/purl.d.ts +0 -25
- package/dist/sbom/resolve-specifier.d.ts +0 -24
- package/dist/sbom/types.d.ts +0 -196
- package/dist/secrets/baseline.d.ts +0 -20
- package/dist/secrets/format.d.ts +0 -14
- package/dist/secrets/git.d.ts +0 -6
- package/dist/secrets/spinner.d.ts +0 -9
- package/dist/security.d.ts +0 -64
- package/dist/selectors.d.ts +0 -81
- package/dist/shell-history.d.ts +0 -16
- package/dist/socket-security.d.ts +0 -129
- package/dist/staged/cli-parse.d.ts +0 -18
- package/dist/staged/config.d.ts +0 -14
- package/dist/staged/errors/apply-empty-commit-error.d.ts +0 -4
- package/dist/staged/errors/config-error.d.ts +0 -4
- package/dist/staged/errors/get-backup-stash-error.d.ts +0 -4
- package/dist/staged/errors/git-error.d.ts +0 -6
- package/dist/staged/errors/index.d.ts +0 -12
- package/dist/staged/errors/restore-original-state-error.d.ts +0 -4
- package/dist/staged/errors/staged-error.d.ts +0 -8
- package/dist/staged/errors/task-error.d.ts +0 -6
- package/dist/staged/git/diff.d.ts +0 -76
- package/dist/staged/git/exec.d.ts +0 -43
- package/dist/staged/git/index.d.ts +0 -77
- package/dist/staged/git/stash.d.ts +0 -37
- package/dist/staged/index.d.ts +0 -13
- package/dist/staged/match.d.ts +0 -12
- package/dist/staged/renderer/index.d.ts +0 -9
- package/dist/staged/renderer/ink/index.d.ts +0 -4
- package/dist/staged/renderer/plain.d.ts +0 -12
- package/dist/staged/tasks/build.d.ts +0 -13
- package/dist/staged/tasks/exec.d.ts +0 -56
- package/dist/staged/tasks/run.d.ts +0 -26
- package/dist/staged/types.d.ts +0 -173
- package/dist/target-discovery.d.ts +0 -59
- package/dist/target-options.d.ts +0 -261
- package/dist/tips.d.ts +0 -41
- package/dist/tui/components/CheckProgressApp.d.ts +0 -6
- package/dist/tui/components/CommandSummary.d.ts +0 -17
- package/dist/tui/components/Header.d.ts +0 -13
- package/dist/tui/components/OutputPanel.d.ts +0 -17
- package/dist/tui/components/QuitDialog.d.ts +0 -15
- package/dist/tui/components/TaskListPanel.d.ts +0 -19
- package/dist/tui/components/TaskRow.d.ts +0 -12
- package/dist/tui/components/TaskStore.d.ts +0 -80
- package/dist/tui/components/VisTaskRunnerApp.d.ts +0 -17
- package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +0 -66
- package/dist/tui/components/devcontainer/VisDevcontainerApp.d.ts +0 -9
- package/dist/tui/components/devcontainer/catalogs/extensions.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/features.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/filters.d.ts +0 -4
- package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +0 -19
- package/dist/tui/components/devcontainer/catalogs/templates.d.ts +0 -8
- package/dist/tui/components/devcontainer/devcontainer-io.d.ts +0 -14
- package/dist/tui/components/devcontainer/sections/DockerComposeSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/EnvironmentSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/ExtensionsSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/FeaturesSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +0 -12
- package/dist/tui/components/devcontainer/sections/LifecycleSection.d.ts +0 -13
- package/dist/tui/components/devcontainer/sections/MountsSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/PortsSection.d.ts +0 -10
- package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +0 -11
- package/dist/tui/components/devcontainer/types.d.ts +0 -53
- package/dist/tui/components/devcontainer/validate.d.ts +0 -16
- package/dist/tui/components/graph/GraphStore.d.ts +0 -42
- package/dist/tui/components/graph/ProjectDetailPanel.d.ts +0 -10
- package/dist/tui/components/graph/ProjectListPanel.d.ts +0 -20
- package/dist/tui/components/graph/VisGraphApp.d.ts +0 -8
- package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +0 -9
- package/dist/tui/components/optimize/OptimizeListPanel.d.ts +0 -16
- package/dist/tui/components/optimize/OptimizeStore.d.ts +0 -50
- package/dist/tui/components/optimize/VisOptimizeApp.d.ts +0 -8
- package/dist/tui/components/optimize/constants.d.ts +0 -7
- package/dist/tui/components/update/PackageDetailPanel.d.ts +0 -12
- package/dist/tui/components/update/PackageListPanel.d.ts +0 -21
- package/dist/tui/components/update/UpdateStore.d.ts +0 -62
- package/dist/tui/components/update/VisUpdateApp.d.ts +0 -18
- package/dist/tui/dynamic-life-cycle.d.ts +0 -22
- package/dist/tui/formatting-utils.d.ts +0 -17
- package/dist/tui/pretty-time.d.ts +0 -8
- package/dist/tui/static-life-cycle.d.ts +0 -28
- package/dist/tui/status-utils.d.ts +0 -20
- package/dist/tui/symbols.d.ts +0 -7
- package/dist/tui/types.d.ts +0 -11
- package/dist/typosquats.d.ts +0 -70
- package/dist/upgrade-check.d.ts +0 -30
- package/dist/utils.d.ts +0 -22
- package/dist/watch.d.ts +0 -65
- package/dist/workspace.d.ts +0 -675
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var C=Object.defineProperty;var u=(e,t)=>C(e,"name",{value:t,configurable:!0});import{createRequire as v}from"node:module";import{findCacheDirSync as D}from"@visulima/find-cache-dir";import{isAccessibleSync as y,ensureDirSync as p,readJsonSync as T,writeJsonSync as x}from"@visulima/fs";import{join as o,dirname as E}from"@visulima/path";import{createJiti as I}from"jiti";import{otelPlugin as X}from"./packem_shared/otelPlugin-DxyvBcXO.js";const S=v(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=u(e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[t,n]=r.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return r.getBuiltinModule(e)}return S(e)},"__cjs_getBuiltinModule"),{createHash:_}=d("node:crypto"),{readdirSync:j,copyFileSync:b,unlinkSync:w,readFileSync:F}=d("node:fs"),{tmpdir:P}=d("node:os");var A=Object.defineProperty,s=u((e,t)=>A(e,"name",{value:t,configurable:!0}),"s");const h=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],J=new Set(h),O={blockExoticSubdeps:!0,strictDepBuilds:!0,trustPolicy:"no-downgrade",trustPolicyIgnoreAfter:43200},V=s(e=>({...O,...e}),"mergeSecurityDefaults"),l=s(e=>({...e,security:V(e.security),update:{security:!0,target:"minor",...e.update}}),"applyDefaults"),k=s(e=>{let t;try{t=j(e)}catch{return}const n=new Set(t.filter(i=>J.has(i)));for(const i of h)if(n.has(i))return o(e,i)},"findVisConfigFile"),q=s(e=>_("sha256").update(F(e)).digest("hex"),"hashFileContents"),B=s(e=>{const t=o(e,"node_modules");if(y(t)){const i=o(t,".cache","vis");return p(i),o(i,"vis-config-cache.json")}const n=D("vis",{create:!0,cwd:e});return n?o(n,"vis-config-cache.json"):void 0},"getConfigCachePath"),N=s((e,t)=>{if(y(e))try{const n=T(e);if(n.hash===t)return n.config}catch{}},"readConfigCache"),R=s((e,t,n)=>{try{p(E(e)),x(e,{config:n,hash:t})}catch{}},"writeConfigCache"),Y=s(async e=>{const t=k(e);if(!t)return l({});const n=q(t),i=B(e);if(i){const g=N(i,n);if(g)return g}const m=t.slice(t.lastIndexOf(".")),a=o(P(),`vis-config-${n}${m}`);b(t,a);let c;try{c=await I(e,{fsCache:!1,moduleCache:!1}).import(a,{default:!0,try:!0})??{}}finally{try{w(a)}catch{}}let f;return f=l(typeof c=="function"?await c()??{}:c),i&&R(i,n,f),f},"loadVisConfig"),z=s(e=>l(e),"defineConfig"),K=s(e=>e,"definePlugin");export{h as CONFIG_FILES,O as SECURITY_DEFAULTS,l as applyDefaults,z as defineConfig,K as definePlugin,k as findVisConfigFile,Y as loadVisConfig,X as otelPlugin};
|
package/dist/generate/index.d.ts
CHANGED
|
@@ -1,32 +1,157 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
* Type definitions for the `vis generate` template runtime.
|
|
3
|
+
*
|
|
4
|
+
* The shape intentionally echoes Bingo's `Template` so a future Bingo
|
|
5
|
+
* adapter (re-exporting `bingo` Templates through this runtime) is a
|
|
6
|
+
* one-pager. Authors do not depend on Bingo to write a vis generator.
|
|
7
|
+
*/
|
|
8
|
+
type VariableType = "array" | "boolean" | "enum" | "number" | "string";
|
|
9
|
+
/** Common variable fields (all types). */
|
|
10
|
+
interface VariableBase {
|
|
11
|
+
/**
|
|
12
|
+
* Default value when the user accepts the prompt without typing.
|
|
13
|
+
* For `boolean` this is `true|false`; for `enum` it must match `values`.
|
|
14
|
+
*/
|
|
15
|
+
default?: boolean | number | string | string[];
|
|
16
|
+
/** Hide from prompts; can still be set via CLI or `--defaults`. */
|
|
17
|
+
internal?: boolean;
|
|
18
|
+
/** Sort order in prompts (lower first). Defaults to declaration order. */
|
|
19
|
+
order?: number;
|
|
20
|
+
/** Override the prompt text. Defaults to the variable name. */
|
|
21
|
+
prompt?: string;
|
|
22
|
+
/** When true, the user must provide a non-empty value. */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
}
|
|
25
|
+
type StringVariable = VariableBase & {
|
|
26
|
+
type: "string";
|
|
27
|
+
};
|
|
28
|
+
type NumberVariable = VariableBase & {
|
|
29
|
+
type: "number";
|
|
30
|
+
};
|
|
31
|
+
type BooleanVariable = VariableBase & {
|
|
32
|
+
default?: boolean;
|
|
33
|
+
type: "boolean";
|
|
34
|
+
};
|
|
35
|
+
type ArrayVariable = VariableBase & {
|
|
36
|
+
type: "array";
|
|
37
|
+
};
|
|
38
|
+
interface EnumVariable extends VariableBase {
|
|
39
|
+
/** Allow multiple selections (returns `string[]`). */
|
|
40
|
+
multiple?: boolean;
|
|
41
|
+
type: "enum";
|
|
42
|
+
/** Selectable values. */
|
|
43
|
+
values: string[];
|
|
44
|
+
}
|
|
45
|
+
type Variable = ArrayVariable | BooleanVariable | EnumVariable | NumberVariable | StringVariable;
|
|
46
|
+
/** Map of variable name → spec, as authors declare them. */
|
|
47
|
+
type VariableMap = Record<string, Variable>;
|
|
48
|
+
/** Resolved option values passed to `produce()`. */
|
|
49
|
+
type Options = Record<string, unknown>;
|
|
50
|
+
/** A file in a Creation can be a string, a Buffer (binary asset), or a nested directory. */
|
|
51
|
+
type CreationFile = Buffer | string;
|
|
52
|
+
interface CreationDirectory {
|
|
53
|
+
[key: string]: CreationDirectory | CreationFile;
|
|
54
|
+
}
|
|
27
55
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
56
|
+
* Script entry produced by `produce()`.
|
|
57
|
+
* - `string`: shell command, runs in the destination directory.
|
|
58
|
+
* - `object`: shell commands with optional phase ordering.
|
|
59
|
+
*/
|
|
60
|
+
type Script = ScriptObject | string;
|
|
61
|
+
interface ScriptObject {
|
|
62
|
+
/** Shell command(s) to run sequentially. */
|
|
63
|
+
commands: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Phase ordering. Phases run in ascending order; scripts within
|
|
66
|
+
* the same phase are dispatched concurrently. Default: 0.
|
|
67
|
+
*/
|
|
68
|
+
phase?: number;
|
|
69
|
+
/** Suppress command output. Default: false. */
|
|
70
|
+
silent?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/** Object returned by a template's `produce()` function. */
|
|
73
|
+
interface Creation {
|
|
74
|
+
/** Recursive directory tree. Keys with `/` are auto-split. */
|
|
75
|
+
files?: CreationDirectory;
|
|
76
|
+
/**
|
|
77
|
+
* Per-file metadata keyed by the *flattened* destination path
|
|
78
|
+
* (e.g. `src/foo.ts`). Optional — native templates usually omit
|
|
79
|
+
* this; the moon adapter populates it from per-file frontmatter
|
|
80
|
+
* so `force: true` survives the trip to the runner without
|
|
81
|
+
* changing the shape of `files`.
|
|
82
|
+
*/
|
|
83
|
+
filesMeta?: Record<string, FileMeta>;
|
|
84
|
+
/** Shell scripts to run after files are written. */
|
|
85
|
+
scripts?: Script[];
|
|
86
|
+
/** User-facing tips printed after the run. */
|
|
87
|
+
suggestions?: string[];
|
|
88
|
+
}
|
|
89
|
+
interface FileMeta {
|
|
90
|
+
/**
|
|
91
|
+
* Overwrite an existing file at this path without prompting or
|
|
92
|
+
* consulting the global `--force` flag.
|
|
93
|
+
*/
|
|
94
|
+
force?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/** Context object passed to `produce()`. */
|
|
97
|
+
interface TemplateContext {
|
|
98
|
+
/** Built-in variables: `dest_dir`, `dest_rel_dir`, `working_dir`, `workspace_root`. */
|
|
99
|
+
builtins: BuiltinVars;
|
|
100
|
+
/** Resolved option values (after prompts + CLI overrides + defaults). */
|
|
101
|
+
options: Options;
|
|
102
|
+
}
|
|
103
|
+
interface BuiltinVars {
|
|
104
|
+
/** Absolute destination directory. */
|
|
105
|
+
dest_dir: string;
|
|
106
|
+
/** Destination relative to the workspace root. */
|
|
107
|
+
dest_rel_dir: string;
|
|
108
|
+
/** Caller's current working directory. */
|
|
109
|
+
working_dir: string;
|
|
110
|
+
/** Absolute workspace root (from `findMonorepoRootSync`, fallback to `working_dir`). */
|
|
111
|
+
workspace_root: string;
|
|
112
|
+
}
|
|
113
|
+
/** Top-level "About" metadata for a template. */
|
|
114
|
+
interface TemplateAbout {
|
|
115
|
+
/** One-line description. */
|
|
116
|
+
description: string;
|
|
117
|
+
/** Short identifier shown in `vis generate --list` and prompts. */
|
|
118
|
+
name: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The author-facing template shape.
|
|
122
|
+
* Both native (`.vis/templates/<name>.ts`) and moon-adapter outputs
|
|
123
|
+
* normalize to this.
|
|
124
|
+
*/
|
|
125
|
+
interface Template {
|
|
126
|
+
about: TemplateAbout;
|
|
127
|
+
/**
|
|
128
|
+
* Default destination directory (relative to workspace root unless
|
|
129
|
+
* absolute or starting with `./`). Honored when the user does not
|
|
130
|
+
* pass `--to`. Maps to moon's `template.yml` `destination`.
|
|
131
|
+
*/
|
|
132
|
+
destination?: string;
|
|
133
|
+
/** Variable schema for prompts. */
|
|
134
|
+
options?: VariableMap;
|
|
135
|
+
/** Build the Creation given resolved options and built-in vars. */
|
|
136
|
+
produce: (context: TemplateContext) => Creation | Promise<Creation>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Discovery record: a Template plus where it came from.
|
|
140
|
+
* Surfaced by `vis generate --list`.
|
|
141
|
+
*/
|
|
142
|
+
interface DiscoveredTemplate {
|
|
143
|
+
/** Lazy loader — invoke to materialize the Template. */
|
|
144
|
+
load: () => Promise<Template>;
|
|
145
|
+
/** Stable name used by `vis generate <name>`. */
|
|
146
|
+
name: string;
|
|
147
|
+
/** Absolute path on disk (file for native, directory for moon). */
|
|
148
|
+
path: string;
|
|
149
|
+
/** Source classification — affects load + listing. */
|
|
150
|
+
source: "config" | "moon" | "native" | "remote";
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Identity helper for type inference. Authors get autocomplete + checks
|
|
154
|
+
* without having to annotate the export.
|
|
155
|
+
*/
|
|
156
|
+
declare const createTemplate: (template: Template) => Template;
|
|
157
|
+
export { type ArrayVariable, type BooleanVariable, type BuiltinVars, type Creation, type CreationDirectory, type CreationFile, type DiscoveredTemplate, type EnumVariable, type FileMeta, type NumberVariable, type Options, type Script, type ScriptObject, type StringVariable, type Template, type TemplateAbout, type TemplateContext, type Variable, type VariableMap, type VariableType, createTemplate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var O=Object.defineProperty;var w=(o,e)=>O(o,"name",{value:e,configurable:!0});import{createTaskGraph as b}from"@visulima/task-runner";import{r as E,f as R}from"../packem_shared/selectors-CfH9ZY08.js";import{Z as x,e as G}from"../packem_shared/bin-BaZZ32BK.js";var J=Object.defineProperty,m=w((o,e)=>J(o,"name",{value:e,configurable:!0}),"u");const P=m((o,e,n)=>{const c=[],t=new Set,l=m((r,f)=>{if(t.has(r))return;t.add(r);const s=e[r]??[];for(const i of s)l(i,f+1);const d=n[r],u=" ".repeat(f);c.push(`${u}${r}${d?.cache===!1?" (no-cache)":""}`)},"walk");for(const r of o)l(r,0);return c},"renderPlan"),S=m((o,e,n)=>({roots:o,tasks:Object.fromEntries(Object.entries(n).map(([c,t])=>[c,{cache:t.cache,dependsOn:e[c]??[],outputs:t.outputs,parallelism:t.parallelism,projectRoot:t.projectRoot,target:t.target}]))}),"toJson"),T=m(async({argument:o,logger:e,options:n,visConfig:c,workspaceRoot:t})=>{const l=o[0];if(!l)throw new Error("Missing selector. Usage: vis action-graph <selector>");if(!t)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{config:r,packageJsons:f,workspace:s}=x(t,c),d=G(t,s,f),u=await E(l,s,process.cwd(),t),{target:i}=u;let h=u.projects;n.query&&(h=R(h,s,n.query));const j=h.filter(p=>s.projects[p]?.targets?.[i]!==void 0);if(j.length===0){e.info(`No projects have a "${i}" target.`);return}const v=j.map(p=>{const k=s.projects[p],g=k.targets?.[i],$={project:p,target:i};return{cache:g?.cache,id:`${p}:${i}`,outputs:g?.outputs??[],overrides:{command:g?.command},parallelism:g?.parallelism,projectRoot:k.root,target:$}}),a=b(v,{projectGraph:d,targetDefaults:r.targetDefaults,workspace:s});if(n.json){e.info(JSON.stringify(S(a.roots,a.dependencies,a.tasks),null,2));return}const y=P(a.roots,a.dependencies,a.tasks);e.info(`Execution plan (${Object.keys(a.tasks).length} task(s), ${a.roots.length} root(s)):`),e.info("");for(const p of y)e.info(p)},"execute");export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var f=(r,n)=>m(r,"name",{value:n,configurable:!0});import{r as u}from"../packem_shared/toolchain-C3ZG0o_X.js";var _=Object.defineProperty,a=f((r,n)=>_(r,"name",{value:n,configurable:!0}),"n");const C=a(()=>process.env.GITHUB_BASE_REF?{base:`origin/${process.env.GITHUB_BASE_REF}`,head:process.env.GITHUB_SHA??"HEAD"}:process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME?{base:`origin/${process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME}`,head:process.env.CI_COMMIT_SHA??"HEAD"}:process.env.CIRCLE_BRANCH&&process.env.CIRCLE_SHA1?{base:"origin/main",head:process.env.CIRCLE_SHA1}:{base:"origin/main",head:"HEAD"},"detectCiRefs"),w=a(async({argument:r,logger:n,options:e,runtime:t,visConfig:d,workspaceRoot:s})=>{const l=r[0];if(!l)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const p=l.split(",").map(o=>o.trim()).filter(Boolean);if(p.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const{base:E,head:h}=C(),c=e.base??E,g=e.head??h;e.skipToolchain||n.info("▸ Toolchain pre-flight"),await u(s,d?.toolchain,{error:a(o=>n.error(o),"error"),info:a(o=>n.info(o),"info"),warn:a(o=>n.warn(o),"warn")},!!e.skipToolchain),e.install===!1?n.info("▸ Skipping install (--no-install)"):(n.info("▸ Installing dependencies"),await t.runCommand("install",{argv:["--frozen-lockfile"]}));for(const o of p){n.info(`▸ Running affected ${o} (base=${c}, head=${g})`);const i=[o,`--base=${c}`,`--head=${g}`,`--upstream=${String(e.upstream??"none")}`,`--downstream=${String(e.downstream??"deep")}`];e.parallel!==void 0&&i.push(`--parallel=${String(e.parallel)}`),e.partition&&i.push(`--partition=${String(e.partition)}`),e.query&&i.push(`--query=${String(e.query)}`),await t.runCommand("affected",{argv:i})}n.info("▸ CI pipeline complete")},"execute");export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.defineProperty;var d=(n,o)=>g(n,"name",{value:o,configurable:!0});import{createRequire as h}from"node:module";import{isAccessibleSync as R}from"@visulima/fs";import{join as m}from"@visulima/path";import{cleanWorkspace as $}from"#native";import{c as u,d as p,O as f}from"../packem_shared/bin-BaZZ32BK.js";import{f as j}from"../packem_shared/utils-DrNg0XTR.js";const v=h(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=d(n=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[o,s]=l.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return l.getBuiltinModule(n)}return v(n)},"__cjs_getBuiltinModule"),{readdirSync:_,lstatSync:k,unlinkSync:b}=y("node:fs");var S=Object.defineProperty,a=d((n,o)=>S(n,"name",{value:o,configurable:!0}),"l");const x=a(n=>{const o=[],s=[n];for(;s.length>0;){const t=s.pop();let c;try{c=_(t)}catch{continue}for(const r of c){const e=m(t,r);try{const i=k(e);if(i.isSymbolicLink()||!i.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&s.push(e)}}return o},"findNodeModulesDirectories"),N=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],q=a((n,o,s)=>{let t=0,c=!1;for(const r of N){const e=m(n,r);if(R(e)){if(o){s.info(` ${e}`),t++;continue}try{b(e),u(`Removed ${e}`),t++}catch(i){p(`${e}: ${j(i)}`),c=!0}}}return{hadError:c,removed:t}},"removeLockfiles"),O=a(async({logger:n,options:o,workspaceRoot:s})=>{const t=s??process.cwd(),c=o.lockfile||!1;if(o.dryRun){const e=x(t);if(e.length>0){f("Would remove:");for(const i of e)n.info(` ${i}`)}else f("No node_modules directories found.");c&&q(t,!0,n);return}const r=$(t,c);for(const e of r.removed)u(`Removed ${e}`);for(const e of r.lockfilesRemoved)u(`Removed ${e}`);for(const e of r.errors)p(e);r.removed.length===0&&r.lockfilesRemoved.length===0?f("No node_modules directories found."):f(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{O as default};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var ve=Object.defineProperty;var d=(e,t)=>ve(e,"name",{value:t,configurable:!0});import{createRequire as be}from"node:module";import{isAccessibleSync as P,ensureDirSync as w,writeFileSync as h,readJsonSync as se}from"@visulima/fs";import{resolve as _,basename as xe,relative as K,join as l,sep as $e,isAbsolute as je}from"@visulima/path";import{f as g,o as x,R as $,O as o,t as de,c as m,y as R,K as _e,I as Oe,m as Ce}from"../packem_shared/bin-BaZZ32BK.js";import{downloadTemplate as De}from"giget";const we=be(import.meta.url),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Y=d(e=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[t,r]=I.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return I.getBuiltinModule(e)}return we(e)},"__cjs_getBuiltinModule"),{spawnSync:ke}=Y("node:child_process"),{createInterface:Ne}=Y("node:readline"),{readdirSync:Pe,chmodSync:Se}=Y("node:fs");var Ee=Object.defineProperty,U=d((e,t)=>Ee(e,"name",{value:t,configurable:!0}),"e");const qe={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Ie=["https://github.com/","https://gitlab.com/","https://bitbucket.org/","https://raw.githubusercontent.com/","https://git.sr.ht/","git@github.com:","git@gitlab.com:","git@bitbucket.org:","git@git.sr.ht:","github:","gh:","gitlab:","bitbucket:","sourcehut:","git:","http://","https://"],Te=U(e=>{for(const t of Ie)if(e.startsWith(t))return!0;return!!(!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e))},"isGitUrl"),Re=new Set(["sv"]),Me=U(e=>{if(Re.has(e)||e.startsWith("create-")||e.startsWith("@")&&e.includes("/create-"))return e;if(e.startsWith("@")){const t=e.indexOf("/");if(t!==-1){const r=e.slice(0,t),a=e.slice(t+1);return`${r}/create-${a}`}return e}return`create-${e}`},"expandCreateShorthand"),Ae=U((e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),a=qe[r];return a?{args:t,source:r,type:a}:Te(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Me(e),type:"remote:npm"}},"discoverTemplate"),ze=U(e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},"inferParentDir");var Le=Object.defineProperty,me=d((e,t)=>Le(e,"name",{value:t,configurable:!0}),"i$2");const le=["ability","able","about","above","abroad","absence","absolute","absolutely","absorb","academic","accept","access","accompany","accomplish","according","account","accurate","achieve","achievement","acid","acknowledge","acquire","across","act","action","active","activist","activity","actor","actress","actual","actually","adapt","add","addition","additional","address","adequate","adjust","adjustment","administration","administrator","admire","admission","admit","adolescent","adopt","adult","advance","advanced","advantage","adventure","advertising","advice","advise","adviser","advocate","affair","affect","afford","after","afternoon","again","against","age","agency","agenda","agent","ago","agree","agreement","agricultural","ahead","aid","aide","aim","air","aircraft","airline","airport","album","alive","all","alliance","allow","ally","almost","alone","along","already","also","alter","alternative","although","always","amazing","among","amount","analysis","analyst","analyze","ancient","and","angle","animal","anniversary","announce","annual","another","answer","anticipate","any","anybody","anymore","anyone","anything","anyway","anywhere","apart","apartment","apparent","apparently","appeal","appear","appearance","apple","application","apply","appoint","appointment","appreciate","approach","appropriate","approval","approve","approximately","architect","area","argue","argument","arise","arm","armed","around","arrange","arrangement","arrival","arrive","art","article","artist","artistic","aside","ask","asleep","aspect","assert","assess","assessment","asset","assign","assignment","assist","assistance","assistant","associate","association","assume","assumption","assure","athlete","athletic","atmosphere","attach","attempt","attend","attention","attitude","attorney","attract","attractive","attribute","audience","author","authority","auto","available","average","avoid","award","aware","awareness","away","awesome","baby","back","background","bag","bake","balance","ball","ban","band","bank","bar","barely","barrel","base","baseball","basic","basically","basis","basket","basketball","bathroom","battery","beach","bean","bear","beat","beautiful","beauty","because","become","bed","bedroom","beer","before","begin","beginning","behavior","behind","being","belief","believe","bell","belong","below","belt","bench","bend","beneath","benefit","beside","besides","best","bet","better","between","beyond","big","bike","bill","billion","bind","biological","bird","birth","birthday","bit","bite","black","blade","blanket","blind","block","blow","blue","board","boat","body","bond","bone","book","boom","boot","border","born","borrow","boss","both","bother","bottle","bottom","boundary","bowl","box","boy","boyfriend","brain","branch","brand","bread","break","breakfast","breast","breath","breathe","brick","bridge","brief","briefly","bright","brilliant","bring","broad","brother","brown","brush","buck","budget","build","building","bullet","bunch","bury","bus","business","busy","but","butter","button","buy","buyer","cabin","cabinet","cable","cake","calculate","call","camera","camp","campaign","campus","can","candidate","cap","capability","capable","capacity","capital","captain","capture","car","carbon","card","care","career","careful","carefully","carrier","carry","case","cash","cast","cat","catch","category","cause","ceiling","celebrate","celebration","celebrity","cell","center","central","century","ceremony","certain","certainly","chain","chair","chairman","challenge","chamber","champion","championship","chance","change","changing","channel","chapter","character","characteristic","characterize","charge","charity","chart","chase","cheap","check","cheek","cheese","chef","chemical","chest","chicken","chief","child","childhood","chip","chocolate","choice","cholesterol","choose","church","cigarette","circle","circumstance","cite","citizen","city","civil","civilian","claim","class","classic","classroom","clean","clear","clearly","client","climate","climb","clinic","clinical","clock","close","closely","closer","clothes","clothing","cloud","club","clue","cluster","coach","coal","coalition","coast","coat","code","coffee","cognitive","cold","colleague","collect","collection","collective","college","colonial","color","column","combination","combine","come","comedy","comfort","comfortable","command","commander","comment","commercial","commission","commit","commitment","committee","common","communicate","communication","community","company","compare","comparison","compete","competition","competitive","competitor","complete","completely","complex","complicated","component","compose","composition","comprehensive","computer","concentrate","concentration","concept","concern","concerned","concert","conclude","conclusion","concrete","condition","conduct","conference","confidence","confident","confirm","confront","confusion","congressional","connect","connection","consciousness","consensus","consequence","conservative","consider","considerable","consideration","consist","consistent","constant","constantly","constitute","constitutional","construct","construction","consultant","consume","consumer","consumption","contact","contain","container","contemporary","content","contest","context","continue","continued","contract","contrast","contribute","contribution","control","convention","conventional","conversation","convert","conviction","convince","cook","cookie","cooking","cool","cooperation","cop","cope","copy","core","corn","corner","corporate","corporation","correct","correspondent","cost","cotton","couch","could","council","counselor","count","counter","country","county","couple","courage","course","court","cousin","cover","coverage","cow","crack","craft","cream","create","creation","creative","creature","credit","crew","criteria","crop","cross","crowd","crucial","cultural","culture","cup","curious","current","currently","curriculum","custom","customer","cut","cycle","dad","daily","dance","dare","dark","darkness","data","date","daughter","day","deal","dealer","dear","debate","decade","decide","decision","deck","declare","decrease","deep","deeply","deer","defend","defendant","defense","defensive","define","definitely","definition","degree","delay","deliver","delivery","demand","democracy","democratic","demonstrate","demonstration","deny","department","depend","dependent","depending","depict","depth","deputy","derive","describe","description","desert","deserve","design","designer","desire","desk","desperate","despite","detail","detailed","detect","determine","develop","developing","development","device","devote","dialogue","diet","differ","difference","different","differently","difficult","difficulty","dig","digital","dimension","dining","dinner","direct","direction","directly","director","disability","disagree","disappear","discipline","discourse","discover","discovery","discuss","discussion","dish","dismiss","display","distance","distant","distinct","distinction","distinguish","distribute","distribution","district","diverse","diversity","divide","division","doctor","document","dog","domestic","dominant","dominate","door","double","down","downtown","dozen","draft","drag","drama","dramatic","dramatically","draw","drawing","dream","dress","drink","drive","driver","drop","dry","due","during","dust","duty","each","eager","ear","early","earn","earnings","earth","ease","easily","east","eastern","easy","eat","economic","economics","economist","economy","edge","edition","editor","educate","education","educational","educator","effect","effective","effectively","efficiency","efficient","effort","egg","eight","either","elderly","elect","election","electric","electricity","electronic","element","elementary","eliminate","elite","else","elsewhere","embrace","emerge","emission","emotion","emotional","emphasis","emphasize","employ","employee","employer","employment","empty","enable","encounter","encourage","end","energy","enforcement","engage","engine","engineer","engineering","enhance","enjoy","enormous","enough","ensure","enter","enterprise","entertainment","entire","entirely","entrance","entry","environment","environmental","episode","equal","equally","equipment","era","escape","especially","essay","essential","essentially","establish","establishment","estate","estimate","etc","ethics","ethnic","evaluate","evaluation","even","evening","event","eventually","ever","every","everybody","everyday","everyone","everything","everywhere","evidence","evolution","evolve","exact","exactly","examination","examine","example","exceed","excellent","except","exception","exchange","exciting","executive","exercise","exhibit","exhibition","exist","existence","existing","expand","expansion","expect","expectation","expense","expensive","experience","experiment","expert","explain","explanation","explore","expose","express","expression","extend","extension","extensive","extent","external","extra","extraordinary","extreme","extremely","eye","fabric","face","facility","fact","factor","factory","faculty","fade","fair","fairly","faith","fall","false","familiar","family","famous","fan","fantasy","far","farm","farmer","fashion","fast","fate","father","favor","favorite","feature","federal","fee","feed","feel","feeling","fellow","female","fence","few","fewer","fiber","fiction","field","fifteen","fifth","fifty","figure","file","fill","film","final","finally","finance","financial","find","finding","fine","finger","finish","firm","first","fish","fishing","fit","fitness","five","fix","flag","flame","flat","flavor","flesh","flight","float","floor","flow","flower","fly","focus","folk","follow","following","food","foot","football","for","force","foreign","forest","forever","forget","form","formal","formation","former","formula","forth","fortune","forward","found","foundation","founder","four","fourth","frame","framework","free","freedom","freeze","frequency","frequent","frequently","fresh","friend","friendly","friendship","from","front","fruit","fuel","full","fully","fun","function","fund","fundamental","funding","funeral","funny","furniture","furthermore","future","gain","galaxy","gallery","game","gap","garage","garden","garlic","gas","gate","gather","gaze","gear","gender","gene","general","generally","generate","generation","genetic","gentleman","gently","gesture","get","ghost","giant","gift","gifted","girl","girlfriend","give","given","glad","glance","glass","global","glove","goal","gold","golden","golf","good","government","governor","grab","grade","gradually","graduate","grain","grand","grandfather","grandmother","grant","grass","grave","gray","great","greatest","green","grocery","ground","group","grow","growing","growth","guarantee","guard","guess","guest","guide","guideline","guy","habit","habitat","hair","half","hall","hand","handful","handle","hang","happen","happy","hard","hardly","hat","have","head","headline","headquarters","health","healthy","hear","hearing","heart","heat","heaven","heavily","heavy","heel","height","helicopter","hello","help","helpful","here","heritage","hero","herself","hey","hide","high","highlight","highly","highway","hill","himself","hip","hire","historian","historic","historical","history","hit","hold","hole","holiday","holy","home","honest","honey","honor","hope","horizon","horse","hospital","host","hot","hotel","hour","house","household","housing","how","however","huge","human","humor","hundred","hungry","hunter","hunting","husband","hypothesis","ice","idea","ideal","identification","identify","identity","ignore","illustrate","image","imagination","imagine","immediate","immediately","immigrant","immigration","impact","implement","implication","imply","importance","important","impose","impossible","impress","impression","impressive","improve","improvement","incentive","incident","include","including","income","incorporate","increase","increased","increasing","increasingly","incredible","indeed","independence","independent","index","indicate","indication","individual","industrial","industry","infant","inflation","influence","inform","information","ingredient","initial","initially","initiative","inner","innocent","inquiry","inside","insight","insist","inspire","install","instance","instead","institution","institutional","instruction","instructor","instrument","insurance","intellectual","intelligence","intend","intense","intensity","intention","interaction","interest","interested","interesting","internal","international","interpret","interpretation","intervention","interview","into","introduce","introduction","invest","investigate","investigation","investigator","investment","investor","invite","involve","involved","involvement","iron","island","issue","item","its","itself","jacket","jet","job","join","joint","joke","journal","journalist","journey","joy","judge","judgment","juice","jump","junior","jury","just","justice","justify","keep","key","kick","kid","kind","king","kiss","kitchen","knee","knife","knock","know","knowledge","lab","label","labor","laboratory","lady","lake","land","landscape","language","lap","large","largely","last","late","later","latter","laugh","launch","law","lawn","lawsuit","lawyer","lay","layer","lead","leader","leadership","leading","leaf","league","lean","learn","learning","least","leather","leave","left","leg","legacy","legal","legend","legislation","legitimate","lemon","length","less","lesson","let","letter","level","liberal","library","license","lie","life","lifestyle","lifetime","lift","light","like","likely","limit","limitation","limited","line","link","lip","list","listen","literally","literary","literature","little","live","living","load","loan","local","locate","location","lock","long","look","loose","lose","lost","lot","lots","loud","love","lovely","lover","low","lower","luck","lucky","lunch","lung","machine","magazine","mail","main","mainly","maintain","maintenance","major","majority","make","maker","makeup","male","mall","man","manage","management","manager","manner","manufacturer","manufacturing","many","map","margin","mark","market","marketing","marriage","married","marry","mask","mass","massive","master","match","material","math","matter","may","maybe","mayor","meal","mean","meaning","meanwhile","measure","measurement","meat","mechanism","media","medical","medication","medicine","medium","meet","meeting","member","membership","memory","mental","mention","menu","mere","merely","message","metal","meter","method","middle","might","military","milk","million","mind","mine","minister","minor","minority","minute","miracle","mirror","miss","missile","mission","mix","mixture","mode","model","moderate","modern","modest","mom","moment","money","monitor","month","mood","moon","moral","more","moreover","morning","mortgage","most","mostly","mother","motion","motivation","motor","mount","mountain","mouse","mouth","move","movement","movie","much","multiple","muscle","museum","music","musical","musician","must","mutual","myself","mystery","myth","naked","name","narrative","narrow","nation","national","native","natural","naturally","nature","near","nearby","nearly","necessarily","necessary","neck","need","negative","negotiate","negotiation","neighbor","neighborhood","neither","nerve","net","network","never","nevertheless","new","newly","news","newspaper","next","nice","night","nine","nobody","nod","nomination","none","nonetheless","nor","normal","normally","north","northern","nose","not","note","nothing","notice","notion","novel","now","nowhere","nuclear","number","numerous","nurse","nut","object","objective","obligation","observation","observe","observer","obtain","obvious","obviously","occasion","occasionally","occupation","occupy","occur","ocean","odd","odds","off","offer","office","officer","official","often","oil","okay","old","once","one","ongoing","onion","online","only","onto","open","opening","operate","operating","operation","operator","opinion","opponent","opportunity","oppose","opposite","opposition","option","orange","order","ordinary","organic","organization","organize","orientation","origin","original","originally","other","others","otherwise","ought","our","ourselves","out","outcome","outside","oven","over","overall","overcome","overlook","owe","own","owner","pace","pack","package","page","paint","painter","painting","pair","pale","palm","pan","panel","pant","paper","parent","park","parking","part","participant","participate","participation","particular","particularly","partly","partner","partnership","party","pass","passage","passenger","passion","past","patch","path","patient","pattern","pause","pay","payment","peace","peak","peer","people","pepper","per","perceive","percentage","perception","perfect","perfectly","perform","performance","perhaps","period","permanent","permission","permit","person","personal","personality","personally","personnel","perspective","persuade","pet","phase","phenomenon","philosophy","phone","photo","photograph","photographer","phrase","physical","physically","physician","piano","pick","picture","pie","piece","pile","pilot","pine","pink","pipe","pitch","place","plan","plane","planet","planning","plant","plastic","plate","platform","play","player","please","pleasure","plenty","plot","plus","pocket","poem","poet","poetry","point","pole","police","policy","political","politically","politician","politics","poll","pool","pop","popular","population","porch","port","portion","portrait","portray","pose","position","positive","possess","possibility","possible","possibly","post","pot","potato","potential","potentially","pound","pour","powder","power","powerful","practical","practice","pray","prayer","precisely","predict","prefer","preference","pregnancy","pregnant","preparation","prepare","prescription","presence","present","presentation","preserve","president","presidential","press","pretend","pretty","prevent","previous","previously","price","pride","priest","primarily","primary","prime","principal","principle","print","prior","priority","privacy","private","probably","procedure","proceed","process","produce","producer","product","production","profession","professional","professor","profile","profit","program","progress","project","prominent","promise","promote","prompt","proof","proper","properly","property","proportion","proposal","propose","proposed","prosecutor","prospect","protect","protection","protein","protest","proud","prove","provide","provider","province","provision","psychological","psychologist","psychology","public","publication","publicly","publish","publisher","pull","purchase","pure","purpose","pursue","push","put","qualify","quality","quarter","quarterback","question","quick","quickly","quiet","quietly","quit","quite","quote","race","racial","radical","radio","rail","rain","raise","range","rank","rapid","rapidly","rare","rarely","rate","rather","rating","ratio","raw","reach","react","reaction","read","reader","reading","ready","real","reality","realize","really","reason","reasonable","recall","receive","recent","recently","recipe","recognition","recognize","recommend","recommendation","record","recording","recover","recovery","recruit","red","reduce","reduction","refer","reference","reflect","reflection","reform","refugee","refuse","regard","regarding","regardless","regime","region","regional","register","regular","regularly","regulate","regulation","reinforce","relate","relation","relationship","relative","relatively","relax","release","relevant","relief","religion","religious","rely","remain","remaining","remarkable","remember","remind","remote","remove","repeat","repeatedly","replace","reply","report","reporter","represent","representation","representative","reputation","request","require","requirement","research","researcher","resemble","reservation","resident","resist","resolution","resolve","resort","resource","respect","respond","respondent","response","responsibility","responsible","rest","restaurant","restore","restriction","result","retain","retire","retirement","return","reveal","revenue","review","revolution","rhythm","rice","rich","rid","ride","rifle","right","ring","rise","river","road","rock","role","roll","romantic","roof","room","root","rope","rose","roughly","round","route","routine","row","rub","rule","run","running","rural","rush","sacred","safe","safety","sake","salad","salary","sale","sales","salt","same","sample","sanction","sand","satellite","satisfaction","satisfy","sauce","save","saving","say","scale","scenario","scene","schedule","scheme","scholar","scholarship","school","science","scientific","scientist","scope","score","screen","script","sea","search","season","seat","second","secret","secretary","section","sector","secure","security","see","seed","seek","seem","segment","seize","select","selection","self","sell","senator","send","senior","sense","sensitive","sentence","separate","sequence","series","serious","seriously","serve","service","session","set","setting","settle","settlement","seven","several","shade","shadow","shake","shall","shape","share","sharp","sheet","shelf","shell","shelter","shift","shine","ship","shirt","shoe","shop","shopping","shore","short","shortly","shot","should","shoulder","shout","show","shower","shrug","shut","side","sigh","sight","sign","signal","significance","significant","significantly","silence","silent","silver","similar","similarly","simple","simply","since","sing","singer","single","sink","sir","sister","sit","site","situation","six","size","ski","skill","skin","sky","sleep","slice","slide","slight","slightly","slip","slow","slowly","small","smart","smell","smile","smooth","snap","snow","soccer","social","society","soft","software","soil","solar","solid","solution","solve","some","somebody","somehow","someone","something","sometimes","somewhat","somewhere","son","song","soon","sophisticated","sorry","sort","soul","sound","soup","source","south","southern","space","speak","speaker","special","specialist","species","specific","specifically","speech","speed","spend","spending","spin","spirit","spiritual","split","spokesman","sport","spot","spread","spring","square","squeeze","stability","stable","staff","stage","stair","stake","stand","standard","standing","star","stare","start","state","statement","station","statistics","status","stay","steady","steal","steel","step","stick","still","stir","stock","stomach","stone","stop","storage","store","storm","story","straight","strange","stranger","strategic","strategy","stream","street","strength","strengthen","stretch","string","strip","strong","strongly","structure","student","studio","study","stuff","style","subject","submit","subsequent","substance","substantial","succeed","success","successful","successfully","such","sudden","suddenly","sue","sufficient","sugar","suggest","suggestion","suit","summer","summit","sun","super","supply","support","supporter","suppose","supposed","sure","surely","surface","surgery","surprise","surprised","surprising","surprisingly","surround","survey","survival","survive","survivor","sustain","swear","sweep","sweet","swim","swing","switch","symbol","system","table","tablespoon","tactic","tail","take","tale","talent","talk","tall","tank","tap","tape","target","task","taste","tax","taxpayer","tea","teach","teacher","teaching","team","tear","teaspoon","technical","technique","technology","teen","teenager","telephone","telescope","television","tell","temperature","temporary","ten","tend","tendency","tennis","tent","term","terms","territory","test","testify","testimony","testing","text","than","thank","thanks","that","the","theater","their","them","theme","themselves","then","theory","therapy","there","therefore","thick","thin","thing","think","thinking","third","thirty","though","thought","thousand","three","throat","through","throughout","throw","ticket","tie","tight","time","tiny","tip","tire","tired","tissue","title","today","toe","together","tomato","tomorrow","tone","tongue","tonight","too","tool","tooth","top","topic","toss","total","totally","touch","tough","tour","tourist","tournament","tower","town","toy","trace","track","trade","tradition","traditional","traffic","trail","train","training","transfer","transform","transformation","transition","translate","transportation","travel","treat","treatment","treaty","tree","tremendous","trend","trial","tribe","trip","troop","truck","true","truly","trust","truth","try","tube","tunnel","turn","twelve","twenty","twice","twin","two","type","typical","typically","ultimate","ultimately","unable","uncle","under","undergo","understand","understanding","unfortunately","uniform","union","unique","unit","universal","universe","university","unknown","unless","unlike","unlikely","until","unusual","upon","upper","urban","urge","use","used","useful","user","usual","usually","utility","vacation","valley","valuable","value","variable","variation","variety","various","vary","vast","vegetable","vehicle","venture","version","versus","very","vessel","veteran","via","victory","video","view","viewer","village","virtually","virtue","visible","vision","visit","visitor","visual","vital","voice","volume","volunteer","vote","voter","wage","wait","wake","walk","wall","wander","want","warm","warn","warning","wash","watch","water","wave","way","wealth","wealthy","wear","weather","wedding","week","weekend","weekly","weigh","weight","welcome","welfare","well","west","western","wet","what","whatever","wheel","when","whenever","where","whereas","whether","which","while","whisper","white","who","whole","whom","whose","why","wide","widely","widespread","wife","wild","will","willing","win","wind","window","wine","wing","winner","winter","wipe","wire","wisdom","wise","wish","with","withdraw","within","without","witness","woman","wonder","wonderful","wood","wooden","word","work","worker","working","works","workshop","world","worried","worth","would","wrap","write","writer","writing","yard","yeah","year","yell","yellow","yes","yesterday","yield","young","your","yours","yourself","youth","zone"],Ge=me((e,t)=>Math.floor(e+Math.random()*(t-e+1)),"random");function H(){return le[Ge(0,le.length-1)]}d(H,"getRandomWord");me(H,"getRandomWord");var Ue=Object.defineProperty,Fe=d((e,t)=>Ue(e,"name",{value:t,configurable:!0}),"o$1");const Be=Fe(()=>`${H()}-${H()}`,"randomName");var Je=Object.defineProperty,S=d((e,t)=>Je(e,"name",{value:t,configurable:!0}),"t");function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(ge,"getDefaultExportFromCjs");S(ge,"getDefaultExportFromCjs");function Ve(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(Ve,"getDefaultExportFromNamespaceIfPresent");S(Ve,"getDefaultExportFromNamespaceIfPresent");function We(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}d(We,"getDefaultExportFromNamespaceIfNotNamed");S(We,"getDefaultExportFromNamespaceIfNotNamed");function He(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=S(d(function a(){var i=!1;try{i=this instanceof a}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,i.get?i:{enumerable:!0,get:S(function(){return e[a]},"get")})}),r}d(He,"getAugmentedNamespace");S(He,"getAugmentedNamespace");var J,ce;function Ye(){return ce||(ce=1,J=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]),J}d(Ye,"requireBuiltinModules");var V,pe;function Ke(){if(pe)return V;pe=1;var e=Object.defineProperty,t=d((n,c)=>e(n,"name",{value:c,configurable:!0}),"i");const r=Ye();var a=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),i=["node_modules","favicon.ico"];function u(n){var c=[],s=[];if(n===null)return s.push("name cannot be null"),p(c,s);if(n===void 0)return s.push("name cannot be undefined"),p(c,s);if(typeof n!="string")return s.push("name must be a string"),p(c,s);if(n.length||s.push("name length must be greater than zero"),n.startsWith(".")&&s.push("name cannot start with a period"),n.startsWith("-")&&s.push("name cannot start with a hyphen"),n.match(/^_/)&&s.push("name cannot start with an underscore"),n.trim()!==n&&s.push("name cannot contain leading or trailing spaces"),i.forEach(function(f){n.toLowerCase()===f&&s.push(f+" is not a valid package name")}),r.includes(n.toLowerCase())&&c.push(n+" is a core module name"),n.length>214&&c.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&c.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&c.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var k=n.match(a);if(k){var j=k[1],v=k[2];if(v.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent(j)===j&&encodeURIComponent(v)===v)return p(c,s)}s.push("name can only contain URL-friendly characters")}return p(c,s)}d(u,"validate"),t(u,"validate");var p=t(function(n,c){var s={validForNewPackages:c.length===0&&n.length===0,validForOldPackages:c.length===0,warnings:n,errors:c};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s},"done");return V=u,V}d(Ke,"requireLib");var Qe=Ke();const Xe=ge(Qe);var Ze=Object.defineProperty,A=d((e,t)=>Ze(e,"name",{value:t,configurable:!0}),"r$2");const he=A(e=>e?Xe(e).validForNewPackages:!1,"isValidPackageName"),M=A(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),et=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),fe=A(e=>P(e)?Pe(e).every(t=>et.has(t)):!0,"isEmptyDir"),tt=A((e,t)=>{const r=_(t,e);return{packageName:M(xe(r)),targetDir:r}},"resolveTargetDir"),rt=A(e=>fe(e),"canSafelyOverwrite");var at=Object.defineProperty,F=d((e,t)=>at(e,"name",{value:t,configurable:!0}),"l$4");const T=F((e,t)=>new Promise(r=>{e.question(t,a=>{r(a.trim())})}),"ask"),W=F(async(e,t,r=!0)=>{const a=await T(e,` ${t} ${g(r?"[Y/n]":"[y/N]")} `);return a===""?r:a.toLowerCase()==="y"||a.toLowerCase()==="yes"},"confirm"),ue=F(async(e,t,r)=>{process.stderr.write(` ${t}
|
|
2
|
+
`);for(const[a,i]of r.entries()){const u=x($(` ${String(a+1)}.`)),p=i.hint?g(` — ${i.hint}`):"";process.stderr.write(`${u} ${i.label}${p}
|
|
3
|
+
`)}for(;;){const a=await T(e,`
|
|
4
|
+
${g(`Enter choice (1-${String(r.length)}):`)} `),i=Number.parseInt(a,10);if(i>=1&&i<=r.length)return r[i-1].value;const u=r.find(p=>p.value===a||p.label.toLowerCase()===a.toLowerCase());if(u)return u.value;process.stderr.write(` ${g("Invalid choice. Try again.")}
|
|
5
|
+
`)}},"select"),it=F(async e=>{const t=Ne({input:process.stdin,output:process.stdout});try{process.stderr.write(`
|
|
6
|
+
${x($("vis create"))} ${g("— project scaffolding")}
|
|
7
|
+
|
|
8
|
+
`);const r=e.inMonorepo?[{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}]:[{hint:"Full workspace setup",label:"Vis Monorepo",value:"vis:monorepo"},{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}];let a=await ue(t,"Select a template:",r);if(a==="__custom__"&&(a=await T(t,`
|
|
9
|
+
${g("Template (npm package or GitHub URL):")} `),!a))throw new Error("No template specified.");const i=Be(),u=await T(t,`
|
|
10
|
+
${g(`Project name (${i}):`)} `)||i;if(!he(M(u)))throw new Error(`Invalid project name: "${u}". Must be a valid npm package name.`);const p=M(u),n=await T(t,` ${g(`Target directory (${p}):`)} `)||p;let c=!1;const s=_(e.cwd,n);if(!fe(s)&&(c=await W(t,`Directory "${n}" is not empty. Overwrite?`,!1),!c))throw new Error("Aborted — directory not empty.");let k;e.inMonorepo||(e.defaultPm?(k=e.defaultPm,process.stderr.write(` ${g(`Package manager: ${k} (from config)`)}
|
|
11
|
+
`)):k=await ue(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let j=!1;e.inMonorepo||(j=await W(t,"Initialize a git repository?",e.defaultGitInit??!1));const v=e.defaultEditor==="vscode",f=await W(t,"Generate VS Code configuration?",v)?"vscode":void 0;return process.stderr.write(`
|
|
12
|
+
`),{editor:f,gitInit:j,overwrite:c,pm:k,projectName:u,targetDir:n,template:a}}finally{t.close()}},"runInteractivePrompts");var nt=Object.defineProperty,N=d((e,t)=>nt(e,"name",{value:t,configurable:!0}),"i$1");const ot=N((e,t)=>{o("Scaffolding application via create-vite...");const r=[K(t.cwd,t.targetDir)||".",...e.args];return r.includes("--no-immediate")||r.push("--no-immediate"),de(t.pm,{additionalPackages:[],args:r,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},"executeApp"),st=N(e=>`${JSON.stringify({devDependencies:{typescript:"^5.0.0",vitest:"^3.0.0"},exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],main:"./dist/index.js",name:e,scripts:{build:"tsc",dev:"tsc --watch",test:"vitest run","test:watch":"vitest"},type:"module",types:"./dist/index.d.ts",version:"0.0.1"},null,4)}
|
|
13
|
+
`,"libraryPackageJson"),lt=N(()=>`${JSON.stringify({compilerOptions:{declaration:!0,declarationMap:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,sourceMap:!0,strict:!0,target:"ES2022"},include:["src/**/*"]},null,4)}
|
|
14
|
+
`,"libraryTsconfig"),ct=N(e=>`/**
|
|
15
|
+
* ${e} — library entry point.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
|
|
19
|
+
`,"librarySrcIndex"),pt=N(e=>`import { describe, expect, it } from "vitest";
|
|
20
|
+
|
|
21
|
+
import { greet } from "../src/index";
|
|
22
|
+
|
|
23
|
+
describe("${e}", () => {
|
|
24
|
+
it("should greet", () => {
|
|
25
|
+
expect(greet("world")).toBe("Hello from ${e}, world!");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
`,"libraryTestIndex"),ut=N((e,t)=>{const{projectName:r,targetDir:a}=t;return o("Scaffolding library package..."),w(a),w(l(a,"src")),w(l(a,"__tests__")),h(l(a,"package.json"),st(r)),m("Created package.json"),h(l(a,"tsconfig.json"),lt()),m("Created tsconfig.json"),h(l(a,"src","index.ts"),ct(r)),m("Created src/index.ts"),h(l(a,"__tests__","index.test.ts"),pt(r)),m("Created __tests__/index.test.ts"),h(l(a,".gitignore"),`node_modules/
|
|
29
|
+
dist/
|
|
30
|
+
.env
|
|
31
|
+
.DS_Store
|
|
32
|
+
`),m("Created .gitignore"),0},"executeLibrary"),dt=N((e,t)=>{switch(e.type){case"builtin:app":return ot(e,t);case"builtin:library":return ut(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},"executeBuiltin");var mt=Object.defineProperty,z=d((e,t)=>mt(e,"name",{value:t,configurable:!0}),"n");const gt=z((e,t)=>`${JSON.stringify({bin:{[e]:"./bin/index.js"},description:t,devDependencies:{typescript:"^5.0.0"},name:e,private:!0,scripts:{build:"tsc",dev:"tsc --watch"},type:"module",version:"0.0.1"},null,4)}
|
|
33
|
+
`,"packageJson"),ht=z(e=>`#!/usr/bin/env node
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* ${e} — code generator
|
|
37
|
+
*
|
|
38
|
+
* Usage: npx ${e} [options]
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
console.log("Hello from ${e}!");
|
|
42
|
+
`,"binIndex"),ft=z(()=>`${JSON.stringify({compilerOptions:{declaration:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,strict:!0,target:"ES2022"},include:["src/**/*","bin/**/*"]},null,4)}
|
|
43
|
+
`,"tsconfigJson"),yt=z(()=>`/**
|
|
44
|
+
* Generator core logic — export functions used by the CLI entry point.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export const generate = (): void => {
|
|
48
|
+
// TODO: Implement your generator logic here
|
|
49
|
+
};
|
|
50
|
+
`,"srcIndex"),vt=z((e,t="")=>{const{projectName:r,targetDir:a}=e;o("Scaffolding code generator..."),w(a),w(l(a,"bin")),w(l(a,"src")),h(l(a,"package.json"),gt(r,t||`Code generator: ${r}`)),m("Created package.json");const i=l(a,"bin","index.js");return h(i,ht(r)),Se(i,493),m("Created bin/index.js (executable)"),h(l(a,"tsconfig.json"),ft()),m("Created tsconfig.json"),h(l(a,"src","index.ts"),yt()),m("Created src/index.ts"),0},"executeGeneratorTemplate");var bt=Object.defineProperty,D=d((e,t)=>bt(e,"name",{value:t,configurable:!0}),"s");const wt=D(e=>`${JSON.stringify({devDependencies:{"@visulima/vis":"latest"},name:e,packageManager:"pnpm@latest",private:!0,scripts:{build:"vis run build",dev:"vis run dev",lint:"vis run lint",test:"vis run test"},type:"module",version:"0.0.0"},null,4)}
|
|
51
|
+
`,"rootPackageJson"),kt=D(()=>`packages:
|
|
52
|
+
- "apps/*"
|
|
53
|
+
- "packages/*"
|
|
54
|
+
`,"pnpmWorkspaceYaml"),xt=D(()=>`# Dependencies
|
|
55
|
+
node_modules/
|
|
56
|
+
|
|
57
|
+
# Build output
|
|
58
|
+
dist/
|
|
59
|
+
.output/
|
|
60
|
+
|
|
61
|
+
# Environment
|
|
62
|
+
.env
|
|
63
|
+
.env.local
|
|
64
|
+
.env.*.local
|
|
65
|
+
|
|
66
|
+
# IDE
|
|
67
|
+
.vscode/*
|
|
68
|
+
!.vscode/settings.json
|
|
69
|
+
!.vscode/extensions.json
|
|
70
|
+
.idea/
|
|
71
|
+
|
|
72
|
+
# OS
|
|
73
|
+
.DS_Store
|
|
74
|
+
Thumbs.db
|
|
75
|
+
|
|
76
|
+
# Logs
|
|
77
|
+
*.log
|
|
78
|
+
npm-debug.log*
|
|
79
|
+
pnpm-debug.log*
|
|
80
|
+
|
|
81
|
+
# Cache
|
|
82
|
+
.turbo/
|
|
83
|
+
.cache/
|
|
84
|
+
`,"gitignore"),$t=D(()=>`root = true
|
|
85
|
+
|
|
86
|
+
[*]
|
|
87
|
+
indent_style = space
|
|
88
|
+
indent_size = 4
|
|
89
|
+
end_of_line = lf
|
|
90
|
+
charset = utf-8
|
|
91
|
+
trim_trailing_whitespace = true
|
|
92
|
+
insert_final_newline = true
|
|
93
|
+
|
|
94
|
+
[*.{yml,yaml}]
|
|
95
|
+
indent_size = 2
|
|
96
|
+
|
|
97
|
+
[*.md]
|
|
98
|
+
trim_trailing_whitespace = false
|
|
99
|
+
`,"editorconfig"),jt=D(e=>`# ${e}
|
|
100
|
+
|
|
101
|
+
A monorepo powered by [vis](https://visulima.com/packages/vis).
|
|
102
|
+
|
|
103
|
+
## Getting Started
|
|
104
|
+
|
|
105
|
+
\`\`\`bash
|
|
106
|
+
# Install dependencies
|
|
107
|
+
pnpm install
|
|
108
|
+
|
|
109
|
+
# Run all apps in development mode
|
|
110
|
+
pnpm dev
|
|
111
|
+
|
|
112
|
+
# Build all packages
|
|
113
|
+
pnpm build
|
|
114
|
+
|
|
115
|
+
# Run tests
|
|
116
|
+
pnpm test
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
## Structure
|
|
120
|
+
|
|
121
|
+
\`\`\`
|
|
122
|
+
├── apps/ # Applications
|
|
123
|
+
├── packages/ # Shared packages & libraries
|
|
124
|
+
├── pnpm-workspace.yaml
|
|
125
|
+
└── package.json
|
|
126
|
+
\`\`\`
|
|
127
|
+
`,"readmeMd"),_t=D(e=>{const{projectName:t,targetDir:r}=e;return o("Scaffolding monorepo workspace..."),w(r),w(l(r,"apps")),w(l(r,"packages")),h(l(r,"package.json"),wt(t)),m("Created package.json"),h(l(r,"pnpm-workspace.yaml"),kt()),m("Created pnpm-workspace.yaml"),h(l(r,".gitignore"),xt()),m("Created .gitignore"),h(l(r,".editorconfig"),$t()),m("Created .editorconfig"),h(l(r,"README.md"),jt(t)),m("Created README.md"),h(l(r,"apps",".gitkeep"),""),h(l(r,"packages",".gitkeep"),""),0},"executeMonorepoTemplate");var Ot=Object.defineProperty,Q=d((e,t)=>Ot(e,"name",{value:t,configurable:!0}),"i");const Ct={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},Nt=Q((e,t,r)=>{const a=Ct[e];if(!a)return t;const i=[...t];if(a.prependCommand&&!i.includes(a.prependCommand)&&i.unshift(a.prependCommand),a.args)for(const u of a.args)i.includes(u)||i.push(u);if(r&&a.monoArgs)for(const u of a.monoArgs)i.includes(u)||i.push(u);return i},"applyAutoFixes"),Pt=Q((e,t)=>{const r=K(t.cwd,t.targetDir)||".",a=[...e.args];a.includes(r)||a.unshift(r);const i=Nt(e.source,a,t.inMonorepo);return o(`Running ${e.source} via ${t.pm.name} dlx...`),de(t.pm,{additionalPackages:[],args:i,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},"executeRemoteNpm"),St=Q(async(e,t)=>{const{createConfig:r}=t;o(`Downloading template from ${e.source}...`);try{const a=await De(e.source,{auth:r?.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:t.targetDir,force:!0,preferOffline:r?.preferOffline,provider:r?.defaultProvider,registry:r?.registry});return o(`Downloaded to ${a.dir}`),0}catch(a){const i=a instanceof Error?a.message:String(a);return R(`Failed to download template: ${i}`),1}},"executeRemoteGit");var Dt=Object.defineProperty,Et=d((e,t)=>Dt(e,"name",{value:t,configurable:!0}),"r");const qt=Et(async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return dt(e,t);case"builtin:generator":return vt(t);case"builtin:monorepo":return _t(t);case"remote:git":return St(e,t);case"remote:npm":return Pt(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},"executeTemplate");var It=Object.defineProperty,O=d((e,t)=>It(e,"name",{value:t,configurable:!0}),"g");const Tt=O(e=>{const t=l(e,".vscode");w(t);const r=l(t,"settings.json"),a={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(P(r))try{const p=se(r);h(r,`${JSON.stringify({...a,...p},null,4)}
|
|
128
|
+
`),m("Merged .vscode/settings.json")}catch{R("Could not merge .vscode/settings.json, skipping")}else h(r,`${JSON.stringify(a,null,4)}
|
|
129
|
+
`),m("Created .vscode/settings.json");const i=l(t,"extensions.json"),u={recommendations:["oxc.oxc-vscode"]};if(P(i))try{const p=se(i);h(i,`${JSON.stringify({...p,recommendations:[...new Set([...p.recommendations||[],...u.recommendations])]},null,4)}
|
|
130
|
+
`),m("Merged .vscode/extensions.json")}catch{R("Could not merge .vscode/extensions.json, skipping")}else h(i,`${JSON.stringify(u,null,4)}
|
|
131
|
+
`),m("Created .vscode/extensions.json")},"generateVscodeConfig"),Rt=O((e,t)=>{const r=l(e,".ai");w(r);const a=l(r,"instructions");if(P(a))return;const i=`# Project Instructions
|
|
132
|
+
|
|
133
|
+
This project was scaffolded with vis create.
|
|
134
|
+
|
|
135
|
+
## Development
|
|
136
|
+
|
|
137
|
+
- Package manager: ${t}
|
|
138
|
+
- Build: \`${t} run build\`
|
|
139
|
+
- Test: \`${t} run test\`
|
|
140
|
+
- Lint: \`${t} run lint\`
|
|
141
|
+
|
|
142
|
+
## Conventions
|
|
143
|
+
|
|
144
|
+
- Use TypeScript strict mode
|
|
145
|
+
- ESM modules (\`"type": "module"\`)
|
|
146
|
+
- Follow Angular-style conventional commits
|
|
147
|
+
`;h(a,i),m("Created .ai/instructions")},"generateAiInstructions"),Mt=O(e=>{ke("git",["init"],{cwd:e,stdio:"pipe"}).status===0?m("Initialized git repository"):R("Failed to initialize git repository")},"initGitRepo"),At=O((e,t,r,a=!1)=>(o("Installing dependencies..."),_e(t,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:a,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},e,r)===0?(m("Dependencies installed"),!0):(R("Dependency installation failed (you can run install manually)"),!1)),"installDependencies"),zt=O(e=>{const t=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",r=t.includes(":")?t.split(":").pop()??t:t;return M(r)||"my-project"},"extractRepoName"),Lt=O(e=>{if(o(""),o(" Built-in templates:"),o(` ${x($("vis:monorepo"))} ${g("Full pnpm workspace setup")}`),o(` ${x($("vis:app"))} ${g("Application scaffold via create-vite")}`),o(` ${x($("vis:library"))} ${g("Reusable TypeScript library package")}`),o(` ${x($("vis:generator"))} ${g("Code generator scaffold with bin entry")}`),e&&Object.keys(e).length>0){o(""),o(" Config aliases (vis.config.ts → create.templates):");for(const[t,r]of Object.entries(e))o(` ${x($(t))}${" ".repeat(Math.max(1,16-t.length))}${g(r)}`)}o(""),o(" Remote templates:"),o(` ${g("Any npm create-* package:")} vis create vite`),o(` ${g("GitHub repository:")} vis create user/repo`),o(` ${g("GitLab / Bitbucket:")} vis create gitlab:user/repo`),o(` ${g("Full URL:")} vis create https://github.com/user/repo`),o(""),o(` ${g("Template args after --:")} vis create vite -- --template react-ts`),o("")},"listTemplates"),Gt=O((e,t,r,a)=>{const i=_(t)===_(e)?"":e;process.stderr.write(`
|
|
148
|
+
`),m("Project created successfully!"),process.stderr.write(`
|
|
149
|
+
`),Oe("Next steps:"),i&&o(` cd ${i}`),a||o(` ${r} install`),o(` ${r} run dev`),process.stderr.write(`
|
|
150
|
+
`)},"printNextSteps"),Ht=O(async({argument:e,logger:t,options:r,rawUnknown:a,visConfig:i,workspaceRoot:u})=>{const p=Array.isArray(e)?e:e?[e]:[],n=i?.create;if(r.list){Lt(n?.templates);return}const c=r.cwd||u||process.cwd(),s=!!u,k=!!process.stdin.isTTY,j=Ce(c);let v,f,y,E=n?.defaultEditor,L=n?.gitInit??!1,X=[],q=j,Z=!1;if(p.length===0&&k&&!r.noInteractive){const b=await it({cwd:c,defaultEditor:n?.defaultEditor,defaultGitInit:n?.gitInit,defaultPm:n?.defaultPm,inMonorepo:s});v=b.template,f=b.projectName,y=_(c,b.targetDir),E=b.editor??E,L=b.gitInit,Z=b.overwrite,b.pm&&(q={name:b.pm,version:j.version})}else{if(p.length===0)throw new Error(`No template specified. Usage: vis create <template> [name] [-- args...]
|
|
151
|
+
Use --list to see available templates, or run interactively in a terminal.`);{let b=[...a??[]];if(b.length===0){const ne=process.argv.slice(2),oe=ne.indexOf("--");oe!==-1&&(b=ne.slice(oe+1))}const C=p.indexOf("--"),ie=C===-1?p:p.slice(0,C);X=[...C===-1?[]:p.slice(C+1),...b],v=ie[0],f=ie[1],f||(f=zt(v)),E=r.editor==="vscode"?"vscode":E,L=!!r.gitInit||L}}if(!v)throw new Error("No template specified.");const G=n?.templates?.[v]??v,ee=Ae(G,X);if(!y){const b=s?ze(ee.type):".",C=tt(f,_(c,b));y=C.targetDir,f=C.packageName}const te=M(f??"");if(!he(te))throw new Error(`Invalid project name: "${f}". Use lowercase alphanumeric characters and hyphens.`);f=te;const ye=_(y),B=K(_(c),ye);if(B===".."||B.startsWith(`..${$e}`)||je(B))throw new Error(`Target directory "${y}" is outside the working directory. Use a name without "../" path segments.`);if(!Z&&!rt(y))throw new Error(`Target directory "${y}" is not empty.
|
|
152
|
+
Use a different name or clear the directory first.`);G!==v&&o(`Alias: ${x($(v))} → ${g(G)}`),o(`Template: ${x($(G))}`),o(`Project: ${x(f)}`),o(`Target: ${g(y)}`),process.stderr.write(`
|
|
153
|
+
`);const re=await qt(ee,{createConfig:n,cwd:c,inMonorepo:s,logger:t,pm:q,projectName:f,targetDir:y});if(re!==0){process.exitCode=re;return}E==="vscode"&&Tt(y),P(y)&&Rt(y,q.name),L&&!s&&Mt(y);let ae=!1;n?.install!==!1&&P(l(y,"package.json"))&&(ae=At(y,q,t,n?.preferOffline)),Gt(y,c,q.name,ae)},"execute");export{Ht as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{a as p,Y as d}from"../packem_shared/bin-BaZZ32BK.js";var f=Object.defineProperty,l=s((e,o)=>f(e,"name",{value:o,configurable:!0}),"t");const k=l(async({logger:e,options:o,visConfig:t,workspaceRoot:r})=>{const a=r??process.cwd(),n=p(a,{configBackend:t?.install?.backend}),c=d(n,o.check||!1,a,e);c!==0&&(process.exitCode=c)},"execute");export{k as default};
|