@velastack/patterns 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/chunks/{_page-44USwLXO.js → _page-6d3DCr0p.js} +2 -2
- package/dist/chunks/{_page-44USwLXO.js.map → _page-6d3DCr0p.js.map} +1 -1
- package/dist/chunks/{auth-pages-BW3_yluN.js → auth-pages-DHzh31mw.js} +2 -2
- package/dist/chunks/{auth-pages-BW3_yluN.js.map → auth-pages-DHzh31mw.js.map} +1 -1
- package/dist/chunks/{collections-B_-NTtLW.js → collections-FKsKGtaH.js} +70 -73
- package/dist/chunks/collections-FKsKGtaH.js.map +1 -0
- package/dist/chunks/{constants-CTp-0HKk.js → constants-BHuzzsKu.js} +19 -19
- package/dist/chunks/constants-BHuzzsKu.js.map +1 -0
- package/dist/chunks/{currency.server-DOX4Rzyb.js → currency.server-DRuEFc6D.js} +4 -4
- package/dist/chunks/{currency.server-DOX4Rzyb.js.map → currency.server-DRuEFc6D.js.map} +1 -1
- package/dist/chunks/{env-vars-BbS_mWyP.js → env-vars-BcHu8247.js} +4 -4
- package/dist/chunks/{env-vars-BbS_mWyP.js.map → env-vars-BcHu8247.js.map} +1 -1
- package/dist/chunks/{generate-B4uDCW5D.js → generate-9O0VdZOl.js} +4 -4
- package/dist/chunks/{generate-B4uDCW5D.js.map → generate-9O0VdZOl.js.map} +1 -1
- package/dist/chunks/{generate-CKuUg3p-.js → generate-BDGmczK8.js} +2 -2
- package/dist/chunks/{generate-CKuUg3p-.js.map → generate-BDGmczK8.js.map} +1 -1
- package/dist/chunks/{generate-DYq5Oj58.js → generate-BrO9MOgL.js} +2 -2
- package/dist/chunks/{generate-DYq5Oj58.js.map → generate-BrO9MOgL.js.map} +1 -1
- package/dist/chunks/{generate-Bwkx_usZ.js → generate-CXAKf1Hh.js} +4 -4
- package/dist/chunks/{generate-Bwkx_usZ.js.map → generate-CXAKf1Hh.js.map} +1 -1
- package/dist/chunks/{generate-4iujJNAW.js → generate-CkfJrlEg.js} +5 -5
- package/dist/chunks/{generate-4iujJNAW.js.map → generate-CkfJrlEg.js.map} +1 -1
- package/dist/chunks/{generate-BJY8AtAp.js → generate-a3U8uDzW.js} +5 -5
- package/dist/chunks/{generate-BJY8AtAp.js.map → generate-a3U8uDzW.js.map} +1 -1
- package/dist/chunks/{generate-JkvSNTy-.js → generate-rcDj36TD.js} +31 -188
- package/dist/chunks/generate-rcDj36TD.js.map +1 -0
- package/dist/chunks/{generate.runtime-D0lI3Gt8.js → generate.runtime-4gS2ZHpj.js} +5 -5
- package/dist/chunks/{generate.runtime-D0lI3Gt8.js.map → generate.runtime-4gS2ZHpj.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BFX_8erf.js → generate.runtime-As1It8o7.js} +10 -9
- package/dist/chunks/{generate.runtime-BFX_8erf.js.map → generate.runtime-As1It8o7.js.map} +1 -1
- package/dist/chunks/{generate.runtime-XT_JQlTk.js → generate.runtime-B5SP9iyN.js} +2 -2
- package/dist/chunks/{generate.runtime-XT_JQlTk.js.map → generate.runtime-B5SP9iyN.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DiEiFoxR.js → generate.runtime-B8t8HtB6.js} +3 -3
- package/dist/chunks/{generate.runtime-DiEiFoxR.js.map → generate.runtime-B8t8HtB6.js.map} +1 -1
- package/dist/chunks/{generate.runtime-XpYi9SlM.js → generate.runtime-B9U3kzHD.js} +3 -3
- package/dist/chunks/{generate.runtime-XpYi9SlM.js.map → generate.runtime-B9U3kzHD.js.map} +1 -1
- package/dist/chunks/{generate.runtime-RTGpwxcS.js → generate.runtime-BDVPJJbh.js} +6 -12
- package/dist/chunks/generate.runtime-BDVPJJbh.js.map +1 -0
- package/dist/chunks/{generate.runtime-CBVcsole.js → generate.runtime-BGLekCHZ.js} +2 -2
- package/dist/chunks/{generate.runtime-CBVcsole.js.map → generate.runtime-BGLekCHZ.js.map} +1 -1
- package/dist/chunks/{generate.runtime-PDnSxiek.js → generate.runtime-BKA41qV0.js} +6 -6
- package/dist/chunks/{generate.runtime-PDnSxiek.js.map → generate.runtime-BKA41qV0.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DhSH1o8H.js → generate.runtime-BKsrh3ZN.js} +3 -3
- package/dist/chunks/{generate.runtime-DhSH1o8H.js.map → generate.runtime-BKsrh3ZN.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BXNBWGYr.js → generate.runtime-BL7O2fy8.js} +2 -2
- package/dist/chunks/{generate.runtime-BXNBWGYr.js.map → generate.runtime-BL7O2fy8.js.map} +1 -1
- package/dist/chunks/{generate.runtime-VMTLHWLk.js → generate.runtime-BOtYaNA5.js} +55 -60
- package/dist/chunks/generate.runtime-BOtYaNA5.js.map +1 -0
- package/dist/chunks/{generate.runtime-bsuqrKOm.js → generate.runtime-BY5VmBG4.js} +2 -2
- package/dist/chunks/{generate.runtime-bsuqrKOm.js.map → generate.runtime-BY5VmBG4.js.map} +1 -1
- package/dist/chunks/{generate.runtime-Dm7IEo2h.js → generate.runtime-BYhWm9JA.js} +5 -5
- package/dist/chunks/{generate.runtime-Dm7IEo2h.js.map → generate.runtime-BYhWm9JA.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D9OC1RXu.js → generate.runtime-BmdO8oKV.js} +2 -2
- package/dist/chunks/{generate.runtime-D9OC1RXu.js.map → generate.runtime-BmdO8oKV.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BROXlbeJ.js → generate.runtime-C7NexMXs.js} +3 -3
- package/dist/chunks/{generate.runtime-BROXlbeJ.js.map → generate.runtime-C7NexMXs.js.map} +1 -1
- package/dist/chunks/{generate.runtime-wiWdXXPi.js → generate.runtime-CFSBH8yG.js} +6 -6
- package/dist/chunks/{generate.runtime-wiWdXXPi.js.map → generate.runtime-CFSBH8yG.js.map} +1 -1
- package/dist/chunks/{generate.runtime-ZgLxGWuy.js → generate.runtime-CG3udLj8.js} +3 -3
- package/dist/chunks/{generate.runtime-ZgLxGWuy.js.map → generate.runtime-CG3udLj8.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DuAYqKxl.js → generate.runtime-CGbSe_nd.js} +2 -2
- package/dist/chunks/{generate.runtime-DuAYqKxl.js.map → generate.runtime-CGbSe_nd.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BU-4sjyu.js → generate.runtime-CI_rUVZo.js} +110 -113
- package/dist/chunks/generate.runtime-CI_rUVZo.js.map +1 -0
- package/dist/chunks/{generate.runtime-CCaCaXNu.js → generate.runtime-COo85dGX.js} +2 -2
- package/dist/chunks/{generate.runtime-CCaCaXNu.js.map → generate.runtime-COo85dGX.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DLoYscQO.js → generate.runtime-CTQvLaU0.js} +3 -3
- package/dist/chunks/{generate.runtime-DLoYscQO.js.map → generate.runtime-CTQvLaU0.js.map} +1 -1
- package/dist/chunks/{generate.runtime-TQmspB4Z.js → generate.runtime-Cc5Aw1zc.js} +27 -34
- package/dist/chunks/generate.runtime-Cc5Aw1zc.js.map +1 -0
- package/dist/chunks/{generate.runtime-B7XOa9_A.js → generate.runtime-CnGVlvxN.js} +3 -3
- package/dist/chunks/{generate.runtime-B7XOa9_A.js.map → generate.runtime-CnGVlvxN.js.map} +1 -1
- package/dist/chunks/{generate.runtime-sjFAWbZc.js → generate.runtime-Cqbsn5Ov.js} +7 -7
- package/dist/chunks/{generate.runtime-sjFAWbZc.js.map → generate.runtime-Cqbsn5Ov.js.map} +1 -1
- package/dist/chunks/{generate.runtime-Cm75waRD.js → generate.runtime-CtV9Gn9T.js} +2 -2
- package/dist/chunks/{generate.runtime-Cm75waRD.js.map → generate.runtime-CtV9Gn9T.js.map} +1 -1
- package/dist/chunks/{generate.runtime-UtkANHk1.js → generate.runtime-Cxa24AOd.js} +3 -3
- package/dist/chunks/{generate.runtime-UtkANHk1.js.map → generate.runtime-Cxa24AOd.js.map} +1 -1
- package/dist/chunks/generate.runtime-CyteiEzT.js +169 -0
- package/dist/chunks/generate.runtime-CyteiEzT.js.map +1 -0
- package/dist/chunks/{generate.runtime-BlEy2fFF.js → generate.runtime-D7EETq9M.js} +3 -3
- package/dist/chunks/{generate.runtime-BlEy2fFF.js.map → generate.runtime-D7EETq9M.js.map} +1 -1
- package/dist/chunks/{generate.runtime-nXjFqHyb.js → generate.runtime-DaJ4gLPv.js} +4 -4
- package/dist/chunks/{generate.runtime-nXjFqHyb.js.map → generate.runtime-DaJ4gLPv.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D6l6uLiY.js → generate.runtime-DcBEbV-k.js} +2 -2
- package/dist/chunks/{generate.runtime-D6l6uLiY.js.map → generate.runtime-DcBEbV-k.js.map} +1 -1
- package/dist/chunks/{generate.runtime-B8-ORwxT.js → generate.runtime-DiAnQ9MW.js} +6 -6
- package/dist/chunks/{generate.runtime-B8-ORwxT.js.map → generate.runtime-DiAnQ9MW.js.map} +1 -1
- package/dist/chunks/{generate.runtime-Duw_JI_b.js → generate.runtime-Dp3x08St.js} +2 -2
- package/dist/chunks/{generate.runtime-Duw_JI_b.js.map → generate.runtime-Dp3x08St.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D77ueFKY.js → generate.runtime-DsW0Q5S5.js} +118 -134
- package/dist/chunks/generate.runtime-DsW0Q5S5.js.map +1 -0
- package/dist/chunks/{generate.runtime-27KTIg_o.js → generate.runtime-DtcKbzOm.js} +48 -53
- package/dist/chunks/generate.runtime-DtcKbzOm.js.map +1 -0
- package/dist/chunks/{generate.runtime-DxyQqNpu.js → generate.runtime-ICaKVEuW.js} +5 -11
- package/dist/chunks/generate.runtime-ICaKVEuW.js.map +1 -0
- package/dist/chunks/{generate.runtime-CuvdtjKc.js → generate.runtime-SZInujfP.js} +2 -2
- package/dist/chunks/{generate.runtime-CuvdtjKc.js.map → generate.runtime-SZInujfP.js.map} +1 -1
- package/dist/chunks/gitignore-CPardo4E.js +139 -0
- package/dist/chunks/gitignore-CPardo4E.js.map +1 -0
- package/dist/chunks/{i18n-mnzzcYhz.js → i18n-C8OfN_nr.js} +2 -2
- package/dist/chunks/{i18n-mnzzcYhz.js.map → i18n-C8OfN_nr.js.map} +1 -1
- package/dist/chunks/{modify-file-CgJIza72.js → modify-file-DvIwtj4o.js} +3 -3
- package/dist/chunks/{modify-file-CgJIza72.js.map → modify-file-DvIwtj4o.js.map} +1 -1
- package/dist/chunks/pocketbase-Ir-TPv7H.js +232 -0
- package/dist/chunks/pocketbase-Ir-TPv7H.js.map +1 -0
- package/dist/chunks/{providers-CDUFaOeQ.js → providers-B386TYCN.js} +3 -3
- package/dist/chunks/{providers-CDUFaOeQ.js.map → providers-B386TYCN.js.map} +1 -1
- package/dist/chunks/{providers-tjlFH5di.js → providers-DrK_hjSr.js} +2 -2
- package/dist/chunks/{providers-tjlFH5di.js.map → providers-DrK_hjSr.js.map} +1 -1
- package/dist/chunks/route-BJBV1DtX.js +162 -0
- package/dist/chunks/route-BJBV1DtX.js.map +1 -0
- package/dist/chunks/schema-DSNYWlel.js +116 -0
- package/dist/chunks/schema-DSNYWlel.js.map +1 -0
- package/dist/chunks/shared-BofFBVmT.js +1182 -0
- package/dist/chunks/shared-BofFBVmT.js.map +1 -0
- package/dist/chunks/{shared-BjTRQ5QH.js → shared-CZHopdly.js} +3 -3
- package/dist/chunks/{shared-BjTRQ5QH.js.map → shared-CZHopdly.js.map} +1 -1
- package/dist/chunks/{site-C8Wcg6LT.js → site-B9-emR6D.js} +3 -3
- package/dist/chunks/{site-C8Wcg6LT.js.map → site-B9-emR6D.js.map} +1 -1
- package/dist/chunks/{table-core-RvMjoXpT.js → table-core-CHsfbi-n.js} +3 -3
- package/dist/chunks/{table-core-RvMjoXpT.js.map → table-core-CHsfbi-n.js.map} +1 -1
- package/dist/chunks/test-setup-jqVMmL83.js +103 -0
- package/dist/chunks/test-setup-jqVMmL83.js.map +1 -0
- package/dist/chunks/{ui-CE-8llQS.js → ui-BUhkIHse.js} +3 -3
- package/dist/chunks/{ui-CE-8llQS.js.map → ui-BUhkIHse.js.map} +1 -1
- package/dist/chunks/{util-ILWdjRAd.js → util-mXrQ89nG.js} +8 -2
- package/dist/chunks/util-mXrQ89nG.js.map +1 -0
- package/dist/chunks/{whatsapp-DT10x76l.js → whatsapp-DFZUsKWe.js} +2 -2
- package/dist/chunks/{whatsapp-DT10x76l.js.map → whatsapp-DFZUsKWe.js.map} +1 -1
- package/dist/chunks/write-result-Bkdkp7u2.js +539 -0
- package/dist/chunks/write-result-Bkdkp7u2.js.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +2388 -3276
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunks/collections-B_-NTtLW.js.map +0 -1
- package/dist/chunks/constants-CTp-0HKk.js.map +0 -1
- package/dist/chunks/generate-JkvSNTy-.js.map +0 -1
- package/dist/chunks/generate.runtime-27KTIg_o.js.map +0 -1
- package/dist/chunks/generate.runtime-BU-4sjyu.js.map +0 -1
- package/dist/chunks/generate.runtime-D77ueFKY.js.map +0 -1
- package/dist/chunks/generate.runtime-Dn0_y2iV.js +0 -161
- package/dist/chunks/generate.runtime-Dn0_y2iV.js.map +0 -1
- package/dist/chunks/generate.runtime-DxyQqNpu.js.map +0 -1
- package/dist/chunks/generate.runtime-RTGpwxcS.js.map +0 -1
- package/dist/chunks/generate.runtime-TQmspB4Z.js.map +0 -1
- package/dist/chunks/generate.runtime-VMTLHWLk.js.map +0 -1
- package/dist/chunks/pocketbase-S8lUt0nI.js +0 -219
- package/dist/chunks/pocketbase-S8lUt0nI.js.map +0 -1
- package/dist/chunks/test-setup-CpjhQSl-.js +0 -176
- package/dist/chunks/test-setup-CpjhQSl-.js.map +0 -1
- package/dist/chunks/util-ILWdjRAd.js.map +0 -1
- package/dist/chunks/write-result-BguSfKV-.js +0 -499
- package/dist/chunks/write-result-BguSfKV-.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-result-Bkdkp7u2.js","names":["__import_glob__0_0_","__import_glob__0_1_","__import_glob__0_2_","__import_glob__0_3_","__import_glob__0_4_","__import_glob__0_5_","__import_glob__0_6_","__import_glob__0_7_","__import_glob__0_8_","__import_glob__0_9_","__import_glob__0_10_","__import_glob__0_11_","__import_glob__0_12_","__import_glob__0_13_","__import_glob__0_14_","__import_glob__0_15_","__import_glob__0_16_","__import_glob__0_17_","__import_glob__0_18_","__import_glob__0_19_","__import_glob__0_20_","__import_glob__0_21_","__import_glob__0_22_","__import_glob__0_23_","__import_glob__0_24_","__import_glob__0_25_","__import_glob__0_26_","__import_glob__0_27_","__import_glob__0_28_","__import_glob__0_29_","__import_glob__0_30_","__import_glob__0_31_","__import_glob__0_32_","__import_glob__0_33_","__import_glob__0_34_","__import_glob__0_35_","__import_glob__0_36_","__import_glob__0_37_","__import_glob__0_38_","__import_glob__0_39_","__import_glob__0_40_","__import_glob__0_41_","__import_glob__0_42_","__import_glob__0_43_","__import_glob__0_44_","__import_glob__0_45_","__import_glob__0_46_","__import_glob__0_47_","__import_glob__0_48_","__import_glob__0_49_","__import_glob__0_50_","__import_glob__0_51_","__import_glob__0_52_","__import_glob__0_53_","__import_glob__0_54_","__import_glob__0_55_","__import_glob__0_56_","__import_glob__0_57_","__import_glob__0_58_","__import_glob__0_59_","__import_glob__0_60_","__import_glob__0_61_","__import_glob__0_62_","__import_glob__0_63_","__import_glob__0_64_","__exportAll","MissingShadcnError","RegistryUnavailableError","InvalidArgumentError","getLogger","NOOP_LOGGER","formatSource","TANSTACK_TABLE_CORE","SUPERFORMS_VERSION","FORMSNAP","SUPERFORMS","readComponentsConfig","fetchRegistryIndex","assertTableCorePackage","registryIndexUrl","resolveUiDir","assertRegistryPagination","path","spawn","os","auth_menu_content_default","auth_menu_group_default","auth_menu_item_default","auth_menu_label_default","auth_menu_separator_default","auth_menu_trigger_default","auth_menu_default$1","context_default","auth_menu_default","autodate_default","bool_default","date_default","editor_default","email_default","file_default","geoPoint_default","cells_default","json_default","number_default","password_default","relation_default","select_default","text_default","url_default","column_header_default$1","column_header_default","data_table_svelte_default","flex_render_default","data_table_default","render_helpers_default","data_table_pagination_default$1","data_table_pagination_default","faceted_filter_default$1","faceted_filter_default","file_field_default","file_input_default","file_multiple_default","file_single_default","file_thumb_default","file_form_default","shared_default","form_button_default","form_description_default","form_element_field_default","form_field_errors_default","form_field_default","form_fieldset_default","form_label_default","form_legend_default","form_default","coordinate_default","geopoint_default","input_default$1","toggle_map_default","leaflet_default$1","leaflet_default","chip_default","content_default","field_default","multiselect_default","input_default","item_default","trigger_default","row_actions_default$1","row_actions_default","write_result_exports","assertComponentsAvailable","installComponents","writeResult","customDependencies","customNpmPackages","customComponentAssets","getAllCustomComponents","componentNameFromAssetPath","parts","assetPath","componentRelativeAssetPath","index","toTargetPath","filePath","root","toRelativePath","writeFile","mkdirSync","writeFileSync","content","removeFile","existsSync","rmSync","pruneEmptyDirectories","stop","current","dir","readdirSync","EXACT_FLAG","executeWithDetectedPackageManager","packageManager","detect","resolved","resolveCommand","operation","args","commandArgs","exactFlag","options","child","reject","code","resolve","executeCommand","restoreTypes","preserveSvelteKitTypes","cwd","runtime","installedPackagesFromProject","packageJsonPath","packageJson","readFileSync","packageName","at","spec","isExactSpec","name","reconcileFormsnap","names","toInstall","formsnap","installed","touched","file","text","pkg","changed","formsnapRange","wantedFloor","rangeFloor","block","DEPENDENCY_BLOCKS","deps","floor","compareFloors","overrides","entry","_","rest","__","others","next","indent","logger","appDir","saved","mkdtempSync","cpSync","ensureSvelteKitSync","error","match","part","value","i","a","b","restoreDowngradedDependencies","after","restored","previous","before","entries","old","oldFloor","newFloor","readPackageJson","installPackages","packages","exact","ranged","uninstallPackages","toRemove","isCustomComponent","component","customNpmPackagesFor","components","copyCustomComponent","targetDir","targetComponentsDir","relativePath","outputPath","FORMATTABLE_EXTENSIONS","filesUnder","target","statSync","formatPaths","context","paths","formatted","fileDigests","digests","dirs","createHash","filesWrittenSince","digest","installedComponents","uiDir","BARE_ITEM_NAME","REGISTRY_RETRY_MS","registryUnavailableAt","assertKnownRegistryItems","bare","config","url","fetchImpl","failedAt","known","item","failures","unknown","planComponentInstall","requested","componentsDir","isPresent","skipped","overwrite","customToInstall","publicToInstall","dependency","assertPlanInstallable","plan","applyComponentPlan","customList","publicList","shadcnDirs","beforeShadcn","formatWritten","recorded","had","writtenResult","componentPlan","result","dropMigrationCreates","n","dropCollections","isPackageJson","packageInstalls","componentInstalls","packageUninstalls","_written","reported"],"sources":["../../src/runtime/write-result.ts"],"sourcesContent":["import {\n cpSync,\n existsSync,\n mkdirSync,\n mkdtempSync,\n readdirSync,\n readFileSync,\n rmSync,\n statSync,\n writeFileSync,\n} from \"node:fs\";\nimport { createHash } from \"node:crypto\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { detect } from \"package-manager-detector\";\nimport { resolveCommand } from \"package-manager-detector/commands\";\nimport spawn from \"cross-spawn\";\nimport type {\n Component,\n ExecuteCommandOptions,\n InstallComponentsOptions,\n InstallComponentsResult,\n Options,\n PackageManagerOperation,\n Result,\n WriteResultRuntime,\n} from \"../core/types\";\nimport {\n InvalidArgumentError,\n MissingShadcnError,\n RegistryUnavailableError,\n} from \"../core/errors\";\nimport { getLogger, NOOP_LOGGER, type Logger } from \"../core/logger\";\nimport { formatSource } from \"../core/format-result\";\nimport {\n FORMSNAP,\n SUPERFORMS,\n SUPERFORMS_VERSION,\n TANSTACK_TABLE_CORE,\n} from \"../core/constants\";\nimport {\n fetchRegistryIndex,\n readComponentsConfig,\n registryIndexUrl,\n resolveUiDir,\n} from \"./registry\";\nimport { assertRegistryPagination, assertTableCorePackage } from \"./table-core\";\n\nexport { resolveUiDir };\n\ntype CustomNpmPackages = Record<string, string[]>;\n\n/**\n * The components under `src/ui/components` are copied into a project rather\n * than fetched from the shadcn-svelte registry, so their dependencies have to\n * be declared here: every shadcn-svelte component a bundled one imports\n * (`#lib/components/ui/<x>/index.js`) must appear in `customDependencies`, and\n * every npm package that no shadcn item installs for it must appear in\n * `customNpmPackages`.\n *\n * `form` is shadcn-svelte's own formsnap wrapper as it last shipped it: the\n * registry dropped the item from every style on 2026-11-24\n * (huntabyte/shadcn-svelte#2989), and the superforms pages the patterns\n * generate are built on it.\n */\nexport const customDependencies: Record<string, string[]> = {\n \"file-form\": [\"input\"],\n form: [\"label\", \"button\"],\n multiselect: [\"command\", \"popover\", \"button\"],\n geopoint: [\"button\", \"leaflet\"],\n cells: [\"badge\"],\n \"data-table\": [],\n \"column-header\": [\"dropdown-menu\", \"button\"],\n \"faceted-filter\": [\"command\", \"popover\", \"button\", \"separator\", \"badge\"],\n \"data-table-pagination\": [\"pagination\", \"select\"],\n \"row-actions\": [\"dropdown-menu\", \"button\"],\n leaflet: [],\n \"auth-menu\": [\"dropdown-menu\", \"button\"],\n};\n\nconst customNpmPackages: CustomNpmPackages = {\n \"file-form\": [FORMSNAP],\n // What the registry item used to record. Superforms is named because the\n // field components import its path types.\n form: [FORMSNAP, SUPERFORMS],\n multiselect: [FORMSNAP],\n geopoint: [],\n cells: [],\n // shadcn-svelte >= 1.2.0 resolves items from the style-scoped registry\n // (/registry/styles/<style>/), which has no `data-table` item, so the\n // TanStack helpers ship from here instead.\n \"data-table\": [TANSTACK_TABLE_CORE],\n \"column-header\": [TANSTACK_TABLE_CORE],\n \"faceted-filter\": [TANSTACK_TABLE_CORE],\n \"data-table-pagination\": [TANSTACK_TABLE_CORE],\n \"row-actions\": [],\n leaflet: [\"leaflet\", \"@types/leaflet\"],\n};\n\nconst customComponentAssets = import.meta.glob<string>(\"../ui/components/**\", {\n query: \"?raw\",\n import: \"default\",\n eager: true,\n});\n\n/** The components this package ships, by directory name, sorted. */\nexport function getAllCustomComponents(): Component[] {\n return [\n ...new Set(\n Object.keys(customComponentAssets).map(componentNameFromAssetPath),\n ),\n ]\n .filter(Boolean)\n .sort();\n}\n\nfunction componentNameFromAssetPath(assetPath: string): string {\n const parts = assetPath.split(\"/\");\n const index = parts.indexOf(\"components\");\n return parts[index + 1] ?? \"\";\n}\n\nfunction componentRelativeAssetPath(assetPath: string): string {\n const parts = assetPath.split(\"/\");\n const index = parts.indexOf(\"components\");\n return parts.slice(index + 2).join(\"/\");\n}\n\nfunction toTargetPath(root: string, filePath: string): string {\n if (path.isAbsolute(filePath)) {\n return filePath;\n }\n return path.join(root, filePath);\n}\n\nfunction toRelativePath(root: string, filePath: string): string {\n if (path.isAbsolute(filePath)) {\n return path.relative(root, filePath);\n }\n return filePath;\n}\n\nfunction writeFile(filePath: string, content: string): void {\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, content, \"utf8\");\n}\n\nfunction removeFile(filePath: string, root: string): void {\n if (!existsSync(filePath)) {\n return;\n }\n\n rmSync(filePath, { force: true, recursive: true });\n pruneEmptyDirectories(path.dirname(filePath), root);\n}\n\n/**\n * Deleting a feature's files must also delete the directories it added, up\n * to the first one that still has content. The CLI detects features by\n * directory (`src/routes/(app)` means auth is on), so an empty leftover\n * directory keeps a disabled feature \"enabled\".\n */\nfunction pruneEmptyDirectories(dir: string, root: string): void {\n const stop = path.resolve(root);\n let current = path.resolve(dir);\n while (current !== stop && current.startsWith(stop)) {\n if (!existsSync(current) || readdirSync(current).length > 0) {\n return;\n }\n rmSync(current, { recursive: true, force: true });\n current = path.dirname(current);\n }\n}\n\n/** Each package manager's flag for saving the exact version instead of a range. */\nconst EXACT_FLAG: Record<string, string> = {\n npm: \"--save-exact\",\n pnpm: \"--save-exact\",\n yarn: \"--exact\",\n bun: \"--exact\",\n};\n\nasync function executeWithDetectedPackageManager(\n cwd: string,\n operation: PackageManagerOperation,\n args: string[],\n options: ExecuteCommandOptions = {},\n): Promise<void> {\n const packageManager = (await detect({ cwd }))?.name ?? \"npm\";\n // Adding named packages is `add` (`npm i`, `pnpm add`, `yarn add`):\n // `yarn install <pkg>` is an error.\n const resolved = resolveCommand(\n packageManager,\n operation === \"install\" && args.length > 0 ? \"add\" : operation,\n args,\n );\n if (!resolved) {\n throw new Error(\n `Unable to resolve ${operation} command for ${packageManager}`,\n );\n }\n\n const commandArgs = [...resolved.args];\n if (packageManager === \"npm\") {\n commandArgs.unshift(\"--yes\");\n }\n const exactFlag = EXACT_FLAG[packageManager];\n if (options.exact && exactFlag) {\n commandArgs.push(exactFlag);\n }\n\n await new Promise<void>((resolve, reject) => {\n const child = spawn(resolved.command, commandArgs, {\n cwd,\n stdio: \"inherit\",\n });\n child.on(\"error\", reject);\n child.on(\"exit\", (code) => {\n if (code === 0) {\n resolve();\n return;\n }\n reject(\n new Error(`${resolved.command} exited with code ${code ?? \"unknown\"}`),\n );\n });\n });\n}\n\nexport async function executeCommand(\n cwd: string,\n operation: PackageManagerOperation,\n args: string[],\n runtime?: WriteResultRuntime,\n options?: ExecuteCommandOptions,\n): Promise<void> {\n const restoreTypes =\n operation === \"execute\" ? null : preserveSvelteKitTypes(cwd);\n try {\n if (runtime?.executeCommand) {\n await (options\n ? runtime.executeCommand(cwd, operation, args, options)\n : runtime.executeCommand(cwd, operation, args));\n return;\n }\n\n await executeWithDetectedPackageManager(cwd, operation, args, options);\n } finally {\n restoreTypes?.();\n }\n}\n\n/** Package names `package.json` records, whichever dependency block they sit in. */\nexport function installedPackagesFromProject(root: string): Set<string> {\n const packageJsonPath = path.join(root, \"package.json\");\n if (!existsSync(packageJsonPath)) {\n return new Set();\n }\n\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n optionalDependencies?: Record<string, string>;\n peerDependencies?: Record<string, string>;\n };\n\n return new Set([\n ...Object.keys(packageJson.dependencies ?? {}),\n ...Object.keys(packageJson.devDependencies ?? {}),\n ...Object.keys(packageJson.optionalDependencies ?? {}),\n ...Object.keys(packageJson.peerDependencies ?? {}),\n ]);\n}\n\n/**\n * Splits an npm install spec into its package name, dropping any range.\n * `wuchale@^0.26.3` -> `wuchale`, `@wuchale/svelte@^0.21.1` -> `@wuchale/svelte`.\n *\n * The name is what `package.json` records, so it -- not the full spec -- is what\n * the already-installed check has to compare against.\n */\nexport function packageName(spec: string): string {\n const at = spec.indexOf(\"@\", spec.startsWith(\"@\") ? 1 : 0);\n return at === -1 ? spec : spec.slice(0, at);\n}\n\n/**\n * A spec naming one exact version (`sveltekit-superforms@3.0.0`),\n * which is saved as written. Package managers otherwise save a caret, and a\n * caret on a prerelease follows every later `next` build.\n */\nexport function isExactSpec(spec: string): boolean {\n const name = packageName(spec);\n return /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/.test(\n spec.slice(name.length + 1),\n );\n}\n\n/**\n * formsnap 2.1 is the first release whose superforms peer admits 3.x, and\n * npm reads that `^3.0.0` peer as excluding `3.0.0-next.*`. Before an install\n * brings formsnap or superforms in next to the other, package.json is moved\n * to what resolves: a `3.0.0-next` superforms pin to the release, a formsnap\n * range below 2.1 to `FORMSNAP`, and the `overrides` entry earlier releases\n * wrote for formsnap 2.0 goes. Left as it is, `npm install` either stops with\n * ERESOLVE or keeps the formsnap 2.0 its lockfile holds, whose peer\n * superforms 3 does not meet.\n */\nfunction reconcileFormsnap(\n root: string,\n installed: Set<string>,\n toInstall: string[],\n logger: Logger,\n): void {\n const names = new Set(toInstall.map(packageName));\n const formsnap = names.has(\"formsnap\") || installed.has(\"formsnap\");\n const touched = names.has(\"formsnap\") || names.has(\"sveltekit-superforms\");\n if (!formsnap || !touched) {\n return;\n }\n const file = path.join(root, \"package.json\");\n if (!existsSync(file)) {\n return;\n }\n const text = readFileSync(file, \"utf8\");\n const pkg = JSON.parse(text) as Record<string, unknown>;\n const changed: string[] = [];\n\n const formsnapRange = FORMSNAP.slice(packageName(FORMSNAP).length + 1);\n const wantedFloor = rangeFloor(formsnapRange)!;\n for (const block of DEPENDENCY_BLOCKS) {\n const deps = pkg[block] as Record<string, string> | undefined;\n if (!deps) {\n continue;\n }\n if (deps[\"sveltekit-superforms\"]?.startsWith(\"3.0.0-\")) {\n deps[\"sveltekit-superforms\"] = SUPERFORMS_VERSION;\n changed.push(`sveltekit-superforms → ${SUPERFORMS_VERSION}`);\n }\n const floor =\n deps.formsnap === undefined ? null : rangeFloor(deps.formsnap);\n if (floor && compareFloors(floor, wantedFloor) < 0) {\n deps.formsnap = formsnapRange;\n changed.push(`formsnap → ${formsnapRange}`);\n }\n }\n\n const overrides = pkg.overrides as Record<string, unknown> | undefined;\n const entry = overrides?.formsnap;\n if (\n typeof entry === \"object\" &&\n entry !== null &&\n \"sveltekit-superforms\" in entry\n ) {\n const { \"sveltekit-superforms\": _, ...rest } = entry as Record<\n string,\n unknown\n >;\n const { formsnap: __, ...others } = overrides!;\n const next =\n Object.keys(rest).length > 0 ? { ...others, formsnap: rest } : others;\n if (Object.keys(next).length > 0) {\n pkg.overrides = next;\n } else {\n delete pkg.overrides;\n }\n changed.push(\"dropped the overrides entry formsnap 2.0 needed\");\n }\n\n if (changed.length === 0) {\n return;\n }\n const indent = text.match(/^[{]\\s*\\n([\\t ]+)/)?.[1] ?? \"\\t\";\n writeFileSync(file, `${JSON.stringify(pkg, null, indent)}\\n`, \"utf8\");\n logger.info(`formsnap 2.1 peers superforms 3: ${changed.join(\", \")}`);\n}\n\n/**\n * SvelteKit 3's tsconfig extends `$app/tsconfig`, which `svelte-kit sync`\n * writes to `node_modules/$app`. A package-manager install prunes that folder\n * (it is no package) and only an argument-less npm install's `prepare` writes\n * it back, so after `npm install <pkg>` every tool that reads the tsconfig\n * (shadcn-svelte, svelte-check without sync, the editor) fails on the missing\n * `extends`. Syncing again is no fix mid-pattern: it loads vite.config, which\n * may already name a plugin whose own config the pattern has not written yet.\n * So the folder is copied aside before an install and put back after.\n */\nfunction preserveSvelteKitTypes(root: string): (() => void) | null {\n const appDir = path.join(root, \"node_modules\", \"$app\");\n if (!existsSync(appDir)) {\n return null;\n }\n const saved = mkdtempSync(path.join(os.tmpdir(), \"vela-app-types-\"));\n cpSync(appDir, path.join(saved, \"$app\"), { recursive: true });\n return () => {\n try {\n if (!existsSync(appDir) && existsSync(path.join(root, \"node_modules\"))) {\n cpSync(path.join(saved, \"$app\"), appDir, { recursive: true });\n }\n } finally {\n rmSync(saved, { recursive: true, force: true });\n }\n };\n}\n\n/**\n * Run `svelte-kit sync` when SvelteKit is installed but `node_modules/$app`\n * is missing (a fresh copy of `node_modules`, or an install made outside\n * vela), so shadcn-svelte can read the tsconfig. Best effort: a sync that\n * fails is reported and left to shadcn-svelte to complain about.\n */\nexport async function ensureSvelteKitSync(\n root: string,\n runtime?: WriteResultRuntime,\n logger: Logger = NOOP_LOGGER,\n): Promise<boolean> {\n if (!existsSync(path.join(root, \"node_modules\", \"@sveltejs\", \"kit\"))) {\n return false;\n }\n if (existsSync(path.join(root, \"node_modules\", \"$app\", \"tsconfig.json\"))) {\n return false;\n }\n try {\n await executeCommand(root, \"execute\", [\"svelte-kit\", \"sync\"], runtime);\n return true;\n } catch (error) {\n logger.info(\n `svelte-kit sync failed (${error instanceof Error ? error.message : String(error)}); node_modules/$app is missing`,\n );\n return false;\n }\n}\n\ntype DependencyBlocks = Record<string, Record<string, string> | undefined>;\n\nconst DEPENDENCY_BLOCKS = [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n] as const;\n\n/** The lowest version a range names, as numbers, or null when it is no semver range. */\nfunction rangeFloor(spec: string): number[] | null {\n const match = spec\n .trim()\n .match(\n /^(?:[\\^~=v]|>=?)?\\s*(\\d+)(?:\\.(\\d+|[xX*]))?(?:\\.(\\d+|[xX*]))?(-[0-9A-Za-z.-]+)?$/,\n );\n if (!match) {\n return null;\n }\n const part = (value: string | undefined) =>\n value === undefined || /[xX*]/.test(value) ? 0 : Number(value);\n // A prerelease sorts below its release.\n return [part(match[1]), part(match[2]), part(match[3]), match[4] ? 0 : 1];\n}\n\nfunction compareFloors(a: number[], b: number[]): number {\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return a[i]! - b[i]!;\n }\n }\n return 0;\n}\n\n/**\n * The dependency entries `shadcn-svelte add` changed that have to go back:\n * shadcn replaces any range its registry item's own range does not cover,\n * downgrades included. The form item asked for `sveltekit-superforms` ^2,\n * which SvelteKit 3 cannot install, over the project's 3.x pin (the item is\n * gone from the registry and `form` ships from this package now, but any\n * item may do the same to another package). So an\n * entry the project already had is restored when shadcn moved it below\n * where it was, or when it is not a semver range at all (file:, git,\n * workspace:). A raised floor and every new entry are kept.\n */\nexport function restoreDowngradedDependencies(\n before: DependencyBlocks,\n after: DependencyBlocks,\n): { pkg: DependencyBlocks; restored: string[] } {\n const pkg: DependencyBlocks = { ...after };\n const restored: string[] = [];\n const previous = new Map<string, string>();\n for (const block of DEPENDENCY_BLOCKS) {\n for (const [name, spec] of Object.entries(before[block] ?? {})) {\n previous.set(name, spec);\n }\n }\n for (const block of DEPENDENCY_BLOCKS) {\n const entries = after[block];\n if (!entries) {\n continue;\n }\n for (const [name, spec] of Object.entries(entries)) {\n const old = previous.get(name);\n if (old === undefined || old === spec) {\n continue;\n }\n const oldFloor = rangeFloor(old);\n const newFloor = rangeFloor(spec);\n const keep =\n oldFloor !== null &&\n newFloor !== null &&\n compareFloors(newFloor, oldFloor) >= 0;\n if (keep) {\n continue;\n }\n pkg[block] = { ...(pkg[block] as Record<string, string>), [name]: old };\n restored.push(`${name}@${old}`);\n }\n }\n return { pkg, restored };\n}\n\nfunction readPackageJson(root: string): Record<string, unknown> | null {\n const file = path.join(root, \"package.json\");\n if (!existsSync(file)) {\n return null;\n }\n return JSON.parse(readFileSync(file, \"utf8\")) as Record<string, unknown>;\n}\n\nasync function installPackages(\n root: string,\n packages: string[],\n runtime?: WriteResultRuntime,\n logger: Logger = NOOP_LOGGER,\n): Promise<string[]> {\n if (packages.length === 0) {\n return [];\n }\n\n const installed = installedPackagesFromProject(root);\n const toInstall = [...new Set(packages)].filter(\n (pkg) => !installed.has(packageName(pkg)),\n );\n if (toInstall.length === 0) {\n return [];\n }\n\n reconcileFormsnap(root, installed, toInstall, logger);\n\n logger.info(`Installing packages: ${toInstall.join(\", \")}`);\n // `--save-exact` applies to a whole command, so exact pins go in their own.\n const exact = toInstall.filter(isExactSpec);\n const ranged = toInstall.filter((spec) => !isExactSpec(spec));\n if (exact.length > 0) {\n await executeCommand(root, \"install\", exact, runtime, { exact: true });\n }\n if (ranged.length > 0) {\n await executeCommand(root, \"install\", ranged, runtime);\n }\n return toInstall;\n}\n\n/**\n * `npm uninstall` for the listed packages that `package.json` records. The\n * inverse of `installPackages`: names not present are skipped, so a disable\n * pattern can name everything its enable counterpart installed.\n */\nasync function uninstallPackages(\n root: string,\n packages: string[],\n runtime?: WriteResultRuntime,\n logger: Logger = NOOP_LOGGER,\n): Promise<string[]> {\n if (packages.length === 0) {\n return [];\n }\n\n const installed = installedPackagesFromProject(root);\n const toRemove = [...new Set(packages.map(packageName))].filter((pkg) =>\n installed.has(pkg),\n );\n if (toRemove.length === 0) {\n return [];\n }\n\n logger.info(`Removing packages: ${toRemove.join(\", \")}`);\n await executeCommand(root, \"uninstall\", toRemove, runtime);\n return toRemove;\n}\n\nexport function isCustomComponent(component: string): boolean {\n return getAllCustomComponents().includes(component);\n}\n\nfunction customNpmPackagesFor(components: string[]): string[] {\n return [\n ...new Set(\n components.flatMap((component) => customNpmPackages[component] ?? []),\n ),\n ];\n}\n\nfunction copyCustomComponent(\n component: string,\n targetComponentsDir: string,\n): void {\n const targetDir = path.join(targetComponentsDir, component);\n mkdirSync(targetDir, { recursive: true });\n\n for (const [assetPath, content] of Object.entries(customComponentAssets)) {\n if (componentNameFromAssetPath(assetPath) !== component) {\n continue;\n }\n const relativePath = componentRelativeAssetPath(assetPath);\n if (!relativePath) {\n continue;\n }\n\n const outputPath = path.join(targetDir, relativePath);\n mkdirSync(path.dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, content, \"utf8\");\n }\n}\n\nconst FORMATTABLE_EXTENSIONS = new Set([\n \".ts\",\n \".js\",\n \".svelte\",\n \".json\",\n \".css\",\n]);\n\nfunction* filesUnder(target: string): Generator<string> {\n if (!existsSync(target)) {\n return;\n }\n if (statSync(target).isFile()) {\n yield target;\n return;\n }\n const entries = readdirSync(target, { recursive: true, withFileTypes: true });\n for (const entry of entries) {\n if (entry.isFile()) {\n yield path.join(entry.parentPath, entry.name);\n }\n }\n}\n\n/**\n * `shadcn-svelte add` and `apply` write files in the registry's style and the\n * bundled components carry this repo's; the project's `npm run lint` expects\n * its own. Runs the project's prettier over the given files and directories\n * (relative to the root or absolute) and returns the relative paths it\n * changed. Paths that do not exist are skipped.\n */\nexport async function formatPaths(\n root: string,\n paths: string[],\n): Promise<string[]> {\n const context = { env: \"runtime\" as const, root };\n const changed: string[] = [];\n for (const target of paths) {\n for (const filePath of filesUnder(toTargetPath(root, target))) {\n if (!FORMATTABLE_EXTENSIONS.has(path.extname(filePath))) {\n continue;\n }\n const content = readFileSync(filePath, \"utf8\");\n const formatted = await formatSource(content, filePath, context);\n if (formatted !== content) {\n writeFileSync(filePath, formatted, \"utf8\");\n changed.push(path.relative(root, filePath));\n }\n }\n }\n return changed;\n}\n\n/**\n * A digest of every file under the given directories. Content, not mtime: a\n * file rewritten within the filesystem's timestamp tick keeps its mtime.\n */\nfunction fileDigests(dirs: string[]): Map<string, string> {\n const digests = new Map<string, string>();\n for (const dir of dirs) {\n for (const filePath of filesUnder(dir)) {\n digests.set(\n filePath,\n createHash(\"sha1\").update(readFileSync(filePath)).digest(\"hex\"),\n );\n }\n }\n return digests;\n}\n\n/** The files under the directories that are new or changed since `before`. */\nfunction filesWrittenSince(\n before: Map<string, string>,\n dirs: string[],\n): string[] {\n return [...fileDigests(dirs)]\n .filter(([filePath, digest]) => before.get(filePath) !== digest)\n .map(([filePath]) => filePath);\n}\n\n/** The component directories a project has, sorted. */\nexport function installedComponents(root: string): Component[] {\n const uiDir = resolveUiDir(root);\n if (!existsSync(uiDir)) {\n return [];\n }\n return readdirSync(uiDir, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name)\n .sort();\n}\n\n/** Bare item names are checked against the index; URLs and `@scope/item` are shadcn's to resolve. */\nconst BARE_ITEM_NAME = /^[a-z0-9][a-z0-9-]*$/i;\n\n/**\n * How long an unreachable registry is left alone. One command checks the\n * names up to three times (a pattern's preflight, `writeResult`,\n * `installComponents`); offline, only the first should wait out the timeout\n * and say so. Short, so a long-lived caller asks again once it may be online.\n */\nconst REGISTRY_RETRY_MS = 30_000;\n\nconst registryUnavailableAt = new WeakMap<typeof fetch, Map<string, number>>();\n\n/**\n * A name the style's registry does not list would otherwise reach\n * `shadcn-svelte add`, which fails after a fetch with a message that never\n * mentions the style. Skipped when the registry cannot be read: shadcn will\n * report that itself.\n */\nasync function assertKnownRegistryItems(\n root: string,\n components: Component[],\n runtime: WriteResultRuntime | undefined,\n logger: Logger,\n): Promise<void> {\n const bare = components.filter((component) => BARE_ITEM_NAME.test(component));\n if (bare.length === 0) {\n return;\n }\n const config = readComponentsConfig(root);\n const url = registryIndexUrl(config.registry, config.style);\n const fetchImpl = runtime?.fetch ?? globalThis.fetch;\n const failedAt = registryUnavailableAt.get(fetchImpl)?.get(url);\n if (failedAt !== undefined && Date.now() - failedAt < REGISTRY_RETRY_MS) {\n return;\n }\n let known: Set<string>;\n try {\n const index = await fetchRegistryIndex(root, { runtime });\n known = new Set(index.map((item) => item.name));\n } catch (error) {\n if (!(error instanceof RegistryUnavailableError)) throw error;\n logger.info(`${error.message}; leaving component names to shadcn-svelte`);\n let failures = registryUnavailableAt.get(fetchImpl);\n if (!failures) {\n failures = new Map();\n registryUnavailableAt.set(fetchImpl, failures);\n }\n failures.set(url, Date.now());\n return;\n }\n const unknown = bare.filter((component) => !known.has(component));\n if (unknown.length === 0) {\n return;\n }\n const names = unknown.map((component) => `\"${component}\"`).join(\", \");\n throw new InvalidArgumentError(\n `Unknown component${unknown.length > 1 ? \"s\" : \"\"} ${names} for style ${config.style}. Run \\`vela ui list\\` to see what is available.`,\n );\n}\n\n/** What one `installComponents` call will do, worked out without touching the project. */\ninterface ComponentPlan {\n /** Requested but already in the project, and so left alone. */\n skipped: Component[];\n /** Copied from this package: the requested ones and the bundled components they build on, sorted. */\n custom: Component[];\n /** Handed to `shadcn-svelte add`: the requested ones and what the bundled components import, sorted. */\n registry: Component[];\n}\n\nfunction planComponentInstall(\n root: string,\n components: Component[],\n overwrite: boolean,\n): ComponentPlan {\n const requested = [...new Set(components)];\n if (requested.length === 0) {\n return { skipped: [], custom: [], registry: [] };\n }\n\n // `shadcn-svelte add` exits 1 without a `components.json`, after the custom\n // components and their packages are already in. Checked first, so a project\n // without shadcn-svelte is refused whole rather than left half-written.\n if (!existsSync(path.join(root, \"components.json\"))) {\n throw new MissingShadcnError(\n `Adding ${requested.length > 1 ? \"components\" : \"a component\"} (${requested.join(\", \")})`,\n );\n }\n\n const componentsDir = resolveUiDir(root);\n const isPresent = (component: string) =>\n existsSync(path.join(componentsDir, component));\n\n const skipped = overwrite ? [] : requested.filter(isPresent);\n const toInstall = requested.filter(\n (component) => !skipped.includes(component),\n );\n\n const customToInstall = new Set(toInstall.filter(isCustomComponent));\n const publicToInstall = new Set(\n toInstall.filter((component) => !isCustomComponent(component)),\n );\n\n // Dependencies are added only when missing, even under `overwrite`:\n // re-adding `button` because `pagination` was re-added would clobber edits\n // the user never asked to lose.\n for (const component of [...customToInstall]) {\n for (const dependency of customDependencies[component] ?? []) {\n if (isPresent(dependency)) {\n continue;\n }\n if (isCustomComponent(dependency)) {\n customToInstall.add(dependency);\n } else {\n publicToInstall.add(dependency);\n }\n }\n }\n\n return {\n skipped,\n custom: [...customToInstall].sort(),\n registry: [...publicToInstall].sort(),\n };\n}\n\n/**\n * Every reason an install would be refused, checked before it writes\n * anything: copying a bundled component, installing its packages and\n * spawning `shadcn-svelte add` all come after.\n */\nasync function assertPlanInstallable(\n root: string,\n plan: ComponentPlan,\n runtime: WriteResultRuntime | undefined,\n logger: Logger,\n): Promise<void> {\n // `installPackages` keeps an existing @tanstack/table-core whatever its range.\n assertTableCorePackage(root, plan.custom);\n if (plan.custom.includes(\"data-table-pagination\")) {\n assertRegistryPagination(root);\n }\n await assertKnownRegistryItems(root, plan.registry, runtime, logger);\n}\n\nexport interface AssertComponentsAvailableOptions {\n /** As for `installComponents`: also check the named components that are already present. */\n overwrite?: boolean;\n logger?: Logger;\n}\n\n/**\n * The preflight for `installComponents`: throws what it would throw for\n * these components, and changes nothing. `MissingShadcnError` without a\n * `components.json`, `InvalidArgumentError` for a name the style's registry\n * does not list (or a project whose table helpers are a major behind).\n * Components already in the project are not checked, as they are not\n * installed.\n *\n * For a caller with side effects of its own ahead of the install. A pattern\n * creates its collections first, and PocketBase writes each one's migration\n * file as it does, so a component the registry has dropped used to leave a\n * migration (and the bundled components, and their packages) behind a run\n * that then failed. `writeResult` and `installComponents` run the same\n * checks before their first write.\n *\n * A registry that cannot be read (offline, a timeout, an HTTP error) does not\n * fail the preflight: the names go unchecked, a line is logged, and\n * `shadcn-svelte add` reports the problem if it is still there at install\n * time, as it did before there was a preflight. The failure is remembered for\n * 30 seconds so the later checks of the same run neither wait nor repeat it.\n */\nexport async function assertComponentsAvailable(\n root: string,\n components: Component[],\n options: AssertComponentsAvailableOptions = {},\n runtime?: WriteResultRuntime,\n): Promise<void> {\n const plan = planComponentInstall(\n root,\n components,\n options.overwrite ?? false,\n );\n await assertPlanInstallable(root, plan, runtime, getLogger(options));\n}\n\nexport async function installComponents(\n options: InstallComponentsOptions,\n runtime?: WriteResultRuntime,\n): Promise<InstallComponentsResult> {\n const { root, components, overwrite = false } = options;\n const logger = getLogger(options);\n const plan = planComponentInstall(root, components, overwrite);\n await assertPlanInstallable(root, plan, runtime, logger);\n return applyComponentPlan(root, plan, runtime, logger);\n}\n\n/** Carries out a plan `assertPlanInstallable` has passed. */\nasync function applyComponentPlan(\n root: string,\n plan: ComponentPlan,\n runtime: WriteResultRuntime | undefined,\n logger: Logger,\n): Promise<InstallComponentsResult> {\n const { skipped, custom: customList, registry: publicList } = plan;\n if (skipped.length > 0) {\n logger.info(`Already present: ${skipped.join(\", \")}`);\n }\n if (customList.length === 0 && publicList.length === 0) {\n return { installed: [], skipped, packages: [] };\n }\n\n const componentsDir = resolveUiDir(root);\n mkdirSync(componentsDir, { recursive: true });\n\n const installed: string[] = [];\n let packages: string[] = [];\n const shadcnDirs = [path.join(root, \"src\", \"lib\"), componentsDir];\n let beforeShadcn: Map<string, string> | undefined;\n\n // The bundled components carry this repo's style and shadcn-svelte's files\n // the registry's. Whatever reached the project is formatted, whether or not\n // the install got to its end: a package install or `shadcn-svelte add` that\n // fails after the components were copied used to leave them as they came,\n // for the project's `prettier --check` to trip over.\n const formatWritten = () =>\n formatPaths(root, [\n ...new Set([\n ...installed.map((component) => path.join(componentsDir, component)),\n ...(beforeShadcn ? filesWrittenSince(beforeShadcn, shadcnDirs) : []),\n ]),\n ]);\n\n try {\n if (customList.length > 0) {\n logger.info(`Installing custom components: ${customList.join(\", \")}`);\n }\n for (const component of customList) {\n copyCustomComponent(component, componentsDir);\n installed.push(component);\n }\n\n packages = await installPackages(\n root,\n customNpmPackagesFor(customList),\n runtime,\n logger,\n );\n\n // `shadcn-svelte add` writes more than the items it is given: each one's\n // registry dependencies too (`command` brings `dialog` and `input-group`),\n // over a copy the project already has, and hooks and utils beside the\n // components. All of it arrives in the registry's style.\n beforeShadcn = publicList.length > 0 ? fileDigests(shadcnDirs) : undefined;\n\n if (publicList.length > 0) {\n logger.info(\n `Installing shadcn-svelte components: ${publicList.join(\", \")}`,\n );\n // shadcn-svelte reads the tsconfig, whose `extends` an install may have pruned.\n await ensureSvelteKitSync(root, runtime, logger);\n // shadcn only records its packages; they are installed below, once any\n // pin it moved backwards is put back.\n const before = readPackageJson(root);\n await executeCommand(\n root,\n \"execute\",\n [\n \"shadcn-svelte\",\n \"add\",\n \"--yes\",\n \"--overwrite\",\n \"--no-deps-install\",\n ...publicList,\n ],\n runtime,\n );\n installed.push(...publicList);\n const after = readPackageJson(root);\n if (before && after && JSON.stringify(before) !== JSON.stringify(after)) {\n const { pkg, restored } = restoreDowngradedDependencies(\n before as DependencyBlocks,\n after as DependencyBlocks,\n );\n if (restored.length > 0) {\n logger.info(\n `Kept ${restored.join(\", \")} (shadcn-svelte asked for an older range)`,\n );\n const file = path.join(root, \"package.json\");\n const indent =\n readFileSync(file, \"utf8\").match(/^[{]\\s*\\n([\\t ]+)/)?.[1] ?? \"\\t\";\n writeFileSync(file, `${JSON.stringify(pkg, null, indent)}\\n`, \"utf8\");\n }\n const recorded = (pkg: Record<string, unknown>) =>\n new Set(\n DEPENDENCY_BLOCKS.flatMap((block) =>\n Object.keys((pkg[block] as Record<string, string>) ?? {}),\n ),\n );\n const had = recorded(before);\n const added = [...recorded(after)].filter((name) => !had.has(name));\n reconcileFormsnap(root, had, added, logger);\n await executeCommand(root, \"install\", [], runtime);\n }\n }\n } catch (error) {\n // The install's error is the one to report.\n await formatWritten().catch(() => {});\n throw error;\n }\n await formatWritten();\n\n const installedList = [...new Set(installed)].sort();\n return { installed: installedList, skipped, packages };\n}\n\nexport async function writeResult(\n result: Result,\n options: Options,\n runtime?: WriteResultRuntime,\n): Promise<Result> {\n const logger = getLogger(options);\n\n const writtenResult: Result = {\n creates: [],\n modifies: [],\n deletes: [],\n components: [],\n packages: [],\n collections: [],\n collectionPatches: [],\n collectionDrops: [],\n };\n\n // Before anything is dropped, written or installed: a component that\n // cannot be installed refuses the whole result.\n const componentPlan = planComponentInstall(\n options.root,\n result.components,\n false,\n );\n await assertPlanInstallable(options.root, componentPlan, runtime, logger);\n\n let dropMigrationCreates: Result[\"creates\"] = [];\n if (result.collectionDrops.length > 0) {\n const { dropCollections } = await import(\"./collections\");\n // PocketBase writes these while the collections drop, after the result\n // was formatted, so they still carry its own style.\n dropMigrationCreates = await Promise.all(\n (await dropCollections(result.collectionDrops, options)).map(\n async (file) => ({\n ...file,\n content: await formatSource(file.content, file.path, options, {\n created: true,\n }),\n }),\n ),\n );\n }\n\n // A package.json edit lands before the package manager runs, so the install\n // builds on it. Written after, its content (read before the install) would\n // take back every dependency the install just recorded.\n const packageJsonPath = path.resolve(options.root, \"package.json\");\n const isPackageJson = (file: Result[\"modifies\"][number]) =>\n file.status === \"success\" &&\n path.resolve(toTargetPath(options.root, file.path)) === packageJsonPath;\n for (const file of result.modifies.filter(isPackageJson)) {\n writeFile(packageJsonPath, file.content);\n }\n\n const packageInstalls = await installPackages(\n options.root,\n result.packages,\n runtime,\n logger,\n );\n\n const componentInstalls = await applyComponentPlan(\n options.root,\n componentPlan,\n runtime,\n logger,\n );\n\n const packageUninstalls = await uninstallPackages(\n options.root,\n result.uninstalls ?? [],\n runtime,\n logger,\n );\n\n for (const file of [...result.creates, ...dropMigrationCreates]) {\n if (file.status !== \"success\") {\n // A modifier that could not recognise the file it was asked to edit\n // reports `failed` / `not-found` with a paste-ready remediation snippet.\n // Nothing is written, but the entry has to survive into the result: this\n // loop used to `continue` before pushing, so the entry never reached the\n // caller at all and the snippet was lost. The pattern reported success\n // and simply said nothing about the file it had given up on.\n writtenResult.creates.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n continue;\n }\n const target = toTargetPath(options.root, file.path);\n if (!existsSync(target)) {\n writeFile(target, file.content);\n writtenResult.creates.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n continue;\n }\n // A `written` file is the run's own (a migration PocketBase wrote and\n // `readMigration` formatted), reported even when there is nothing left\n // to write: the CLI lists a new migration from this entry.\n const changed = readFileSync(target, \"utf8\") !== file.content;\n if (changed) {\n writeFile(target, file.content);\n }\n if (changed || file.written) {\n // The marker is this module's and `readMigration`'s; callers get the\n // entry in the shape it always had.\n const { written: _written, ...reported } = file;\n writtenResult.modifies.push({\n ...reported,\n path: toRelativePath(options.root, file.path),\n });\n }\n }\n\n for (const file of result.modifies) {\n if (isPackageJson(file)) {\n writtenResult.modifies.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n continue;\n }\n if (file.status !== \"success\") {\n // Carried through unwritten, so the caller can report the failure. See\n // the note in the creates loop above.\n writtenResult.modifies.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n continue;\n }\n writeFile(toTargetPath(options.root, file.path), file.content);\n writtenResult.modifies.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n }\n\n for (const file of result.deletes) {\n if (file.status !== \"success\") {\n writtenResult.deletes.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n continue;\n }\n if (existsSync(toTargetPath(options.root, file.path))) {\n removeFile(toTargetPath(options.root, file.path), options.root);\n writtenResult.deletes.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n }\n }\n\n return {\n ...result,\n creates: writtenResult.creates,\n modifies: writtenResult.modifies,\n deletes: writtenResult.deletes,\n components: componentInstalls.installed,\n packages: [...new Set([...packageInstalls, ...componentInstalls.packages])],\n ...(packageUninstalls.length > 0 ? { uninstalls: packageUninstalls } : {}),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;A,IAiEa0J,KAA+C;CAC1D,aAAa,CAAC,OAAO;CACrB,MAAM,CAAC,SAAS,QAAQ;CACxB,aAAa;EAAC;EAAW;EAAW;CAAQ;CAC5C,UAAU,CAAC,UAAU,SAAS;CAC9B,OAAO,CAAC,OAAO;CACf,cAAc,CAAC;CACf,iBAAiB,CAAC,iBAAiB,QAAQ;CAC3C,kBAAkB;EAAC;EAAW;EAAW;EAAU;EAAa;CAAO;CACvE,yBAAyB,CAAC,cAAc,QAAQ;CAChD,eAAe,CAAC,iBAAiB,QAAQ;CACzC,SAAS,CAAC;CACV,aAAa,CAAC,iBAAiB,QAAQ;AACzC,GAEMC,KAAuC;CAC3C,aAAa,CAACjF,CAAQ;CAGtB,MAAM,CAACA,GAAUC,CAAU;CAC3B,aAAa,CAACD,CAAQ;CACtB,UAAU,CAAC;CACX,OAAO,CAAC;CAIR,cAAc,CAACF,CAAmB;CAClC,iBAAiB,CAACA,CAAmB;CACrC,kBAAkB,CAACA,CAAmB;CACtC,yBAAyB,CAACA,CAAmB;CAC7C,eAAe,CAAC;CAChB,SAAS,CAAC,WAAW,gBAAgB;AACvC,GAEMoF,IAAwB,uBAAA,OAAA;CAAA,uDAAA5J;CAAA,qDAAAC;CAAA,o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AAC,CAAC;EAC1E,GAAIC,EAAkB,SAAS,IAAI,EAAE,YAAYA,EAAkB,IAAI,CAAC;CAC1E;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,23 @@ export declare interface ApplyThemeOptions {
|
|
|
31
31
|
theme: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* The preflight for `installComponents`: throws what it would throw for these
|
|
36
|
+
* components (`MissingShadcnError`, or `InvalidArgumentError` for a name the
|
|
37
|
+
* style's registry does not list) and changes nothing. For a caller with side
|
|
38
|
+
* effects of its own ahead of the install; a pattern that lists components
|
|
39
|
+
* and creates collections runs it first. A registry that cannot be read is not an error
|
|
40
|
+
* here: the names go unchecked and the install reports it. Node-only, loaded
|
|
41
|
+
* on first call like `installComponents`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function assertComponentsAvailable(root: string, components: Component[], options?: AssertComponentsAvailableOptions, runtime?: WriteResultRuntime): Promise<void>;
|
|
44
|
+
|
|
45
|
+
export declare interface AssertComponentsAvailableOptions {
|
|
46
|
+
/** As for `installComponents`: also check the named components that are already present. */
|
|
47
|
+
overwrite?: boolean;
|
|
48
|
+
logger?: Logger;
|
|
49
|
+
}
|
|
50
|
+
|
|
34
51
|
/**
|
|
35
52
|
* The features in `pattern.blockedBy` that the project has on, in the
|
|
36
53
|
* pattern's order. Empty means nothing stands in the way. A disable pattern
|
|
@@ -1707,6 +1724,8 @@ declare interface CollectionField {
|
|
|
1707
1724
|
declare interface CollectionFieldsPatch {
|
|
1708
1725
|
collectionName: string;
|
|
1709
1726
|
changes: FieldChange[];
|
|
1727
|
+
/** `CREATE INDEX` statements to add to the ones the collection has. */
|
|
1728
|
+
indexes?: string[];
|
|
1710
1729
|
}
|
|
1711
1730
|
|
|
1712
1731
|
declare interface CollectionFieldSpec {
|
|
@@ -1879,6 +1898,12 @@ declare interface Features {
|
|
|
1879
1898
|
ui?: "shadcn" | "plain";
|
|
1880
1899
|
}
|
|
1881
1900
|
|
|
1901
|
+
/**
|
|
1902
|
+
* The field syntax as plain text, wrapped at 80 columns, for the `--help` of
|
|
1903
|
+
* every `vela generate` command that takes field definitions.
|
|
1904
|
+
*/
|
|
1905
|
+
export declare const FIELD_SYNTAX_HELP: string;
|
|
1906
|
+
|
|
1882
1907
|
declare type FieldChange = {
|
|
1883
1908
|
op: "add";
|
|
1884
1909
|
field: CollectionFieldSpec;
|
|
@@ -1897,6 +1922,13 @@ declare interface File_2 {
|
|
|
1897
1922
|
content: string;
|
|
1898
1923
|
status: FileStatus;
|
|
1899
1924
|
message?: string;
|
|
1925
|
+
/**
|
|
1926
|
+
* This run has already put the content on disk: a migration PocketBase
|
|
1927
|
+
* wrote, which `readMigration` formatted in place. `writeResult` does not
|
|
1928
|
+
* write it again, and reports it among the modifies as it did when it was
|
|
1929
|
+
* the one to format it.
|
|
1930
|
+
*/
|
|
1931
|
+
written?: boolean;
|
|
1900
1932
|
}
|
|
1901
1933
|
export { File_2 as File }
|
|
1902
1934
|
|
|
@@ -1960,6 +1992,14 @@ export declare class InvalidArgumentError extends Error {
|
|
|
1960
1992
|
*/
|
|
1961
1993
|
export declare function isLibSpecifier(spec: string, relPath: string): boolean;
|
|
1962
1994
|
|
|
1995
|
+
/**
|
|
1996
|
+
* Where those types were written before, and the entry older projects have.
|
|
1997
|
+
* SvelteKit owns `.svelte-kit/types` and clears what it does not recognise
|
|
1998
|
+
* there whenever a Vite server starts, so running vitest deleted the synced
|
|
1999
|
+
* types. `modifyTsconfigBackend` rewrites this entry to `POCKETBASE_TYPES`.
|
|
2000
|
+
*/
|
|
2001
|
+
export declare const LEGACY_POCKETBASE_TYPES = ".svelte-kit/types/pocketbase/*.d.ts";
|
|
2002
|
+
|
|
1963
2003
|
/**
|
|
1964
2004
|
* The directory under `src/lib` a `components.json` alias names: `#lib` and
|
|
1965
2005
|
* `#lib/components/ui` (what shadcn-svelte writes for a SvelteKit 3 project),
|
|
@@ -2117,6 +2157,13 @@ export declare interface Options {
|
|
|
2117
2157
|
* the one to generate. Falls back to `--provider <id>` in `argv`.
|
|
2118
2158
|
* - `providerEnv` (Record<string, string>): values the CLI collected for
|
|
2119
2159
|
* the chosen provider's `env` keys, written to `.env` by the pattern.
|
|
2160
|
+
* - `rules` (`"auth" | "owner" | "superuser"`): the API rules of a
|
|
2161
|
+
* collection a generator creates. `auth` lets every signed-in user read
|
|
2162
|
+
* and write, `owner` only the user a relation path leads to (an error
|
|
2163
|
+
* when there is none), `superuser` nobody but the server's superuser
|
|
2164
|
+
* client. Unset: `owner` when a path exists and `auth` otherwise, or
|
|
2165
|
+
* `superuser` in a project without auth. An error when the generator
|
|
2166
|
+
* creates no collection.
|
|
2120
2167
|
*/
|
|
2121
2168
|
input: Record<string, any>;
|
|
2122
2169
|
/**
|
|
@@ -3827,6 +3874,29 @@ export declare const patterns: ({
|
|
|
3827
3874
|
generate: typeof generate;
|
|
3828
3875
|
})[];
|
|
3829
3876
|
|
|
3877
|
+
/**
|
|
3878
|
+
* Names the environment variable that points the patterns at a PocketBase
|
|
3879
|
+
* binary: `VELA_POCKETBASE_BIN`, an absolute path. When it is set,
|
|
3880
|
+
* `withPocketbase` (every pattern that touches the schema) runs that file
|
|
3881
|
+
* directly, with the arguments it would have given `pocketbase-server`, and
|
|
3882
|
+
* does not look at the project's package manager at all.
|
|
3883
|
+
*
|
|
3884
|
+
* The vela CLI sets it to the binary of its own `pocketbase-server`
|
|
3885
|
+
* dependency before it calls a pattern. Without it the server is started
|
|
3886
|
+
* through the package manager (`npx pocketbase-server`, `pnpm dlx ...`),
|
|
3887
|
+
* which only finds vela's copy when the project's `node_modules` happens to
|
|
3888
|
+
* expose it: under pnpm, `dlx` downloads whatever version is latest, and a
|
|
3889
|
+
* `node_modules` installed by one manager and run by another exits 127.
|
|
3890
|
+
*/
|
|
3891
|
+
export declare const POCKETBASE_BIN_ENV = "VELA_POCKETBASE_BIN";
|
|
3892
|
+
|
|
3893
|
+
/**
|
|
3894
|
+
* The tsconfig `include` entry for the types `vela sync` generates from the
|
|
3895
|
+
* PocketBase schema (`Schemas`, the typed client): `$types.d.ts` under
|
|
3896
|
+
* `.svelte-kit/pocketbase`.
|
|
3897
|
+
*/
|
|
3898
|
+
export declare const POCKETBASE_TYPES = ".svelte-kit/pocketbase/*.d.ts";
|
|
3899
|
+
|
|
3830
3900
|
/**
|
|
3831
3901
|
* One implementation of a capability the user picks with `--provider <id>`:
|
|
3832
3902
|
* `vela enable analytics --provider plausible`. `id` is the stable CLI value,
|
|
@@ -3977,6 +4047,12 @@ declare interface Result {
|
|
|
3977
4047
|
* added without checking first.
|
|
3978
4048
|
*/
|
|
3979
4049
|
uninstalls?: Package[];
|
|
4050
|
+
/**
|
|
4051
|
+
* Things the user has to know about what was generated and could not tell
|
|
4052
|
+
* from the file list, one sentence each, for the caller to print with the
|
|
4053
|
+
* result: a collection only the superuser client can reach, for instance.
|
|
4054
|
+
*/
|
|
4055
|
+
notes?: string[];
|
|
3980
4056
|
}
|
|
3981
4057
|
|
|
3982
4058
|
/**
|
|
@@ -3990,6 +4066,11 @@ declare interface RouteGroups {
|
|
|
3990
4066
|
app: string | null;
|
|
3991
4067
|
}
|
|
3992
4068
|
|
|
4069
|
+
/** What `input.rules` takes. */
|
|
4070
|
+
export declare const RULES_MODES: readonly ["auth", "owner", "superuser"];
|
|
4071
|
+
|
|
4072
|
+
export declare type RulesMode = (typeof RULES_MODES)[number];
|
|
4073
|
+
|
|
3993
4074
|
export declare type Slug = PatternEntry["slug"];
|
|
3994
4075
|
|
|
3995
4076
|
/** The install spec for a listed package: `spec("zod")` is `zod@^4.6.7`. */
|