@slip-stream-kit/config 0.37.0 → 0.39.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.
@@ -37,6 +37,14 @@ export interface DeployHookContext {
37
37
  outDir: string;
38
38
  /** The app inside it, e.g. `<root>/out/apps/client/api`. */
39
39
  appDir: string;
40
+ /**
41
+ * Imports a package as the app's own code would, from the installed `out/`. A plain `import()` in a hook
42
+ * resolves from the deploy script, which is loaded from the root checkout that is never installed.
43
+ *
44
+ * @example
45
+ * const { publishSiteIndexManifest } = await importFromApp<typeof SiteIndexDeploy>('@wl/site-index/deploy')
46
+ */
47
+ importFromApp: <T>(specifier: string) => Promise<T>;
40
48
  }
41
49
  export type DeployHook = (context: DeployHookContext) => Promise<void> | void;
42
50
  export interface DeployBuildOptions {
@@ -128,4 +136,13 @@ export interface DeployToolkit {
128
136
  deployFrontendUi: (options: DeployFrontendUiOptions) => Promise<void>;
129
137
  /** Synchronous `aws lambda invoke`s, failing on the handler's error, not only the CLI's exit code. */
130
138
  invokeLambdas: (options: DeployInvokeLambdasOptions) => Promise<void>;
139
+ /**
140
+ * Imports a package as code inside `appDir` would, e.g. `<root>/out/apps/client/ui` after `pruneAndBuild`.
141
+ * A plain `import()` resolves from the deploy script, which is loaded from the root checkout that is never
142
+ * installed. A hook gets the same function bound to its own app as `context.importFromApp`.
143
+ *
144
+ * @example
145
+ * const { publishSiteIndexManifest } = await importFromApp<typeof SiteIndexDeploy>(appDir, '@wl/site-index/deploy')
146
+ */
147
+ importFromApp: <T>(appDir: string, specifier: string) => Promise<T>;
131
148
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slip-stream-kit/config",
3
3
  "type": "module",
4
- "version": "0.37.0",
4
+ "version": "0.39.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ArthurSaenz/infra-kit.git",