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.
- package/dist/bun.d.mts +1 -1
- package/dist/bun.mjs +5 -7
- package/dist/bun.mjs.map +1 -1
- package/dist/effect.d.mts +2 -3
- package/dist/effect.mjs +2 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +1 -1
- package/dist/mapper.mjs +1 -1
- package/dist/{formats-BwoQKxPO.mjs → placeholders-MqW2KO9Z.mjs} +76 -546
- package/dist/placeholders-MqW2KO9Z.mjs.map +1 -0
- package/dist/register.mjs +2 -2
- package/dist/{index-MDPZNOG1.d.mts → resolve-BeFHJeZb.d.mts} +51 -9
- package/dist/{resolve-Nq14yl8P.mjs → resolve-CDWA58rz.mjs} +100 -82
- package/dist/resolve-CDWA58rz.mjs.map +1 -0
- package/dist/runtime/index.d.mts +44 -3
- package/dist/runtime/index.mjs +3 -4
- package/dist/{load-CH3j1lXr.mjs → runtime-BuQk1xsn.mjs} +11 -36
- package/dist/runtime-BuQk1xsn.mjs.map +1 -0
- package/dist/{schema-C0w0vrh_.mjs → schema-C31aywfc.mjs} +3 -4
- package/dist/{schema-C0w0vrh_.mjs.map → schema-C31aywfc.mjs.map} +1 -1
- package/dist/{schema-CQrgRpGm.d.mts → schema-CNquZBC8.d.mts} +2 -3
- package/package.json +1 -96
- package/dist/formats-BwoQKxPO.mjs.map +0 -1
- package/dist/load-BkHwqa05.d.mts +0 -53
- package/dist/load-CH3j1lXr.mjs.map +0 -1
- package/dist/plugins/esbuild.d.mts +0 -5
- package/dist/plugins/esbuild.mjs +0 -6
- package/dist/plugins/esbuild.mjs.map +0 -1
- package/dist/plugins/jest.d.mts +0 -10
- package/dist/plugins/jest.mjs +0 -29
- package/dist/plugins/jest.mjs.map +0 -1
- package/dist/plugins/loader.d.mts +0 -15
- package/dist/plugins/loader.mjs +0 -21
- package/dist/plugins/loader.mjs.map +0 -1
- package/dist/plugins/next.d.mts +0 -21
- package/dist/plugins/next.mjs +0 -121
- package/dist/plugins/next.mjs.map +0 -1
- package/dist/plugins/rolldown.d.mts +0 -5
- package/dist/plugins/rolldown.mjs +0 -6
- package/dist/plugins/rolldown.mjs.map +0 -1
- package/dist/plugins/rollup.d.mts +0 -5
- package/dist/plugins/rollup.mjs +0 -6
- package/dist/plugins/rollup.mjs.map +0 -1
- package/dist/plugins/rsbuild.d.mts +0 -5
- package/dist/plugins/rsbuild.mjs +0 -6
- package/dist/plugins/rsbuild.mjs.map +0 -1
- package/dist/plugins/rspack.d.mts +0 -5
- package/dist/plugins/rspack.mjs +0 -6
- package/dist/plugins/rspack.mjs.map +0 -1
- package/dist/plugins/vite.d.mts +0 -5
- package/dist/plugins/vite.mjs +0 -6
- package/dist/plugins/vite.mjs.map +0 -1
- package/dist/plugins/webpack.d.mts +0 -5
- package/dist/plugins/webpack.mjs +0 -6
- package/dist/plugins/webpack.mjs.map +0 -1
- package/dist/resolve-D6InkI3S.mjs +0 -72
- package/dist/resolve-D6InkI3S.mjs.map +0 -1
- package/dist/resolve-Nq14yl8P.mjs.map +0 -1
- package/dist/resolve-ZvBQr4kx.d.mts +0 -65
- package/dist/runtime-la_KkjCS.mjs +0 -1
- package/dist/shared-3h97HNnt.d.mts +0 -22
- package/dist/shared-B7Et_DQe.mjs +0 -16
- package/dist/shared-B7Et_DQe.mjs.map +0 -1
- package/dist/sync-Byh0-2q_.mjs +0 -14
- package/dist/sync-Byh0-2q_.mjs.map +0 -1
- package/dist/unplugin-BkbVY1zO.d.mts +0 -2
- package/dist/unplugin-DiektQ4A.mjs +0 -69
- 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
|
|
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 {
|
|
2
|
-
import { t as load } from "./
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
2
|
-
import { i as
|
|
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 {
|
|
2
|
-
import { n as decodeConfig, r as decodeEnv, t as ConfigValidationError } from "./schema-
|
|
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 {
|
|
2
|
-
import { i as
|
|
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
package/dist/mapper.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
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";
|