@slicemachine/plugin-kit 0.4.94-beta.1 → 0.4.94-beta.3

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.
@@ -40,7 +40,8 @@ const SliceMachineConfigCodec = t__namespace.intersection([
40
40
  libraries: t__namespace.array(t__namespace.string),
41
41
  localSliceSimulatorURL: t__namespace.string,
42
42
  plugins: t__namespace.array(SliceMachineConfigPluginRegistrationCodec),
43
- labs: t__namespace.partial({ legacySliceUpgrader: t__namespace.boolean })
43
+ labs: t__namespace.partial({ legacySliceUpgrader: t__namespace.boolean }),
44
+ starter: t__namespace.string
44
45
  })
45
46
  ]);
46
47
  const decodeSliceMachineConfig = (input) => {
@@ -1 +1 @@
1
- {"version":3,"file":"decodeSliceMachineConfig.cjs","sources":["../../../src/lib/decodeSliceMachineConfig.ts"],"sourcesContent":["import * as t from \"io-ts\";\n\nimport { SliceMachineConfig } from \"../types\";\n\nimport { decode, DecodeReturnType } from \"./decode\";\n\nconst SliceMachineConfigPluginRegistrationCodec = t.union([\n\tt.string,\n\tt.intersection([\n\t\tt.type({\n\t\t\tresolve: t.string,\n\t\t}),\n\t\tt.partial({\n\t\t\toptions: t.UnknownRecord,\n\t\t}),\n\t]),\n]);\n\nconst SliceMachineConfigCodec = t.intersection([\n\tt.type({\n\t\trepositoryName: t.string,\n\t\tadapter: SliceMachineConfigPluginRegistrationCodec,\n\t}),\n\tt.partial({\n\t\tapiEndpoint: t.string,\n\t\tlibraries: t.array(t.string),\n\t\tlocalSliceSimulatorURL: t.string,\n\t\tplugins: t.array(SliceMachineConfigPluginRegistrationCodec),\n\t\tlabs: t.partial({ legacySliceUpgrader: t.boolean }),\n\t}),\n]);\n\n// TODO: Maybe rename \"decode\" to \"validate\". \"decode\" exposes the `io-ts`\n// internals.\nexport const decodeSliceMachineConfig = (\n\tinput: unknown,\n): DecodeReturnType<SliceMachineConfig, SliceMachineConfig, unknown> => {\n\treturn decode(SliceMachineConfigCodec, input);\n};\n"],"names":["t","decode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,4CAA4CA,aAAE,MAAM;AAAA,EACzDA,aAAE;AAAA,EACFA,aAAE,aAAa;AAAA,IACdA,aAAE,KAAK;AAAA,MACN,SAASA,aAAE;AAAA,IAAA,CACX;AAAA,IACDA,aAAE,QAAQ;AAAA,MACT,SAASA,aAAE;AAAA,IAAA,CACX;AAAA,EAAA,CACD;AACD,CAAA;AAED,MAAM,0BAA0BA,aAAE,aAAa;AAAA,EAC9CA,aAAE,KAAK;AAAA,IACN,gBAAgBA,aAAE;AAAA,IAClB,SAAS;AAAA,EAAA,CACT;AAAA,EACDA,aAAE,QAAQ;AAAA,IACT,aAAaA,aAAE;AAAA,IACf,WAAWA,aAAE,MAAMA,aAAE,MAAM;AAAA,IAC3B,wBAAwBA,aAAE;AAAA,IAC1B,SAASA,aAAE,MAAM,yCAAyC;AAAA,IAC1D,MAAMA,aAAE,QAAQ,EAAE,qBAAqBA,aAAE,SAAS;AAAA,EAAA,CAClD;AACD,CAAA;AAIM,MAAM,2BAA2B,CACvC,UACsE;AACtE,SAAOC,OAAAA,OAAO,yBAAyB,KAAK;AAC7C;;"}
1
+ {"version":3,"file":"decodeSliceMachineConfig.cjs","sources":["../../../src/lib/decodeSliceMachineConfig.ts"],"sourcesContent":["import * as t from \"io-ts\";\n\nimport { SliceMachineConfig } from \"../types\";\n\nimport { decode, DecodeReturnType } from \"./decode\";\n\nconst SliceMachineConfigPluginRegistrationCodec = t.union([\n\tt.string,\n\tt.intersection([\n\t\tt.type({\n\t\t\tresolve: t.string,\n\t\t}),\n\t\tt.partial({\n\t\t\toptions: t.UnknownRecord,\n\t\t}),\n\t]),\n]);\n\nconst SliceMachineConfigCodec = t.intersection([\n\tt.type({\n\t\trepositoryName: t.string,\n\t\tadapter: SliceMachineConfigPluginRegistrationCodec,\n\t}),\n\tt.partial({\n\t\tapiEndpoint: t.string,\n\t\tlibraries: t.array(t.string),\n\t\tlocalSliceSimulatorURL: t.string,\n\t\tplugins: t.array(SliceMachineConfigPluginRegistrationCodec),\n\t\tlabs: t.partial({ legacySliceUpgrader: t.boolean }),\n\t\tstarter: t.string,\n\t}),\n]);\n\n// TODO: Maybe rename \"decode\" to \"validate\". \"decode\" exposes the `io-ts`\n// internals.\nexport const decodeSliceMachineConfig = (\n\tinput: unknown,\n): DecodeReturnType<SliceMachineConfig, SliceMachineConfig, unknown> => {\n\treturn decode(SliceMachineConfigCodec, input);\n};\n"],"names":["t","decode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,4CAA4CA,aAAE,MAAM;AAAA,EACzDA,aAAE;AAAA,EACFA,aAAE,aAAa;AAAA,IACdA,aAAE,KAAK;AAAA,MACN,SAASA,aAAE;AAAA,IAAA,CACX;AAAA,IACDA,aAAE,QAAQ;AAAA,MACT,SAASA,aAAE;AAAA,IAAA,CACX;AAAA,EAAA,CACD;AACD,CAAA;AAED,MAAM,0BAA0BA,aAAE,aAAa;AAAA,EAC9CA,aAAE,KAAK;AAAA,IACN,gBAAgBA,aAAE;AAAA,IAClB,SAAS;AAAA,EAAA,CACT;AAAA,EACDA,aAAE,QAAQ;AAAA,IACT,aAAaA,aAAE;AAAA,IACf,WAAWA,aAAE,MAAMA,aAAE,MAAM;AAAA,IAC3B,wBAAwBA,aAAE;AAAA,IAC1B,SAASA,aAAE,MAAM,yCAAyC;AAAA,IAC1D,MAAMA,aAAE,QAAQ,EAAE,qBAAqBA,aAAE,SAAS;AAAA,IAClD,SAASA,aAAE;AAAA,EAAA,CACX;AACD,CAAA;AAIM,MAAM,2BAA2B,CACvC,UACsE;AACtE,SAAOC,OAAAA,OAAO,yBAAyB,KAAK;AAC7C;;"}
@@ -21,7 +21,8 @@ const SliceMachineConfigCodec = t.intersection([
21
21
  libraries: t.array(t.string),
22
22
  localSliceSimulatorURL: t.string,
23
23
  plugins: t.array(SliceMachineConfigPluginRegistrationCodec),
24
- labs: t.partial({ legacySliceUpgrader: t.boolean })
24
+ labs: t.partial({ legacySliceUpgrader: t.boolean }),
25
+ starter: t.string
25
26
  })
26
27
  ]);
27
28
  const decodeSliceMachineConfig = (input) => {
@@ -1 +1 @@
1
- {"version":3,"file":"decodeSliceMachineConfig.js","sources":["../../../src/lib/decodeSliceMachineConfig.ts"],"sourcesContent":["import * as t from \"io-ts\";\n\nimport { SliceMachineConfig } from \"../types\";\n\nimport { decode, DecodeReturnType } from \"./decode\";\n\nconst SliceMachineConfigPluginRegistrationCodec = t.union([\n\tt.string,\n\tt.intersection([\n\t\tt.type({\n\t\t\tresolve: t.string,\n\t\t}),\n\t\tt.partial({\n\t\t\toptions: t.UnknownRecord,\n\t\t}),\n\t]),\n]);\n\nconst SliceMachineConfigCodec = t.intersection([\n\tt.type({\n\t\trepositoryName: t.string,\n\t\tadapter: SliceMachineConfigPluginRegistrationCodec,\n\t}),\n\tt.partial({\n\t\tapiEndpoint: t.string,\n\t\tlibraries: t.array(t.string),\n\t\tlocalSliceSimulatorURL: t.string,\n\t\tplugins: t.array(SliceMachineConfigPluginRegistrationCodec),\n\t\tlabs: t.partial({ legacySliceUpgrader: t.boolean }),\n\t}),\n]);\n\n// TODO: Maybe rename \"decode\" to \"validate\". \"decode\" exposes the `io-ts`\n// internals.\nexport const decodeSliceMachineConfig = (\n\tinput: unknown,\n): DecodeReturnType<SliceMachineConfig, SliceMachineConfig, unknown> => {\n\treturn decode(SliceMachineConfigCodec, input);\n};\n"],"names":[],"mappings":";;AAMA,MAAM,4CAA4C,EAAE,MAAM;AAAA,EACzD,EAAE;AAAA,EACF,EAAE,aAAa;AAAA,IACd,EAAE,KAAK;AAAA,MACN,SAAS,EAAE;AAAA,IAAA,CACX;AAAA,IACD,EAAE,QAAQ;AAAA,MACT,SAAS,EAAE;AAAA,IAAA,CACX;AAAA,EAAA,CACD;AACD,CAAA;AAED,MAAM,0BAA0B,EAAE,aAAa;AAAA,EAC9C,EAAE,KAAK;AAAA,IACN,gBAAgB,EAAE;AAAA,IAClB,SAAS;AAAA,EAAA,CACT;AAAA,EACD,EAAE,QAAQ;AAAA,IACT,aAAa,EAAE;AAAA,IACf,WAAW,EAAE,MAAM,EAAE,MAAM;AAAA,IAC3B,wBAAwB,EAAE;AAAA,IAC1B,SAAS,EAAE,MAAM,yCAAyC;AAAA,IAC1D,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS;AAAA,EAAA,CAClD;AACD,CAAA;AAIM,MAAM,2BAA2B,CACvC,UACsE;AACtE,SAAO,OAAO,yBAAyB,KAAK;AAC7C;"}
1
+ {"version":3,"file":"decodeSliceMachineConfig.js","sources":["../../../src/lib/decodeSliceMachineConfig.ts"],"sourcesContent":["import * as t from \"io-ts\";\n\nimport { SliceMachineConfig } from \"../types\";\n\nimport { decode, DecodeReturnType } from \"./decode\";\n\nconst SliceMachineConfigPluginRegistrationCodec = t.union([\n\tt.string,\n\tt.intersection([\n\t\tt.type({\n\t\t\tresolve: t.string,\n\t\t}),\n\t\tt.partial({\n\t\t\toptions: t.UnknownRecord,\n\t\t}),\n\t]),\n]);\n\nconst SliceMachineConfigCodec = t.intersection([\n\tt.type({\n\t\trepositoryName: t.string,\n\t\tadapter: SliceMachineConfigPluginRegistrationCodec,\n\t}),\n\tt.partial({\n\t\tapiEndpoint: t.string,\n\t\tlibraries: t.array(t.string),\n\t\tlocalSliceSimulatorURL: t.string,\n\t\tplugins: t.array(SliceMachineConfigPluginRegistrationCodec),\n\t\tlabs: t.partial({ legacySliceUpgrader: t.boolean }),\n\t\tstarter: t.string,\n\t}),\n]);\n\n// TODO: Maybe rename \"decode\" to \"validate\". \"decode\" exposes the `io-ts`\n// internals.\nexport const decodeSliceMachineConfig = (\n\tinput: unknown,\n): DecodeReturnType<SliceMachineConfig, SliceMachineConfig, unknown> => {\n\treturn decode(SliceMachineConfigCodec, input);\n};\n"],"names":[],"mappings":";;AAMA,MAAM,4CAA4C,EAAE,MAAM;AAAA,EACzD,EAAE;AAAA,EACF,EAAE,aAAa;AAAA,IACd,EAAE,KAAK;AAAA,MACN,SAAS,EAAE;AAAA,IAAA,CACX;AAAA,IACD,EAAE,QAAQ;AAAA,MACT,SAAS,EAAE;AAAA,IAAA,CACX;AAAA,EAAA,CACD;AACD,CAAA;AAED,MAAM,0BAA0B,EAAE,aAAa;AAAA,EAC9C,EAAE,KAAK;AAAA,IACN,gBAAgB,EAAE;AAAA,IAClB,SAAS;AAAA,EAAA,CACT;AAAA,EACD,EAAE,QAAQ;AAAA,IACT,aAAa,EAAE;AAAA,IACf,WAAW,EAAE,MAAM,EAAE,MAAM;AAAA,IAC3B,wBAAwB,EAAE;AAAA,IAC1B,SAAS,EAAE,MAAM,yCAAyC;AAAA,IAC1D,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS;AAAA,IAClD,SAAS,EAAE;AAAA,EAAA,CACX;AACD,CAAA;AAIM,MAAM,2BAA2B,CACvC,UACsE;AACtE,SAAO,OAAO,yBAAyB,KAAK;AAC7C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sources":["../../src/types.ts"],"sourcesContent":["import { SliceMachineContext } from \"./createSliceMachineContext\";\nimport { SliceMachinePlugin } from \"./defineSliceMachinePlugin\";\nimport { Hook } from \"./lib/HookSystem\";\n\nimport { ProjectInitHookBase } from \"./hooks/project-init\";\nimport { CustomTypeAssetDeleteHookBase } from \"./hooks/customType-asset-delete\";\nimport { CustomTypeAssetReadHookBase } from \"./hooks/customType-asset-read\";\nimport { CustomTypeAssetUpdateHookBase } from \"./hooks/customType-asset-update\";\nimport { CustomTypeCreateHookBase } from \"./hooks/customType-create\";\nimport { CustomTypeDeleteHookBase } from \"./hooks/customType-delete\";\nimport { CustomTypeLibraryReadHookBase } from \"./hooks/customTypeLibrary-read\";\nimport { CustomTypeReadHookBase } from \"./hooks/customType-read\";\nimport { CustomTypeRenameHookBase } from \"./hooks/customType-rename\";\nimport { CustomTypeUpdateHookBase } from \"./hooks/customType-update\";\nimport { DebugHookBase } from \"./hooks/debug\";\nimport { SliceAssetDeleteHookBase } from \"./hooks/slice-asset-delete\";\nimport { SliceAssetReadHookBase } from \"./hooks/slice-asset-read\";\nimport { SliceAssetUpdateHookBase } from \"./hooks/slice-asset-update\";\nimport { SliceCreateHookBase } from \"./hooks/slice-create\";\nimport { SliceDeleteHookBase } from \"./hooks/slice-delete\";\nimport { SliceLibraryReadHookBase } from \"./hooks/sliceLibrary-read\";\nimport { SliceReadHookBase } from \"./hooks/slice-read\";\nimport { SliceRenameHookBase } from \"./hooks/slice-rename\";\nimport { SliceUpdateHookBase } from \"./hooks/slice-update\";\nimport { SnippetReadHookBase } from \"./hooks/snippet-read\";\nimport { DocumentationReadHookBase } from \"./hooks/documentation-read\";\n\nimport { SliceTemplateLibraryReadHookBase } from \"./hooks/sliceTemplateLibrary-read\";\nimport { ProjectEnvironmentReadHookBase } from \"./hooks/project-environment-read\";\nimport { ProjectEnvironmentUpdateHookBase } from \"./hooks/project-environment-update\";\n\n/**\n * A value optionally wrapped in a `PromiseLike`.\n *\n * @typeParam T - The value that can optionally be wrapped.\n */\nexport type Promisable<T> = T | PromiseLike<T>;\n\n/**\n * A generic type for a user-provided plugin options. Prefer using a\n * plugin-specific type over this type.\n */\nexport type SliceMachinePluginOptions = Record<string, unknown>;\n\n/**\n * A string, object, or instance representing a registered plugin.\n *\n * @typeParam TPluginOptions - User-provided options for the plugin.\n */\nexport type SliceMachineConfigPluginRegistration<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> =\n\t| string\n\t| SliceMachinePlugin\n\t| {\n\t\t\tresolve: string | SliceMachinePlugin;\n\t\t\toptions?: TPluginOptions;\n\t };\n\n/**\n * Slice Machine configuration from `slicemachine.config.js`.\n */\nexport type SliceMachineConfig = {\n\t// TODO: Can we make `apiEndpoint` optional?\n\tapiEndpoint?: string;\n\t// NOTE: This is a new property.\n\trepositoryName: string;\n\tlocalSliceSimulatorURL?: string;\n\tlibraries?: string[];\n\tadapter: SliceMachineConfigPluginRegistration;\n\tplugins?: SliceMachineConfigPluginRegistration[];\n\tlabs?: { legacySliceUpgrader?: boolean };\n};\n\n/**\n * Slice Machine project metadata.\n */\nexport type SliceMachineProject = {\n\t/**\n\t * An absolute path to project root.\n\t */\n\troot: string;\n\t/**\n\t * Slice Machine `slicemachine.config.json` content, validated.\n\t */\n\tconfig: SliceMachineConfig;\n};\n\n/**\n * A Slice Library's metadata.\n */\nexport type SliceLibrary = {\n\tid: string;\n};\n\n// ============================================================================\n//\n// # HOOK TYPES\n//\n// ============================================================================\n\n/**\n * A hook handler.\n */\nexport type SliceMachineHook<TData, TReturn> = (\n\tdata: TData,\n) => Promisable<TReturn>;\n\n/**\n * Extra arguments provided to hooks when called.\n *\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type SliceMachineHookExtraArgs<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = [context: SliceMachineContext<TPluginOptions>];\n\n/**\n * Utility type to extend a hook handler's type with Slice Machine-specific\n * extra arguments.\n *\n * @typeParam THook - Hook handler to extend.\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type ExtendSliceMachineHook<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTHook extends SliceMachineHook<any, any>,\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = (\n\t...args: [\n\t\t...args: Parameters<THook>,\n\t\t...extraArgs: SliceMachineHookExtraArgs<TPluginOptions>,\n\t]\n) => ReturnType<THook>;\n\n/**\n * Hook types.\n */\nexport const SliceMachineHookType = {\n\tslice_create: \"slice:create\",\n\tslice_update: \"slice:update\",\n\tslice_rename: \"slice:rename\",\n\tslice_delete: \"slice:delete\",\n\tslice_read: \"slice:read\",\n\tslice_asset_update: \"slice:asset:update\",\n\tslice_asset_delete: \"slice:asset:delete\",\n\tslice_asset_read: \"slice:asset:read\",\n\tsliceLibrary_read: \"slice-library:read\",\n\n\tcustomType_create: \"custom-type:create\",\n\tcustomType_update: \"custom-type:update\",\n\tcustomType_rename: \"custom-type:rename\",\n\tcustomType_delete: \"custom-type:delete\",\n\tcustomType_read: \"custom-type:read\",\n\tcustomType_asset_update: \"custom-type:asset:update\",\n\tcustomType_asset_delete: \"custom-type:asset:delete\",\n\tcustomType_asset_read: \"custom-type:asset:read\",\n\tcustomTypeLibrary_read: \"custom-type-library:read\",\n\tdocumentation_read: \"documentation:read\",\n\tsliceTemplateLibrary_read: \"slice-template-library:read\",\n\n\tsnippet_read: \"snippet:read\",\n\n\tproject_init: \"project:init\",\n\tproject_environment_read: \"project:environment:read\",\n\tproject_environment_update: \"project:environment:update\",\n\n\tdebug: \"debug\",\n} as const;\n\n/**\n * Hook types.\n */\nexport type SliceMachineHookTypes =\n\t(typeof SliceMachineHookType)[keyof typeof SliceMachineHookType];\n\n/**\n * Slice Machine-specific hook handlers.\n */\nexport type SliceMachineHooks = {\n\t// Slices\n\t[SliceMachineHookType.slice_create]: Hook<SliceCreateHookBase>;\n\t[SliceMachineHookType.slice_update]: Hook<SliceUpdateHookBase>;\n\t[SliceMachineHookType.slice_rename]: Hook<SliceRenameHookBase>;\n\t[SliceMachineHookType.slice_delete]: Hook<SliceDeleteHookBase>;\n\t[SliceMachineHookType.slice_read]: Hook<SliceReadHookBase>;\n\t[SliceMachineHookType.slice_asset_update]: Hook<SliceAssetUpdateHookBase>;\n\t[SliceMachineHookType.slice_asset_delete]: Hook<SliceAssetDeleteHookBase>;\n\t[SliceMachineHookType.slice_asset_read]: Hook<SliceAssetReadHookBase>;\n\n\t// Slice Libraries\n\t[SliceMachineHookType.sliceLibrary_read]: Hook<SliceLibraryReadHookBase>;\n\n\t// Custom Types\n\t[SliceMachineHookType.customType_create]: Hook<CustomTypeCreateHookBase>;\n\t[SliceMachineHookType.customType_update]: Hook<CustomTypeUpdateHookBase>;\n\t[SliceMachineHookType.customType_rename]: Hook<CustomTypeRenameHookBase>;\n\t[SliceMachineHookType.customType_delete]: Hook<CustomTypeDeleteHookBase>;\n\t[SliceMachineHookType.customType_read]: Hook<CustomTypeReadHookBase>;\n\t[SliceMachineHookType.customType_asset_update]: Hook<CustomTypeAssetUpdateHookBase>;\n\t[SliceMachineHookType.customType_asset_delete]: Hook<CustomTypeAssetDeleteHookBase>;\n\t[SliceMachineHookType.customType_asset_read]: Hook<CustomTypeAssetReadHookBase>;\n\n\t// Custom Type Libraries\n\t[SliceMachineHookType.customTypeLibrary_read]: Hook<CustomTypeLibraryReadHookBase>;\n\n\t// Snippets\n\t[SliceMachineHookType.snippet_read]: Hook<SnippetReadHookBase>;\n\n\t// Documentation\n\t[SliceMachineHookType.documentation_read]: Hook<DocumentationReadHookBase>;\n\n\t// Project\n\t[SliceMachineHookType.project_init]: Hook<ProjectInitHookBase>;\n\t[SliceMachineHookType.project_environment_read]: Hook<ProjectEnvironmentReadHookBase>;\n\t[SliceMachineHookType.project_environment_update]: Hook<ProjectEnvironmentUpdateHookBase>;\n\n\t// Debug\n\t[SliceMachineHookType.debug]: Hook<DebugHookBase>;\n\n\t// Slice templates\n\t[SliceMachineHookType.sliceTemplateLibrary_read]: Hook<SliceTemplateLibraryReadHookBase>;\n};\n"],"names":[],"mappings":";;AA0IO,MAAM,uBAAuB;AAAA,EACnC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EAEnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAE3B,cAAc;AAAA,EAEd,cAAc;AAAA,EACd,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAE5B,OAAO;;;"}
1
+ {"version":3,"file":"types.cjs","sources":["../../src/types.ts"],"sourcesContent":["import { SliceMachineContext } from \"./createSliceMachineContext\";\nimport { SliceMachinePlugin } from \"./defineSliceMachinePlugin\";\nimport { Hook } from \"./lib/HookSystem\";\n\nimport { ProjectInitHookBase } from \"./hooks/project-init\";\nimport { CustomTypeAssetDeleteHookBase } from \"./hooks/customType-asset-delete\";\nimport { CustomTypeAssetReadHookBase } from \"./hooks/customType-asset-read\";\nimport { CustomTypeAssetUpdateHookBase } from \"./hooks/customType-asset-update\";\nimport { CustomTypeCreateHookBase } from \"./hooks/customType-create\";\nimport { CustomTypeDeleteHookBase } from \"./hooks/customType-delete\";\nimport { CustomTypeLibraryReadHookBase } from \"./hooks/customTypeLibrary-read\";\nimport { CustomTypeReadHookBase } from \"./hooks/customType-read\";\nimport { CustomTypeRenameHookBase } from \"./hooks/customType-rename\";\nimport { CustomTypeUpdateHookBase } from \"./hooks/customType-update\";\nimport { DebugHookBase } from \"./hooks/debug\";\nimport { SliceAssetDeleteHookBase } from \"./hooks/slice-asset-delete\";\nimport { SliceAssetReadHookBase } from \"./hooks/slice-asset-read\";\nimport { SliceAssetUpdateHookBase } from \"./hooks/slice-asset-update\";\nimport { SliceCreateHookBase } from \"./hooks/slice-create\";\nimport { SliceDeleteHookBase } from \"./hooks/slice-delete\";\nimport { SliceLibraryReadHookBase } from \"./hooks/sliceLibrary-read\";\nimport { SliceReadHookBase } from \"./hooks/slice-read\";\nimport { SliceRenameHookBase } from \"./hooks/slice-rename\";\nimport { SliceUpdateHookBase } from \"./hooks/slice-update\";\nimport { SnippetReadHookBase } from \"./hooks/snippet-read\";\nimport { DocumentationReadHookBase } from \"./hooks/documentation-read\";\n\nimport { SliceTemplateLibraryReadHookBase } from \"./hooks/sliceTemplateLibrary-read\";\nimport { ProjectEnvironmentReadHookBase } from \"./hooks/project-environment-read\";\nimport { ProjectEnvironmentUpdateHookBase } from \"./hooks/project-environment-update\";\n\n/**\n * A value optionally wrapped in a `PromiseLike`.\n *\n * @typeParam T - The value that can optionally be wrapped.\n */\nexport type Promisable<T> = T | PromiseLike<T>;\n\n/**\n * A generic type for a user-provided plugin options. Prefer using a\n * plugin-specific type over this type.\n */\nexport type SliceMachinePluginOptions = Record<string, unknown>;\n\n/**\n * A string, object, or instance representing a registered plugin.\n *\n * @typeParam TPluginOptions - User-provided options for the plugin.\n */\nexport type SliceMachineConfigPluginRegistration<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> =\n\t| string\n\t| SliceMachinePlugin\n\t| {\n\t\t\tresolve: string | SliceMachinePlugin;\n\t\t\toptions?: TPluginOptions;\n\t };\n\n/**\n * Slice Machine configuration from `slicemachine.config.js`.\n */\nexport type SliceMachineConfig = {\n\t// TODO: Can we make `apiEndpoint` optional?\n\tapiEndpoint?: string;\n\t// NOTE: This is a new property.\n\trepositoryName: string;\n\tlocalSliceSimulatorURL?: string;\n\tlibraries?: string[];\n\tadapter: SliceMachineConfigPluginRegistration;\n\tplugins?: SliceMachineConfigPluginRegistration[];\n\tlabs?: { legacySliceUpgrader?: boolean };\n\tstarter?: string;\n};\n\n/**\n * Slice Machine project metadata.\n */\nexport type SliceMachineProject = {\n\t/**\n\t * An absolute path to project root.\n\t */\n\troot: string;\n\t/**\n\t * Slice Machine `slicemachine.config.json` content, validated.\n\t */\n\tconfig: SliceMachineConfig;\n};\n\n/**\n * A Slice Library's metadata.\n */\nexport type SliceLibrary = {\n\tid: string;\n};\n\n// ============================================================================\n//\n// # HOOK TYPES\n//\n// ============================================================================\n\n/**\n * A hook handler.\n */\nexport type SliceMachineHook<TData, TReturn> = (\n\tdata: TData,\n) => Promisable<TReturn>;\n\n/**\n * Extra arguments provided to hooks when called.\n *\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type SliceMachineHookExtraArgs<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = [context: SliceMachineContext<TPluginOptions>];\n\n/**\n * Utility type to extend a hook handler's type with Slice Machine-specific\n * extra arguments.\n *\n * @typeParam THook - Hook handler to extend.\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type ExtendSliceMachineHook<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTHook extends SliceMachineHook<any, any>,\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = (\n\t...args: [\n\t\t...args: Parameters<THook>,\n\t\t...extraArgs: SliceMachineHookExtraArgs<TPluginOptions>,\n\t]\n) => ReturnType<THook>;\n\n/**\n * Hook types.\n */\nexport const SliceMachineHookType = {\n\tslice_create: \"slice:create\",\n\tslice_update: \"slice:update\",\n\tslice_rename: \"slice:rename\",\n\tslice_delete: \"slice:delete\",\n\tslice_read: \"slice:read\",\n\tslice_asset_update: \"slice:asset:update\",\n\tslice_asset_delete: \"slice:asset:delete\",\n\tslice_asset_read: \"slice:asset:read\",\n\tsliceLibrary_read: \"slice-library:read\",\n\n\tcustomType_create: \"custom-type:create\",\n\tcustomType_update: \"custom-type:update\",\n\tcustomType_rename: \"custom-type:rename\",\n\tcustomType_delete: \"custom-type:delete\",\n\tcustomType_read: \"custom-type:read\",\n\tcustomType_asset_update: \"custom-type:asset:update\",\n\tcustomType_asset_delete: \"custom-type:asset:delete\",\n\tcustomType_asset_read: \"custom-type:asset:read\",\n\tcustomTypeLibrary_read: \"custom-type-library:read\",\n\tdocumentation_read: \"documentation:read\",\n\tsliceTemplateLibrary_read: \"slice-template-library:read\",\n\n\tsnippet_read: \"snippet:read\",\n\n\tproject_init: \"project:init\",\n\tproject_environment_read: \"project:environment:read\",\n\tproject_environment_update: \"project:environment:update\",\n\n\tdebug: \"debug\",\n} as const;\n\n/**\n * Hook types.\n */\nexport type SliceMachineHookTypes =\n\t(typeof SliceMachineHookType)[keyof typeof SliceMachineHookType];\n\n/**\n * Slice Machine-specific hook handlers.\n */\nexport type SliceMachineHooks = {\n\t// Slices\n\t[SliceMachineHookType.slice_create]: Hook<SliceCreateHookBase>;\n\t[SliceMachineHookType.slice_update]: Hook<SliceUpdateHookBase>;\n\t[SliceMachineHookType.slice_rename]: Hook<SliceRenameHookBase>;\n\t[SliceMachineHookType.slice_delete]: Hook<SliceDeleteHookBase>;\n\t[SliceMachineHookType.slice_read]: Hook<SliceReadHookBase>;\n\t[SliceMachineHookType.slice_asset_update]: Hook<SliceAssetUpdateHookBase>;\n\t[SliceMachineHookType.slice_asset_delete]: Hook<SliceAssetDeleteHookBase>;\n\t[SliceMachineHookType.slice_asset_read]: Hook<SliceAssetReadHookBase>;\n\n\t// Slice Libraries\n\t[SliceMachineHookType.sliceLibrary_read]: Hook<SliceLibraryReadHookBase>;\n\n\t// Custom Types\n\t[SliceMachineHookType.customType_create]: Hook<CustomTypeCreateHookBase>;\n\t[SliceMachineHookType.customType_update]: Hook<CustomTypeUpdateHookBase>;\n\t[SliceMachineHookType.customType_rename]: Hook<CustomTypeRenameHookBase>;\n\t[SliceMachineHookType.customType_delete]: Hook<CustomTypeDeleteHookBase>;\n\t[SliceMachineHookType.customType_read]: Hook<CustomTypeReadHookBase>;\n\t[SliceMachineHookType.customType_asset_update]: Hook<CustomTypeAssetUpdateHookBase>;\n\t[SliceMachineHookType.customType_asset_delete]: Hook<CustomTypeAssetDeleteHookBase>;\n\t[SliceMachineHookType.customType_asset_read]: Hook<CustomTypeAssetReadHookBase>;\n\n\t// Custom Type Libraries\n\t[SliceMachineHookType.customTypeLibrary_read]: Hook<CustomTypeLibraryReadHookBase>;\n\n\t// Snippets\n\t[SliceMachineHookType.snippet_read]: Hook<SnippetReadHookBase>;\n\n\t// Documentation\n\t[SliceMachineHookType.documentation_read]: Hook<DocumentationReadHookBase>;\n\n\t// Project\n\t[SliceMachineHookType.project_init]: Hook<ProjectInitHookBase>;\n\t[SliceMachineHookType.project_environment_read]: Hook<ProjectEnvironmentReadHookBase>;\n\t[SliceMachineHookType.project_environment_update]: Hook<ProjectEnvironmentUpdateHookBase>;\n\n\t// Debug\n\t[SliceMachineHookType.debug]: Hook<DebugHookBase>;\n\n\t// Slice templates\n\t[SliceMachineHookType.sliceTemplateLibrary_read]: Hook<SliceTemplateLibraryReadHookBase>;\n};\n"],"names":[],"mappings":";;AA2IO,MAAM,uBAAuB;AAAA,EACnC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EAEnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAE3B,cAAc;AAAA,EAEd,cAAc;AAAA,EACd,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAE5B,OAAO;;;"}
package/dist/types.d.ts CHANGED
@@ -59,6 +59,7 @@ export type SliceMachineConfig = {
59
59
  labs?: {
60
60
  legacySliceUpgrader?: boolean;
61
61
  };
62
+ starter?: string;
62
63
  };
63
64
  /**
64
65
  * Slice Machine project metadata.
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import { SliceMachineContext } from \"./createSliceMachineContext\";\nimport { SliceMachinePlugin } from \"./defineSliceMachinePlugin\";\nimport { Hook } from \"./lib/HookSystem\";\n\nimport { ProjectInitHookBase } from \"./hooks/project-init\";\nimport { CustomTypeAssetDeleteHookBase } from \"./hooks/customType-asset-delete\";\nimport { CustomTypeAssetReadHookBase } from \"./hooks/customType-asset-read\";\nimport { CustomTypeAssetUpdateHookBase } from \"./hooks/customType-asset-update\";\nimport { CustomTypeCreateHookBase } from \"./hooks/customType-create\";\nimport { CustomTypeDeleteHookBase } from \"./hooks/customType-delete\";\nimport { CustomTypeLibraryReadHookBase } from \"./hooks/customTypeLibrary-read\";\nimport { CustomTypeReadHookBase } from \"./hooks/customType-read\";\nimport { CustomTypeRenameHookBase } from \"./hooks/customType-rename\";\nimport { CustomTypeUpdateHookBase } from \"./hooks/customType-update\";\nimport { DebugHookBase } from \"./hooks/debug\";\nimport { SliceAssetDeleteHookBase } from \"./hooks/slice-asset-delete\";\nimport { SliceAssetReadHookBase } from \"./hooks/slice-asset-read\";\nimport { SliceAssetUpdateHookBase } from \"./hooks/slice-asset-update\";\nimport { SliceCreateHookBase } from \"./hooks/slice-create\";\nimport { SliceDeleteHookBase } from \"./hooks/slice-delete\";\nimport { SliceLibraryReadHookBase } from \"./hooks/sliceLibrary-read\";\nimport { SliceReadHookBase } from \"./hooks/slice-read\";\nimport { SliceRenameHookBase } from \"./hooks/slice-rename\";\nimport { SliceUpdateHookBase } from \"./hooks/slice-update\";\nimport { SnippetReadHookBase } from \"./hooks/snippet-read\";\nimport { DocumentationReadHookBase } from \"./hooks/documentation-read\";\n\nimport { SliceTemplateLibraryReadHookBase } from \"./hooks/sliceTemplateLibrary-read\";\nimport { ProjectEnvironmentReadHookBase } from \"./hooks/project-environment-read\";\nimport { ProjectEnvironmentUpdateHookBase } from \"./hooks/project-environment-update\";\n\n/**\n * A value optionally wrapped in a `PromiseLike`.\n *\n * @typeParam T - The value that can optionally be wrapped.\n */\nexport type Promisable<T> = T | PromiseLike<T>;\n\n/**\n * A generic type for a user-provided plugin options. Prefer using a\n * plugin-specific type over this type.\n */\nexport type SliceMachinePluginOptions = Record<string, unknown>;\n\n/**\n * A string, object, or instance representing a registered plugin.\n *\n * @typeParam TPluginOptions - User-provided options for the plugin.\n */\nexport type SliceMachineConfigPluginRegistration<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> =\n\t| string\n\t| SliceMachinePlugin\n\t| {\n\t\t\tresolve: string | SliceMachinePlugin;\n\t\t\toptions?: TPluginOptions;\n\t };\n\n/**\n * Slice Machine configuration from `slicemachine.config.js`.\n */\nexport type SliceMachineConfig = {\n\t// TODO: Can we make `apiEndpoint` optional?\n\tapiEndpoint?: string;\n\t// NOTE: This is a new property.\n\trepositoryName: string;\n\tlocalSliceSimulatorURL?: string;\n\tlibraries?: string[];\n\tadapter: SliceMachineConfigPluginRegistration;\n\tplugins?: SliceMachineConfigPluginRegistration[];\n\tlabs?: { legacySliceUpgrader?: boolean };\n};\n\n/**\n * Slice Machine project metadata.\n */\nexport type SliceMachineProject = {\n\t/**\n\t * An absolute path to project root.\n\t */\n\troot: string;\n\t/**\n\t * Slice Machine `slicemachine.config.json` content, validated.\n\t */\n\tconfig: SliceMachineConfig;\n};\n\n/**\n * A Slice Library's metadata.\n */\nexport type SliceLibrary = {\n\tid: string;\n};\n\n// ============================================================================\n//\n// # HOOK TYPES\n//\n// ============================================================================\n\n/**\n * A hook handler.\n */\nexport type SliceMachineHook<TData, TReturn> = (\n\tdata: TData,\n) => Promisable<TReturn>;\n\n/**\n * Extra arguments provided to hooks when called.\n *\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type SliceMachineHookExtraArgs<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = [context: SliceMachineContext<TPluginOptions>];\n\n/**\n * Utility type to extend a hook handler's type with Slice Machine-specific\n * extra arguments.\n *\n * @typeParam THook - Hook handler to extend.\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type ExtendSliceMachineHook<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTHook extends SliceMachineHook<any, any>,\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = (\n\t...args: [\n\t\t...args: Parameters<THook>,\n\t\t...extraArgs: SliceMachineHookExtraArgs<TPluginOptions>,\n\t]\n) => ReturnType<THook>;\n\n/**\n * Hook types.\n */\nexport const SliceMachineHookType = {\n\tslice_create: \"slice:create\",\n\tslice_update: \"slice:update\",\n\tslice_rename: \"slice:rename\",\n\tslice_delete: \"slice:delete\",\n\tslice_read: \"slice:read\",\n\tslice_asset_update: \"slice:asset:update\",\n\tslice_asset_delete: \"slice:asset:delete\",\n\tslice_asset_read: \"slice:asset:read\",\n\tsliceLibrary_read: \"slice-library:read\",\n\n\tcustomType_create: \"custom-type:create\",\n\tcustomType_update: \"custom-type:update\",\n\tcustomType_rename: \"custom-type:rename\",\n\tcustomType_delete: \"custom-type:delete\",\n\tcustomType_read: \"custom-type:read\",\n\tcustomType_asset_update: \"custom-type:asset:update\",\n\tcustomType_asset_delete: \"custom-type:asset:delete\",\n\tcustomType_asset_read: \"custom-type:asset:read\",\n\tcustomTypeLibrary_read: \"custom-type-library:read\",\n\tdocumentation_read: \"documentation:read\",\n\tsliceTemplateLibrary_read: \"slice-template-library:read\",\n\n\tsnippet_read: \"snippet:read\",\n\n\tproject_init: \"project:init\",\n\tproject_environment_read: \"project:environment:read\",\n\tproject_environment_update: \"project:environment:update\",\n\n\tdebug: \"debug\",\n} as const;\n\n/**\n * Hook types.\n */\nexport type SliceMachineHookTypes =\n\t(typeof SliceMachineHookType)[keyof typeof SliceMachineHookType];\n\n/**\n * Slice Machine-specific hook handlers.\n */\nexport type SliceMachineHooks = {\n\t// Slices\n\t[SliceMachineHookType.slice_create]: Hook<SliceCreateHookBase>;\n\t[SliceMachineHookType.slice_update]: Hook<SliceUpdateHookBase>;\n\t[SliceMachineHookType.slice_rename]: Hook<SliceRenameHookBase>;\n\t[SliceMachineHookType.slice_delete]: Hook<SliceDeleteHookBase>;\n\t[SliceMachineHookType.slice_read]: Hook<SliceReadHookBase>;\n\t[SliceMachineHookType.slice_asset_update]: Hook<SliceAssetUpdateHookBase>;\n\t[SliceMachineHookType.slice_asset_delete]: Hook<SliceAssetDeleteHookBase>;\n\t[SliceMachineHookType.slice_asset_read]: Hook<SliceAssetReadHookBase>;\n\n\t// Slice Libraries\n\t[SliceMachineHookType.sliceLibrary_read]: Hook<SliceLibraryReadHookBase>;\n\n\t// Custom Types\n\t[SliceMachineHookType.customType_create]: Hook<CustomTypeCreateHookBase>;\n\t[SliceMachineHookType.customType_update]: Hook<CustomTypeUpdateHookBase>;\n\t[SliceMachineHookType.customType_rename]: Hook<CustomTypeRenameHookBase>;\n\t[SliceMachineHookType.customType_delete]: Hook<CustomTypeDeleteHookBase>;\n\t[SliceMachineHookType.customType_read]: Hook<CustomTypeReadHookBase>;\n\t[SliceMachineHookType.customType_asset_update]: Hook<CustomTypeAssetUpdateHookBase>;\n\t[SliceMachineHookType.customType_asset_delete]: Hook<CustomTypeAssetDeleteHookBase>;\n\t[SliceMachineHookType.customType_asset_read]: Hook<CustomTypeAssetReadHookBase>;\n\n\t// Custom Type Libraries\n\t[SliceMachineHookType.customTypeLibrary_read]: Hook<CustomTypeLibraryReadHookBase>;\n\n\t// Snippets\n\t[SliceMachineHookType.snippet_read]: Hook<SnippetReadHookBase>;\n\n\t// Documentation\n\t[SliceMachineHookType.documentation_read]: Hook<DocumentationReadHookBase>;\n\n\t// Project\n\t[SliceMachineHookType.project_init]: Hook<ProjectInitHookBase>;\n\t[SliceMachineHookType.project_environment_read]: Hook<ProjectEnvironmentReadHookBase>;\n\t[SliceMachineHookType.project_environment_update]: Hook<ProjectEnvironmentUpdateHookBase>;\n\n\t// Debug\n\t[SliceMachineHookType.debug]: Hook<DebugHookBase>;\n\n\t// Slice templates\n\t[SliceMachineHookType.sliceTemplateLibrary_read]: Hook<SliceTemplateLibraryReadHookBase>;\n};\n"],"names":[],"mappings":"AA0IO,MAAM,uBAAuB;AAAA,EACnC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EAEnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAE3B,cAAc;AAAA,EAEd,cAAc;AAAA,EACd,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAE5B,OAAO;;"}
1
+ {"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import { SliceMachineContext } from \"./createSliceMachineContext\";\nimport { SliceMachinePlugin } from \"./defineSliceMachinePlugin\";\nimport { Hook } from \"./lib/HookSystem\";\n\nimport { ProjectInitHookBase } from \"./hooks/project-init\";\nimport { CustomTypeAssetDeleteHookBase } from \"./hooks/customType-asset-delete\";\nimport { CustomTypeAssetReadHookBase } from \"./hooks/customType-asset-read\";\nimport { CustomTypeAssetUpdateHookBase } from \"./hooks/customType-asset-update\";\nimport { CustomTypeCreateHookBase } from \"./hooks/customType-create\";\nimport { CustomTypeDeleteHookBase } from \"./hooks/customType-delete\";\nimport { CustomTypeLibraryReadHookBase } from \"./hooks/customTypeLibrary-read\";\nimport { CustomTypeReadHookBase } from \"./hooks/customType-read\";\nimport { CustomTypeRenameHookBase } from \"./hooks/customType-rename\";\nimport { CustomTypeUpdateHookBase } from \"./hooks/customType-update\";\nimport { DebugHookBase } from \"./hooks/debug\";\nimport { SliceAssetDeleteHookBase } from \"./hooks/slice-asset-delete\";\nimport { SliceAssetReadHookBase } from \"./hooks/slice-asset-read\";\nimport { SliceAssetUpdateHookBase } from \"./hooks/slice-asset-update\";\nimport { SliceCreateHookBase } from \"./hooks/slice-create\";\nimport { SliceDeleteHookBase } from \"./hooks/slice-delete\";\nimport { SliceLibraryReadHookBase } from \"./hooks/sliceLibrary-read\";\nimport { SliceReadHookBase } from \"./hooks/slice-read\";\nimport { SliceRenameHookBase } from \"./hooks/slice-rename\";\nimport { SliceUpdateHookBase } from \"./hooks/slice-update\";\nimport { SnippetReadHookBase } from \"./hooks/snippet-read\";\nimport { DocumentationReadHookBase } from \"./hooks/documentation-read\";\n\nimport { SliceTemplateLibraryReadHookBase } from \"./hooks/sliceTemplateLibrary-read\";\nimport { ProjectEnvironmentReadHookBase } from \"./hooks/project-environment-read\";\nimport { ProjectEnvironmentUpdateHookBase } from \"./hooks/project-environment-update\";\n\n/**\n * A value optionally wrapped in a `PromiseLike`.\n *\n * @typeParam T - The value that can optionally be wrapped.\n */\nexport type Promisable<T> = T | PromiseLike<T>;\n\n/**\n * A generic type for a user-provided plugin options. Prefer using a\n * plugin-specific type over this type.\n */\nexport type SliceMachinePluginOptions = Record<string, unknown>;\n\n/**\n * A string, object, or instance representing a registered plugin.\n *\n * @typeParam TPluginOptions - User-provided options for the plugin.\n */\nexport type SliceMachineConfigPluginRegistration<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> =\n\t| string\n\t| SliceMachinePlugin\n\t| {\n\t\t\tresolve: string | SliceMachinePlugin;\n\t\t\toptions?: TPluginOptions;\n\t };\n\n/**\n * Slice Machine configuration from `slicemachine.config.js`.\n */\nexport type SliceMachineConfig = {\n\t// TODO: Can we make `apiEndpoint` optional?\n\tapiEndpoint?: string;\n\t// NOTE: This is a new property.\n\trepositoryName: string;\n\tlocalSliceSimulatorURL?: string;\n\tlibraries?: string[];\n\tadapter: SliceMachineConfigPluginRegistration;\n\tplugins?: SliceMachineConfigPluginRegistration[];\n\tlabs?: { legacySliceUpgrader?: boolean };\n\tstarter?: string;\n};\n\n/**\n * Slice Machine project metadata.\n */\nexport type SliceMachineProject = {\n\t/**\n\t * An absolute path to project root.\n\t */\n\troot: string;\n\t/**\n\t * Slice Machine `slicemachine.config.json` content, validated.\n\t */\n\tconfig: SliceMachineConfig;\n};\n\n/**\n * A Slice Library's metadata.\n */\nexport type SliceLibrary = {\n\tid: string;\n};\n\n// ============================================================================\n//\n// # HOOK TYPES\n//\n// ============================================================================\n\n/**\n * A hook handler.\n */\nexport type SliceMachineHook<TData, TReturn> = (\n\tdata: TData,\n) => Promisable<TReturn>;\n\n/**\n * Extra arguments provided to hooks when called.\n *\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type SliceMachineHookExtraArgs<\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = [context: SliceMachineContext<TPluginOptions>];\n\n/**\n * Utility type to extend a hook handler's type with Slice Machine-specific\n * extra arguments.\n *\n * @typeParam THook - Hook handler to extend.\n * @typeParam TPluginOptions - User-provided options for the hook's plugin.\n */\nexport type ExtendSliceMachineHook<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTHook extends SliceMachineHook<any, any>,\n\tTPluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions,\n> = (\n\t...args: [\n\t\t...args: Parameters<THook>,\n\t\t...extraArgs: SliceMachineHookExtraArgs<TPluginOptions>,\n\t]\n) => ReturnType<THook>;\n\n/**\n * Hook types.\n */\nexport const SliceMachineHookType = {\n\tslice_create: \"slice:create\",\n\tslice_update: \"slice:update\",\n\tslice_rename: \"slice:rename\",\n\tslice_delete: \"slice:delete\",\n\tslice_read: \"slice:read\",\n\tslice_asset_update: \"slice:asset:update\",\n\tslice_asset_delete: \"slice:asset:delete\",\n\tslice_asset_read: \"slice:asset:read\",\n\tsliceLibrary_read: \"slice-library:read\",\n\n\tcustomType_create: \"custom-type:create\",\n\tcustomType_update: \"custom-type:update\",\n\tcustomType_rename: \"custom-type:rename\",\n\tcustomType_delete: \"custom-type:delete\",\n\tcustomType_read: \"custom-type:read\",\n\tcustomType_asset_update: \"custom-type:asset:update\",\n\tcustomType_asset_delete: \"custom-type:asset:delete\",\n\tcustomType_asset_read: \"custom-type:asset:read\",\n\tcustomTypeLibrary_read: \"custom-type-library:read\",\n\tdocumentation_read: \"documentation:read\",\n\tsliceTemplateLibrary_read: \"slice-template-library:read\",\n\n\tsnippet_read: \"snippet:read\",\n\n\tproject_init: \"project:init\",\n\tproject_environment_read: \"project:environment:read\",\n\tproject_environment_update: \"project:environment:update\",\n\n\tdebug: \"debug\",\n} as const;\n\n/**\n * Hook types.\n */\nexport type SliceMachineHookTypes =\n\t(typeof SliceMachineHookType)[keyof typeof SliceMachineHookType];\n\n/**\n * Slice Machine-specific hook handlers.\n */\nexport type SliceMachineHooks = {\n\t// Slices\n\t[SliceMachineHookType.slice_create]: Hook<SliceCreateHookBase>;\n\t[SliceMachineHookType.slice_update]: Hook<SliceUpdateHookBase>;\n\t[SliceMachineHookType.slice_rename]: Hook<SliceRenameHookBase>;\n\t[SliceMachineHookType.slice_delete]: Hook<SliceDeleteHookBase>;\n\t[SliceMachineHookType.slice_read]: Hook<SliceReadHookBase>;\n\t[SliceMachineHookType.slice_asset_update]: Hook<SliceAssetUpdateHookBase>;\n\t[SliceMachineHookType.slice_asset_delete]: Hook<SliceAssetDeleteHookBase>;\n\t[SliceMachineHookType.slice_asset_read]: Hook<SliceAssetReadHookBase>;\n\n\t// Slice Libraries\n\t[SliceMachineHookType.sliceLibrary_read]: Hook<SliceLibraryReadHookBase>;\n\n\t// Custom Types\n\t[SliceMachineHookType.customType_create]: Hook<CustomTypeCreateHookBase>;\n\t[SliceMachineHookType.customType_update]: Hook<CustomTypeUpdateHookBase>;\n\t[SliceMachineHookType.customType_rename]: Hook<CustomTypeRenameHookBase>;\n\t[SliceMachineHookType.customType_delete]: Hook<CustomTypeDeleteHookBase>;\n\t[SliceMachineHookType.customType_read]: Hook<CustomTypeReadHookBase>;\n\t[SliceMachineHookType.customType_asset_update]: Hook<CustomTypeAssetUpdateHookBase>;\n\t[SliceMachineHookType.customType_asset_delete]: Hook<CustomTypeAssetDeleteHookBase>;\n\t[SliceMachineHookType.customType_asset_read]: Hook<CustomTypeAssetReadHookBase>;\n\n\t// Custom Type Libraries\n\t[SliceMachineHookType.customTypeLibrary_read]: Hook<CustomTypeLibraryReadHookBase>;\n\n\t// Snippets\n\t[SliceMachineHookType.snippet_read]: Hook<SnippetReadHookBase>;\n\n\t// Documentation\n\t[SliceMachineHookType.documentation_read]: Hook<DocumentationReadHookBase>;\n\n\t// Project\n\t[SliceMachineHookType.project_init]: Hook<ProjectInitHookBase>;\n\t[SliceMachineHookType.project_environment_read]: Hook<ProjectEnvironmentReadHookBase>;\n\t[SliceMachineHookType.project_environment_update]: Hook<ProjectEnvironmentUpdateHookBase>;\n\n\t// Debug\n\t[SliceMachineHookType.debug]: Hook<DebugHookBase>;\n\n\t// Slice templates\n\t[SliceMachineHookType.sliceTemplateLibrary_read]: Hook<SliceTemplateLibraryReadHookBase>;\n};\n"],"names":[],"mappings":"AA2IO,MAAM,uBAAuB;AAAA,EACnC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EAEnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAE3B,cAAc;AAAA,EAEd,cAAc;AAAA,EACd,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAE5B,OAAO;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slicemachine/plugin-kit",
3
- "version": "0.4.94-beta.1",
3
+ "version": "0.4.94-beta.3",
4
4
  "description": "A set of helpers to develop and run Slice Machine plugins",
5
5
  "keywords": [
6
6
  "typescript",
@@ -27,6 +27,7 @@ const SliceMachineConfigCodec = t.intersection([
27
27
  localSliceSimulatorURL: t.string,
28
28
  plugins: t.array(SliceMachineConfigPluginRegistrationCodec),
29
29
  labs: t.partial({ legacySliceUpgrader: t.boolean }),
30
+ starter: t.string,
30
31
  }),
31
32
  ]);
32
33
 
package/src/types.ts CHANGED
@@ -70,6 +70,7 @@ export type SliceMachineConfig = {
70
70
  adapter: SliceMachineConfigPluginRegistration;
71
71
  plugins?: SliceMachineConfigPluginRegistration[];
72
72
  labs?: { legacySliceUpgrader?: boolean };
73
+ starter?: string;
73
74
  };
74
75
 
75
76
  /**