tyfigo 0.1.0-next.8e5087f.0 → 0.1.0-next.d3c2bea.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.
Files changed (68) hide show
  1. package/dist/bun.d.mts +1 -1
  2. package/dist/bun.mjs +5 -7
  3. package/dist/bun.mjs.map +1 -1
  4. package/dist/effect.d.mts +2 -3
  5. package/dist/effect.mjs +2 -2
  6. package/dist/index.d.mts +2 -3
  7. package/dist/index.mjs +1 -1
  8. package/dist/mapper.mjs +1 -1
  9. package/dist/{formats-BwoQKxPO.mjs → placeholders-MqW2KO9Z.mjs} +76 -546
  10. package/dist/placeholders-MqW2KO9Z.mjs.map +1 -0
  11. package/dist/register.mjs +2 -2
  12. package/dist/{index-MDPZNOG1.d.mts → resolve-BeFHJeZb.d.mts} +51 -9
  13. package/dist/{resolve-Nq14yl8P.mjs → resolve-CDWA58rz.mjs} +100 -82
  14. package/dist/resolve-CDWA58rz.mjs.map +1 -0
  15. package/dist/runtime/index.d.mts +44 -3
  16. package/dist/runtime/index.mjs +3 -4
  17. package/dist/{load-CH3j1lXr.mjs → runtime-BuQk1xsn.mjs} +11 -36
  18. package/dist/runtime-BuQk1xsn.mjs.map +1 -0
  19. package/dist/{schema-C0w0vrh_.mjs → schema-C31aywfc.mjs} +3 -4
  20. package/dist/{schema-C0w0vrh_.mjs.map → schema-C31aywfc.mjs.map} +1 -1
  21. package/dist/{schema-CQrgRpGm.d.mts → schema-CNquZBC8.d.mts} +2 -3
  22. package/package.json +1 -96
  23. package/dist/formats-BwoQKxPO.mjs.map +0 -1
  24. package/dist/load-BkHwqa05.d.mts +0 -53
  25. package/dist/load-CH3j1lXr.mjs.map +0 -1
  26. package/dist/plugins/esbuild.d.mts +0 -5
  27. package/dist/plugins/esbuild.mjs +0 -6
  28. package/dist/plugins/esbuild.mjs.map +0 -1
  29. package/dist/plugins/jest.d.mts +0 -10
  30. package/dist/plugins/jest.mjs +0 -29
  31. package/dist/plugins/jest.mjs.map +0 -1
  32. package/dist/plugins/loader.d.mts +0 -15
  33. package/dist/plugins/loader.mjs +0 -21
  34. package/dist/plugins/loader.mjs.map +0 -1
  35. package/dist/plugins/next.d.mts +0 -21
  36. package/dist/plugins/next.mjs +0 -121
  37. package/dist/plugins/next.mjs.map +0 -1
  38. package/dist/plugins/rolldown.d.mts +0 -5
  39. package/dist/plugins/rolldown.mjs +0 -6
  40. package/dist/plugins/rolldown.mjs.map +0 -1
  41. package/dist/plugins/rollup.d.mts +0 -5
  42. package/dist/plugins/rollup.mjs +0 -6
  43. package/dist/plugins/rollup.mjs.map +0 -1
  44. package/dist/plugins/rsbuild.d.mts +0 -5
  45. package/dist/plugins/rsbuild.mjs +0 -6
  46. package/dist/plugins/rsbuild.mjs.map +0 -1
  47. package/dist/plugins/rspack.d.mts +0 -5
  48. package/dist/plugins/rspack.mjs +0 -6
  49. package/dist/plugins/rspack.mjs.map +0 -1
  50. package/dist/plugins/vite.d.mts +0 -5
  51. package/dist/plugins/vite.mjs +0 -6
  52. package/dist/plugins/vite.mjs.map +0 -1
  53. package/dist/plugins/webpack.d.mts +0 -5
  54. package/dist/plugins/webpack.mjs +0 -6
  55. package/dist/plugins/webpack.mjs.map +0 -1
  56. package/dist/resolve-D6InkI3S.mjs +0 -72
  57. package/dist/resolve-D6InkI3S.mjs.map +0 -1
  58. package/dist/resolve-Nq14yl8P.mjs.map +0 -1
  59. package/dist/resolve-ZvBQr4kx.d.mts +0 -65
  60. package/dist/runtime-la_KkjCS.mjs +0 -1
  61. package/dist/shared-3h97HNnt.d.mts +0 -22
  62. package/dist/shared-B7Et_DQe.mjs +0 -16
  63. package/dist/shared-B7Et_DQe.mjs.map +0 -1
  64. package/dist/sync-Byh0-2q_.mjs +0 -14
  65. package/dist/sync-Byh0-2q_.mjs.map +0 -1
  66. package/dist/unplugin-BkbVY1zO.d.mts +0 -2
  67. package/dist/unplugin-DiektQ4A.mjs +0 -69
  68. package/dist/unplugin-DiektQ4A.mjs.map +0 -1
package/dist/bun.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BunPlugin } from "bun";
2
2
  /**
3
3
  * The tyfigo Bun plugin. Importing `tyfigo/bun` (a `bunfig.toml` `preload`) registers it for the runtime and `bun test`; pass
4
- * `tyfigo()` in `plugins` to use it with `Bun.build`, where a `browser` target inlines the config and a server target inlines the config files and reads `.env` files when it runs.
4
+ * `tyfigo()` in `plugins` to use it with `Bun.build`, where a `browser` target inlines the config.
5
5
  */
6
6
  export declare const tyfigo: () => BunPlugin;
7
7
  //# sourceMappingURL=bun.d.mts.map
package/dist/bun.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as configSuffixes, u as formatProblems } from "./formats-BwoQKxPO.mjs";
2
- import { t as load } from "./load-CH3j1lXr.mjs";
1
+ import { i as configSuffixes, u as formatProblems } from "./placeholders-MqW2KO9Z.mjs";
2
+ import { t as load } from "./runtime-BuQk1xsn.mjs";
3
3
  import { extname } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { plugin } from "bun";
@@ -8,18 +8,16 @@ const runtime = fileURLToPath(new URL(`runtime/index${extname(import.meta.url)}`
8
8
  const filter = new RegExp(`[^/\\\\](?:${configSuffixes.map((suffix) => suffix.replaceAll(".", "\\.")).join("|")})$`);
9
9
  /**
10
10
  * The tyfigo Bun plugin. Importing `tyfigo/bun` (a `bunfig.toml` `preload`) registers it for the runtime and `bun test`; pass
11
- * `tyfigo()` in `plugins` to use it with `Bun.build`, where a `browser` target inlines the config and a server target inlines the config files and reads `.env` files when it runs.
11
+ * `tyfigo()` in `plugins` to use it with `Bun.build`, where a `browser` target inlines the config.
12
12
  */
13
13
  const tyfigo = () => ({
14
14
  name: "tyfigo",
15
15
  setup(build) {
16
- const config = build.config;
17
- const target = config?.target === "browser" ? "browser" : "server";
16
+ const target = build.config?.target === "browser" ? "browser" : "server";
18
17
  build.onLoad({ filter }, ({ path }) => {
19
18
  const result = load(path, {
20
19
  target,
21
- runtime,
22
- bundle: config !== void 0
20
+ runtime
23
21
  });
24
22
  if (result.problems.length > 0) throw new Error(`Invalid config ${path}\n${formatProblems(result.problems)}`);
25
23
  return {
package/dist/bun.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bun.mjs","names":[],"sources":["../src/bun.ts"],"sourcesContent":["import { extname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { plugin } from 'bun';\n\nimport { configSuffixes, formatProblems } from './core/index.ts';\nimport { load } from './runtime/index.ts';\n\nimport type { BunPlugin } from 'bun';\n\n// The runtime next to this module, so it resolves from config files outside the dependency tree: `.ts` in this repo, `.mjs` once built.\nconst runtime = fileURLToPath(new URL(`runtime/index${extname(import.meta.url)}`, import.meta.url));\n\nconst filter = new RegExp(`[^/\\\\\\\\](?:${configSuffixes.map((suffix) => suffix.replaceAll('.', '\\\\.')).join('|')})$`);\n\n/**\n * The tyfigo Bun plugin. Importing `tyfigo/bun` (a `bunfig.toml` `preload`) registers it for the runtime and `bun test`; pass\n * `tyfigo()` in `plugins` to use it with `Bun.build`, where a `browser` target inlines the config and a server target inlines the config files and reads `.env` files when it runs.\n */\nexport const tyfigo = (): BunPlugin => ({\n\tname: 'tyfigo',\n\tsetup(build) {\n\t\tconst config = build.config as typeof build.config | undefined;\n\t\tconst target = config?.target === 'browser' ? 'browser' : 'server';\n\t\tbuild.onLoad({ filter }, ({ path }) => {\n\t\t\tconst result = load(path, { target, runtime, bundle: config !== undefined });\n\t\t\tif (result.problems.length > 0) {\n\t\t\t\tthrow new Error(`Invalid config ${path}\\n${formatProblems(result.problems)}`);\n\t\t\t}\n\t\t\treturn { contents: result.code, loader: 'js' };\n\t\t});\n\t},\n});\n\nvoid plugin(tyfigo());\n"],"mappings":";;;;;;AAWA,MAAM,UAAU,cAAc,IAAI,IAAI,gBAAgB,QAAQ,YAAY,GAAG,KAAK,YAAY,GAAG,CAAC;AAElG,MAAM,SAAS,IAAI,OAAO,cAAc,eAAe,KAAK,WAAW,OAAO,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,GAAG;;;;;AAMnH,MAAa,gBAA2B;CACvC,MAAM;CACN,MAAM,OAAO;EACZ,MAAM,SAAS,MAAM;EACrB,MAAM,SAAS,QAAQ,WAAW,YAAY,YAAY;EAC1D,MAAM,OAAO,EAAE,OAAO,IAAI,EAAE,WAAW;GACtC,MAAM,SAAS,KAAK,MAAM;IAAE;IAAQ;IAAS,QAAQ,WAAW,KAAA;GAAU,CAAC;GAC3E,IAAI,OAAO,SAAS,SAAS,GAC5B,MAAM,IAAI,MAAM,kBAAkB,KAAK,IAAI,eAAe,OAAO,QAAQ,GAAG;GAE7E,OAAO;IAAE,UAAU,OAAO;IAAM,QAAQ;GAAK;EAC9C,CAAC;CACF;AACD;AAEK,OAAO,OAAO,CAAC"}
1
+ {"version":3,"file":"bun.mjs","names":[],"sources":["../src/bun.ts"],"sourcesContent":["import { extname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { plugin } from 'bun';\n\nimport { configSuffixes, formatProblems } from './core/index.ts';\nimport { load } from './runtime/index.ts';\n\nimport type { BunPlugin } from 'bun';\n\n// The runtime next to this module, so it resolves from config files outside the dependency tree: `.ts` in this repo, `.mjs` once built.\nconst runtime = fileURLToPath(new URL(`runtime/index${extname(import.meta.url)}`, import.meta.url));\n\nconst filter = new RegExp(`[^/\\\\\\\\](?:${configSuffixes.map((suffix) => suffix.replaceAll('.', '\\\\.')).join('|')})$`);\n\n/**\n * The tyfigo Bun plugin. Importing `tyfigo/bun` (a `bunfig.toml` `preload`) registers it for the runtime and `bun test`; pass\n * `tyfigo()` in `plugins` to use it with `Bun.build`, where a `browser` target inlines the config.\n */\nexport const tyfigo = (): BunPlugin => ({\n\tname: 'tyfigo',\n\tsetup(build) {\n\t\tconst target = (build.config as typeof build.config | undefined)?.target === 'browser' ? 'browser' : 'server';\n\t\tbuild.onLoad({ filter }, ({ path }) => {\n\t\t\tconst result = load(path, { target, runtime });\n\t\t\tif (result.problems.length > 0) {\n\t\t\t\tthrow new Error(`Invalid config ${path}\\n${formatProblems(result.problems)}`);\n\t\t\t}\n\t\t\treturn { contents: result.code, loader: 'js' };\n\t\t});\n\t},\n});\n\nvoid plugin(tyfigo());\n"],"mappings":";;;;;;AAWA,MAAM,UAAU,cAAc,IAAI,IAAI,gBAAgB,QAAQ,YAAY,GAAG,KAAK,YAAY,GAAG,CAAC;AAElG,MAAM,SAAS,IAAI,OAAO,cAAc,eAAe,KAAK,WAAW,OAAO,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,GAAG;;;;;AAMnH,MAAa,gBAA2B;CACvC,MAAM;CACN,MAAM,OAAO;EACZ,MAAM,SAAU,MAAM,QAA4C,WAAW,YAAY,YAAY;EACrG,MAAM,OAAO,EAAE,OAAO,IAAI,EAAE,WAAW;GACtC,MAAM,SAAS,KAAK,MAAM;IAAE;IAAQ;GAAQ,CAAC;GAC7C,IAAI,OAAO,SAAS,SAAS,GAC5B,MAAM,IAAI,MAAM,kBAAkB,KAAK,IAAI,eAAe,OAAO,QAAQ,GAAG;GAE7E,OAAO;IAAE,UAAU,OAAO;IAAM,QAAQ;GAAK;EAC9C,CAAC;CACF;AACD;AAEK,OAAO,OAAO,CAAC"}
package/dist/effect.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { a as LocatedSpan, c as Path, i as ResolvedLayer, l as Span, n as ResolveOptions, o as Problem, r as ResolvedConfig, s as ProblemCode } from "./index-MDPZNOG1.mjs";
2
- import { i as ConfigSource } from "./resolve-ZvBQr4kx.mjs";
3
- import { a as LooseInput, i as LoadEnvOptions, n as ConfigSchema, o as SchemaInput, r as ConfigValidationError, s as SchemaOutput, t as ConfigIssue } from "./schema-CQrgRpGm.mjs";
1
+ import { d as ResolvedLayer, f as LocatedSpan, g as Span, h as Path, l as ResolveOptions, m as ProblemCode, p as Problem, r as ConfigSource, u as ResolvedConfig } from "./resolve-BeFHJeZb.mjs";
2
+ import { a as LooseInput, i as LoadEnvOptions, n as ConfigSchema, o as SchemaInput, r as ConfigValidationError, s as SchemaOutput, t as ConfigIssue } from "./schema-CNquZBC8.mjs";
4
3
  import { ConfigProvider, Context, Effect, Layer, Schema } from "effect";
5
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
5
  /**
package/dist/effect.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as resolveConfig } from "./resolve-Nq14yl8P.mjs";
2
- import { n as decodeConfig, r as decodeEnv, t as ConfigValidationError } from "./schema-C0w0vrh_.mjs";
1
+ import { o as resolveConfig } from "./resolve-CDWA58rz.mjs";
2
+ import { n as decodeConfig, r as decodeEnv, t as ConfigValidationError } from "./schema-C31aywfc.mjs";
3
3
  import { ConfigProvider, Context, Effect, Layer } from "effect";
4
4
  // src/effect/load.ts
5
5
  /**
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { a as LocatedSpan, c as Path, i as ResolvedLayer, l as Span, n as ResolveOptions, o as Problem, r as ResolvedConfig, s as ProblemCode } from "./index-MDPZNOG1.mjs";
2
- import { i as ConfigSource } from "./resolve-ZvBQr4kx.mjs";
3
- import { a as LooseInput, i as LoadEnvOptions, n as ConfigSchema, o as SchemaInput, r as ConfigValidationError, s as SchemaOutput, t as ConfigIssue } from "./schema-CQrgRpGm.mjs";
1
+ import { d as ResolvedLayer, f as LocatedSpan, g as Span, h as Path, l as ResolveOptions, m as ProblemCode, p as Problem, r as ConfigSource, u as ResolvedConfig } from "./resolve-BeFHJeZb.mjs";
2
+ import { a as LooseInput, i as LoadEnvOptions, n as ConfigSchema, o as SchemaInput, r as ConfigValidationError, s as SchemaOutput, t as ConfigIssue } from "./schema-CNquZBC8.mjs";
4
3
  /**
5
4
  * Validates a config import (or any value) with a Standard Schema or an Effect Schema and returns the schema's output.
6
5
  *
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as decodeConfig, r as decodeEnv, t as ConfigValidationError } from "./schema-C0w0vrh_.mjs";
1
+ import { n as decodeConfig, r as decodeEnv, t as ConfigValidationError } from "./schema-C31aywfc.mjs";
2
2
  import { Effect } from "effect";
3
3
  // src/index.ts
4
4
  /**
package/dist/mapper.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as resolvePlaceholders, c as pathKey, i as isPlainObject, l as fileProblem, n as parseConfigFileName, o as SourceIndex, t as configSuffixes } from "./formats-BwoQKxPO.mjs";
1
+ import { a as parseConfigFileName, c as pathKey, i as configSuffixes, l as fileProblem, n as isPlainObject, o as SourceIndex, r as resolvePlaceholders } from "./placeholders-MqW2KO9Z.mjs";
2
2
  import { basename, dirname, relative, resolve } from "node:path";
3
3
  import process from "node:process";
4
4
  import { Buffer } from "node:buffer";