envapt 8.2.1 → 8.2.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.
- package/CHANGELOG.md +12 -0
- package/dist/node/decorators/legacy/createPropertyDecorator.cjs +1 -1
- package/dist/node/decorators/legacy/createPropertyDecorator.cjs.map +1 -1
- package/dist/node/decorators/legacy/createPropertyDecorator.mjs +1 -1
- package/dist/node/decorators/legacy/createPropertyDecorator.mjs.map +1 -1
- package/dist/portable/decorators/legacy/createPropertyDecorator.mjs +1 -1
- package/dist/portable/decorators/legacy/createPropertyDecorator.mjs.map +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# envapt
|
|
2
2
|
|
|
3
|
+
## 8.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Shorten the package desc
|
|
8
|
+
|
|
9
|
+
## 8.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- ff56deb: Fixed a legacy decorator throwing `Cannot redefine property` under a Babel-based loader. The decorator now returns the descriptor it installed, and Babel reapplies that one.
|
|
14
|
+
|
|
3
15
|
## 8.2.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../infra/Error.cjs"),t=require("../resolveDecoratorValue.cjs");function n(n,r){return function(i,a){let o=String(a),s=typeof i==`function`,c=s?i:i.constructor,l=t.decoratorCacheKey(c,s,o)
|
|
1
|
+
const e=require("../../infra/Error.cjs"),t=require("../resolveDecoratorValue.cjs");function n(n,r){return function(i,a){let o=String(a),s=typeof i==`function`,c=s?i:i.constructor,l=t.decoratorCacheKey(c,s,o),u={get:function(){return t.resolveDecoratorValue(n,r,l)},set(){throw new e.EnvaptError(302,`Cannot assign to "${o}". @Envapt properties resolve from the environment and are read-only.`)},configurable:!1,enumerable:!0};return Object.defineProperty(i,o,u),u}}exports.createPropertyDecorator=n;
|
|
2
2
|
//# sourceMappingURL=createPropertyDecorator.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPropertyDecorator.cjs","names":["decoratorCacheKey","resolveDecoratorValue","EnvaptError"],"sources":["../../../../src/decorators/legacy/createPropertyDecorator.ts"],"sourcesContent":["import { EnvaptError, EnvaptErrorCodes } from '../../infra/Error';\nimport { decoratorCacheKey, resolveDecoratorValue } from '../resolveDecoratorValue';\n\nimport type { EnvKeyInput } from '../../types';\nimport type { DecoratorConfig } from '../resolveDecoratorValue';\n\nexport function createPropertyDecorator<TFallback>(\n key: EnvKeyInput,\n config: DecoratorConfig<TFallback>\n): PropertyDecorator {\n return function (target: object, prop: string | symbol):
|
|
1
|
+
{"version":3,"file":"createPropertyDecorator.cjs","names":["decoratorCacheKey","resolveDecoratorValue","EnvaptError"],"sources":["../../../../src/decorators/legacy/createPropertyDecorator.ts"],"sourcesContent":["import { EnvaptError, EnvaptErrorCodes } from '../../infra/Error';\nimport { decoratorCacheKey, resolveDecoratorValue } from '../resolveDecoratorValue';\n\nimport type { EnvKeyInput } from '../../types';\nimport type { DecoratorConfig } from '../resolveDecoratorValue';\n\nexport function createPropertyDecorator<TFallback>(\n key: EnvKeyInput,\n config: DecoratorConfig<TFallback>\n): PropertyDecorator {\n return function (target: object, prop: string | symbol): PropertyDescriptor {\n const propKey = String(prop);\n const isStatic = typeof target === 'function';\n const owner = isStatic ? target : target.constructor;\n const cacheKey = decoratorCacheKey(owner, isStatic, propKey);\n\n const descriptor: PropertyDescriptor = {\n get: function () {\n return resolveDecoratorValue(key, config, cacheKey);\n },\n set(): void {\n throw new EnvaptError(\n EnvaptErrorCodes.InvalidUserDefinedConfig,\n `Cannot assign to \"${propKey}\". @Envapt properties resolve from the environment and are read-only.`\n );\n },\n configurable: false,\n enumerable: true\n };\n\n Object.defineProperty(target, propKey, descriptor);\n\n // babel's legacy lowering redefines with whatever this returns. undefined restores the plain field\n return descriptor;\n };\n}\n"],"mappings":"mFAMA,SAAgB,EACZ,EACA,EACiB,CACjB,OAAO,SAAU,EAAgB,EAA2C,CACxE,IAAM,EAAU,OAAO,CAAI,EACrB,EAAW,OAAO,GAAW,WAC7B,EAAQ,EAAW,EAAS,EAAO,YACnC,EAAWA,EAAAA,kBAAkB,EAAO,EAAU,CAAO,EAErD,EAAiC,CACnC,IAAK,UAAY,CACb,OAAOC,EAAAA,sBAAsB,EAAK,EAAQ,CAAQ,CACtD,EACA,KAAY,CACR,MAAM,IAAIC,EAAAA,YAAAA,IAEN,qBAAqB,EAAQ,sEACjC,CACJ,EACA,aAAc,GACd,WAAY,EAChB,EAKA,OAHA,OAAO,eAAe,EAAQ,EAAS,CAAU,EAG1C,CACX,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EnvaptError as e}from"../../infra/Error.mjs";import{decoratorCacheKey as t,resolveDecoratorValue as n}from"../resolveDecoratorValue.mjs";function r(r,i){return function(a,o){let s=String(o),c=typeof a==`function`,l=c?a:a.constructor,u=t(l,c,s)
|
|
1
|
+
import{EnvaptError as e}from"../../infra/Error.mjs";import{decoratorCacheKey as t,resolveDecoratorValue as n}from"../resolveDecoratorValue.mjs";function r(r,i){return function(a,o){let s=String(o),c=typeof a==`function`,l=c?a:a.constructor,u=t(l,c,s),d={get:function(){return n(r,i,u)},set(){throw new e(302,`Cannot assign to "${s}". @Envapt properties resolve from the environment and are read-only.`)},configurable:!1,enumerable:!0};return Object.defineProperty(a,s,d),d}}export{r as createPropertyDecorator};
|
|
2
2
|
//# sourceMappingURL=createPropertyDecorator.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPropertyDecorator.mjs","names":[],"sources":["../../../../src/decorators/legacy/createPropertyDecorator.ts"],"sourcesContent":["import { EnvaptError, EnvaptErrorCodes } from '../../infra/Error';\nimport { decoratorCacheKey, resolveDecoratorValue } from '../resolveDecoratorValue';\n\nimport type { EnvKeyInput } from '../../types';\nimport type { DecoratorConfig } from '../resolveDecoratorValue';\n\nexport function createPropertyDecorator<TFallback>(\n key: EnvKeyInput,\n config: DecoratorConfig<TFallback>\n): PropertyDecorator {\n return function (target: object, prop: string | symbol):
|
|
1
|
+
{"version":3,"file":"createPropertyDecorator.mjs","names":[],"sources":["../../../../src/decorators/legacy/createPropertyDecorator.ts"],"sourcesContent":["import { EnvaptError, EnvaptErrorCodes } from '../../infra/Error';\nimport { decoratorCacheKey, resolveDecoratorValue } from '../resolveDecoratorValue';\n\nimport type { EnvKeyInput } from '../../types';\nimport type { DecoratorConfig } from '../resolveDecoratorValue';\n\nexport function createPropertyDecorator<TFallback>(\n key: EnvKeyInput,\n config: DecoratorConfig<TFallback>\n): PropertyDecorator {\n return function (target: object, prop: string | symbol): PropertyDescriptor {\n const propKey = String(prop);\n const isStatic = typeof target === 'function';\n const owner = isStatic ? target : target.constructor;\n const cacheKey = decoratorCacheKey(owner, isStatic, propKey);\n\n const descriptor: PropertyDescriptor = {\n get: function () {\n return resolveDecoratorValue(key, config, cacheKey);\n },\n set(): void {\n throw new EnvaptError(\n EnvaptErrorCodes.InvalidUserDefinedConfig,\n `Cannot assign to \"${propKey}\". @Envapt properties resolve from the environment and are read-only.`\n );\n },\n configurable: false,\n enumerable: true\n };\n\n Object.defineProperty(target, propKey, descriptor);\n\n // babel's legacy lowering redefines with whatever this returns. undefined restores the plain field\n return descriptor;\n };\n}\n"],"mappings":"gJAMA,SAAgB,EACZ,EACA,EACiB,CACjB,OAAO,SAAU,EAAgB,EAA2C,CACxE,IAAM,EAAU,OAAO,CAAI,EACrB,EAAW,OAAO,GAAW,WAC7B,EAAQ,EAAW,EAAS,EAAO,YACnC,EAAW,EAAkB,EAAO,EAAU,CAAO,EAErD,EAAiC,CACnC,IAAK,UAAY,CACb,OAAO,EAAsB,EAAK,EAAQ,CAAQ,CACtD,EACA,KAAY,CACR,MAAM,IAAI,EAAA,IAEN,qBAAqB,EAAQ,sEACjC,CACJ,EACA,aAAc,GACd,WAAY,EAChB,EAKA,OAHA,OAAO,eAAe,EAAQ,EAAS,CAAU,EAG1C,CACX,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EnvaptError as e}from"../../infra/Error.mjs";import{decoratorCacheKey as t,resolveDecoratorValue as n}from"../resolveDecoratorValue.mjs";function r(r,i){return function(a,o){let s=String(o),c=typeof a==`function`,l=c?a:a.constructor,u=t(l,c,s)
|
|
1
|
+
import{EnvaptError as e}from"../../infra/Error.mjs";import{decoratorCacheKey as t,resolveDecoratorValue as n}from"../resolveDecoratorValue.mjs";function r(r,i){return function(a,o){let s=String(o),c=typeof a==`function`,l=c?a:a.constructor,u=t(l,c,s),d={get:function(){return n(r,i,u)},set(){throw new e(302,`Cannot assign to "${s}". @Envapt properties resolve from the environment and are read-only.`)},configurable:!1,enumerable:!0};return Object.defineProperty(a,s,d),d}}export{r as createPropertyDecorator};
|
|
2
2
|
//# sourceMappingURL=createPropertyDecorator.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPropertyDecorator.mjs","names":[],"sources":["../../../../src/decorators/legacy/createPropertyDecorator.ts"],"sourcesContent":["import { EnvaptError, EnvaptErrorCodes } from '../../infra/Error';\nimport { decoratorCacheKey, resolveDecoratorValue } from '../resolveDecoratorValue';\n\nimport type { EnvKeyInput } from '../../types';\nimport type { DecoratorConfig } from '../resolveDecoratorValue';\n\nexport function createPropertyDecorator<TFallback>(\n key: EnvKeyInput,\n config: DecoratorConfig<TFallback>\n): PropertyDecorator {\n return function (target: object, prop: string | symbol):
|
|
1
|
+
{"version":3,"file":"createPropertyDecorator.mjs","names":[],"sources":["../../../../src/decorators/legacy/createPropertyDecorator.ts"],"sourcesContent":["import { EnvaptError, EnvaptErrorCodes } from '../../infra/Error';\nimport { decoratorCacheKey, resolveDecoratorValue } from '../resolveDecoratorValue';\n\nimport type { EnvKeyInput } from '../../types';\nimport type { DecoratorConfig } from '../resolveDecoratorValue';\n\nexport function createPropertyDecorator<TFallback>(\n key: EnvKeyInput,\n config: DecoratorConfig<TFallback>\n): PropertyDecorator {\n return function (target: object, prop: string | symbol): PropertyDescriptor {\n const propKey = String(prop);\n const isStatic = typeof target === 'function';\n const owner = isStatic ? target : target.constructor;\n const cacheKey = decoratorCacheKey(owner, isStatic, propKey);\n\n const descriptor: PropertyDescriptor = {\n get: function () {\n return resolveDecoratorValue(key, config, cacheKey);\n },\n set(): void {\n throw new EnvaptError(\n EnvaptErrorCodes.InvalidUserDefinedConfig,\n `Cannot assign to \"${propKey}\". @Envapt properties resolve from the environment and are read-only.`\n );\n },\n configurable: false,\n enumerable: true\n };\n\n Object.defineProperty(target, propKey, descriptor);\n\n // babel's legacy lowering redefines with whatever this returns. undefined restores the plain field\n return descriptor;\n };\n}\n"],"mappings":"gJAMA,SAAgB,EACZ,EACA,EACiB,CACjB,OAAO,SAAU,EAAgB,EAA2C,CACxE,IAAM,EAAU,OAAO,CAAI,EACrB,EAAW,OAAO,GAAW,WAC7B,EAAQ,EAAW,EAAS,EAAO,YACnC,EAAW,EAAkB,EAAO,EAAU,CAAO,EAErD,EAAiC,CACnC,IAAK,UAAY,CACb,OAAO,EAAsB,EAAK,EAAQ,CAAQ,CACtD,EACA,KAAY,CACR,MAAM,IAAI,EAAA,IAEN,qBAAqB,EAAQ,sEACjC,CACJ,EACA,aAAc,GACd,WAAY,EAChB,EAKA,OAHA,OAAO,eAAe,EAAQ,EAAS,CAAU,EAG1C,CACX,CACJ"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envapt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.2.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "8.2.3",
|
|
5
|
+
"description": "Typed, validated config from process.env, .env files, or any object. One API on Node, Bun, Deno, Cloudflare Workers, and the browser.",
|
|
6
6
|
"types": "./dist/types/index.d.mts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
@@ -191,6 +191,7 @@
|
|
|
191
191
|
"@vitest/browser-playwright": "4.1.11",
|
|
192
192
|
"arktype": "^2.2.3",
|
|
193
193
|
"esbuild": "^0.28.2",
|
|
194
|
+
"jiti": "^2.7.0",
|
|
194
195
|
"playwright": "1.63.0",
|
|
195
196
|
"typescript7": "npm:typescript@7.0.2",
|
|
196
197
|
"valibot": "^1.5.0",
|
|
@@ -219,6 +220,7 @@
|
|
|
219
220
|
"test:cjs-validity": "node tests/cjs-validity/run.mjs",
|
|
220
221
|
"test:tsc-emit": "node tests/tsc-emit/run.mjs",
|
|
221
222
|
"test:tsc-emit:ts7": "ENVAPT_TSC_PACKAGE=typescript7 node tests/tsc-emit/run.mjs",
|
|
223
|
+
"test:babel-emit": "node tests/babel-emit/run.mjs",
|
|
222
224
|
"test:stage3-emit": "node tests/stage3-emit/run.mjs",
|
|
223
225
|
"test:stage3-emit:ts7": "ENVAPT_TSC_PACKAGE=typescript7 node tests/stage3-emit/run.mjs",
|
|
224
226
|
"test:all": "node ../../scripts/test-all.mjs",
|