@ctx-core/env 13.0.44 → 13.0.49
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/.swcrc +10 -0
- package/CHANGELOG.md +61 -0
- package/dist/CACHE_VERSION$_b.js +4 -2
- package/dist/CACHE_VERSION$_b.js.map +1 -1
- package/dist/NODE_ENV$_b.js +3 -1
- package/dist/NODE_ENV$_b.js.map +1 -1
- package/dist/VERSION$_b.js +4 -4
- package/dist/VERSION$_b.js.map +1 -1
- package/dist/env_Ctx.js +2 -1
- package/dist/env_Ctx.js.map +1 -1
- package/dist/env_ctx_I.generated.js +4 -1
- package/dist/env_ctx_I.generated.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/is_development$_b.js +4 -1
- package/dist/is_development$_b.js.map +1 -1
- package/dist/is_production$_b.js +4 -1
- package/dist/is_production$_b.js.map +1 -1
- package/dist/is_staging$_b.js +6 -2
- package/dist/is_staging$_b.js.map +1 -1
- package/dist/throw_missing_env.js +6 -3
- package/dist/throw_missing_env.js.map +1 -1
- package/package.json +16 -16
- package/src/CACHE_VERSION$_b.ts +1 -1
- package/src/NODE_ENV$_b.ts +1 -1
- package/src/VERSION$_b.ts +1 -1
- package/src/is_development$_b.ts +1 -1
- package/src/is_production$_b.ts +1 -1
- package/src/is_staging$_b.ts +2 -2
- package/COMMIT_EDITMSG +0 -1
- package/dist/CACHE_VERSION$_b.d.ts +0 -9
- package/dist/NODE_ENV$_b.d.ts +0 -9
- package/dist/VERSION$_b.d.ts +0 -9
- package/dist/env_Ctx.d.ts +0 -3
- package/dist/env_ctx_I.generated.d.ts +0 -14
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/is_development$_b.d.ts +0 -9
- package/dist/is_production$_b.d.ts +0 -9
- package/dist/is_staging$_b.d.ts +0 -9
- package/dist/throw_missing_env.d.ts +0 -5
package/.swcrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# @ctx-core/env
|
|
2
2
|
|
|
3
|
+
## 13.0.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @swc/cli: ^0.1.51 -> ^0.1.52
|
|
8
|
+
- @swc/core: ^1.2.111 -> ^1.2.113
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
- @ctx-core/error@11.1.3
|
|
12
|
+
- @ctx-core/function@20.2.7
|
|
13
|
+
- @ctx-core/object@21.0.26
|
|
14
|
+
- @ctx-core/store@27.0.40
|
|
15
|
+
|
|
16
|
+
## 13.0.48
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- svelte: 3.44.1 -> 3.44.2
|
|
21
|
+
- @swc/core: ^1.2.110 -> ^1.2.111
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @ctx-core/store@27.0.39
|
|
25
|
+
- @ctx-core/error@11.1.2
|
|
26
|
+
- @ctx-core/function@20.2.6
|
|
27
|
+
- @ctx-core/object@21.0.25
|
|
28
|
+
|
|
29
|
+
## 13.0.47
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- typescript: ^4.4.4 -> ^4.5.2
|
|
34
|
+
- @swc/core: ^1.2.108 -> ^1.2.110
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
- @ctx-core/error@11.0.20
|
|
38
|
+
- @ctx-core/function@20.2.5
|
|
39
|
+
- @ctx-core/object@21.0.24
|
|
40
|
+
- @ctx-core/store@27.0.38
|
|
41
|
+
|
|
42
|
+
## 13.0.46
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- @swc/core: ^1.2.107 -> ^1.2.108
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @ctx-core/error@11.0.19
|
|
49
|
+
- @ctx-core/function@20.2.4
|
|
50
|
+
- @ctx-core/object@21.0.23
|
|
51
|
+
- @ctx-core/store@27.0.37
|
|
52
|
+
|
|
53
|
+
## 13.0.45
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- compile using swc
|
|
58
|
+
- Updated dependencies
|
|
59
|
+
- @ctx-core/error@11.0.18
|
|
60
|
+
- @ctx-core/function@20.2.3
|
|
61
|
+
- @ctx-core/object@21.0.22
|
|
62
|
+
- @ctx-core/store@27.0.36
|
|
63
|
+
|
|
3
64
|
## 13.0.44
|
|
4
65
|
|
|
5
66
|
### Patch Changes
|
package/dist/CACHE_VERSION$_b.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { be_ } from '@ctx-core/object';
|
|
2
2
|
import { writable$ } from '@ctx-core/store';
|
|
3
3
|
const key = 'CACHE_VERSION$';
|
|
4
|
-
export const CACHE_VERSION$_b = be_(key, ()
|
|
5
|
-
|
|
4
|
+
export const CACHE_VERSION$_b = be_(key, ()=>writable$(typeof process === 'object' && process.env.CACHE_VERSION)
|
|
5
|
+
);
|
|
6
|
+
export { CACHE_VERSION$_b as b__CACHE_VERSION, };
|
|
7
|
+
|
|
6
8
|
//# sourceMappingURL=CACHE_VERSION$_b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/CACHE_VERSION$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { Writable$, writable$ } from '@ctx-core/store'\nimport type { env_Ctx } from './env_Ctx.js'\nconst key = 'CACHE_VERSION$'\nexport const CACHE_VERSION$_b:B<env_Ctx, typeof key> = be_(key, ()=>\n\twritable$(\n\t\ttypeof process === 'object' && process.env.CACHE_VERSION\n\t) as CACHE_VERSION$_T\n)\nexport type CACHE_VERSION_T = false|string\nexport interface CACHE_VERSION$_T extends Writable$<CACHE_VERSION_T> {}\nexport {\n\tCACHE_VERSION$_b as b__CACHE_VERSION,\n}\n"],"names":["be_","writable$","key","CACHE_VERSION$_b","process","env","CACHE_VERSION","b__CACHE_VERSION"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAcC,SAAS,QAAQ,CAAiB;AAEtD,KAAK,CAACC,GAAG,GAAG,CAAgB;AAC5B,MAAM,CAAC,KAAK,CAACC,gBAAgB,GAA0BH,GAAG,CAACE,GAAG,MAC7DD,SAAS,CACR,MAAM,CAACG,OAAO,KAAK,CAAQ,WAAIA,OAAO,CAACC,GAAG,CAACC,aAAa;;AAK1D,MAAM,GACLH,gBAAgB,IAAII,gBAAgB"}
|
package/dist/NODE_ENV$_b.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { be_ } from '@ctx-core/object';
|
|
2
2
|
import { writable$ } from '@ctx-core/store';
|
|
3
3
|
const key = 'NODE_ENV$';
|
|
4
|
-
export const NODE_ENV$_b = be_(key, ()
|
|
4
|
+
export const NODE_ENV$_b = be_(key, ()=>writable$(process.env.NODE_ENV)
|
|
5
|
+
);
|
|
5
6
|
export { NODE_ENV$_b as b__NODE_ENV };
|
|
7
|
+
|
|
6
8
|
//# sourceMappingURL=NODE_ENV$_b.js.map
|
package/dist/NODE_ENV$_b.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/NODE_ENV$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { writable$, Writable$ } from '@ctx-core/store'\nimport type { env_Ctx } from './env_Ctx.js'\nconst key = 'NODE_ENV$'\nexport const NODE_ENV$_b:B<env_Ctx, typeof key> = be_(key, ()=>\n\twritable$(process.env.NODE_ENV) as NODE_ENV$_T\n)\nexport type NODE_ENV_T = string\nexport interface NODE_ENV$_T extends Writable$<NODE_ENV_T> {}\nexport { NODE_ENV$_b as b__NODE_ENV }\n"],"names":["be_","writable$","key","NODE_ENV$_b","process","env","NODE_ENV","b__NODE_ENV"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,SAAS,QAAmB,CAAiB;AAEtD,KAAK,CAACC,GAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAA0BH,GAAG,CAACE,GAAG,MACxDD,SAAS,CAACG,OAAO,CAACC,GAAG,CAACC,QAAQ;;AAI/B,MAAM,GAAGH,WAAW,IAAII,WAAW"}
|
package/dist/VERSION$_b.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { be_ } from '@ctx-core/object';
|
|
2
2
|
import { writable$ } from '@ctx-core/store';
|
|
3
3
|
const key = 'VERSION$';
|
|
4
|
-
export const VERSION$_b = be_(key, ()
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export const VERSION$_b = be_(key, ()=>writable$(typeof process === 'object' && (process.env.VERSION || process.env.HEROKU_SLUG_COMMIT) || Math.random().toString())
|
|
5
|
+
);
|
|
6
|
+
export { VERSION$_b as b__VERSION, };
|
|
7
|
+
|
|
8
8
|
//# sourceMappingURL=VERSION$_b.js.map
|
package/dist/VERSION$_b.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/VERSION$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { Writable$, writable$ } from '@ctx-core/store'\nimport type { env_Ctx } from './env_Ctx.js'\nconst key = 'VERSION$'\nexport const VERSION$_b:B<env_Ctx, typeof key> = be_(key, ()=>\n\twritable$(\n\t\t(typeof process === 'object' && (\n\t\t\tprocess.env.VERSION\n\t\t\t|| process.env.HEROKU_SLUG_COMMIT\n\t\t))\n\t\t|| Math.random().toString()\n\t) as VERSION$_T\n)\nexport type VERSION_T = string\nexport interface VERSION$_T extends Writable$<VERSION_T> {}\nexport {\n\tVERSION$_b as b__VERSION,\n}\n"],"names":["be_","writable$","key","VERSION$_b","process","env","VERSION","HEROKU_SLUG_COMMIT","Math","random","toString","b__VERSION"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAcC,SAAS,QAAQ,CAAiB;AAEtD,KAAK,CAACC,GAAG,GAAG,CAAU;AACtB,MAAM,CAAC,KAAK,CAACC,UAAU,GAA0BH,GAAG,CAACE,GAAG,MACvDD,SAAS,CACP,MAAM,CAACG,OAAO,KAAK,CAAQ,YAC3BA,OAAO,CAACC,GAAG,CAACC,OAAO,IAChBF,OAAO,CAACC,GAAG,CAACE,kBAAkB,KAE/BC,IAAI,CAACC,MAAM,GAAGC,QAAQ;;AAK3B,MAAM,GACLP,UAAU,IAAIQ,UAAU"}
|
package/dist/env_Ctx.js
CHANGED
package/dist/env_Ctx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/env_Ctx.ts"],"sourcesContent":["import type { env_ctx_I } from './env_ctx_I.generated.js'\nexport interface env_Ctx extends env_ctx_I {}\n"],"names":[],"mappings":"AAAA,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/env_ctx_I.generated.ts"],"sourcesContent":["/*\n * This file was generated by `npm run generate_ctx_I_file` in @ctx-core/dev-tools\n*/\nimport type { CACHE_VERSION$_T } from './CACHE_VERSION$_b.js'\nimport type { NODE_ENV$_T } from './NODE_ENV$_b.js'\nimport type { VERSION$_T } from './VERSION$_b.js'\nimport type { is_development$_T } from './is_development$_b.js'\nimport type { is_production$_T } from './is_production$_b.js'\nimport type { is_staging$_T } from './is_staging$_b.js'\nexport interface env_ctx_I {\n\tCACHE_VERSION$?:CACHE_VERSION$_T\n\tNODE_ENV$?:NODE_ENV$_T\n\tVERSION$?:VERSION$_T\n\tis_development$?:is_development$_T\n\tis_production$?:is_production$_T\n\tis_staging$?:is_staging$_T\n}"],"names":[],"mappings":"AAAA,EAEE,AAFF;;AAEE,AAFF,EAEE,CACF,MAAM"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './CACHE_VERSION$_b.js'\nexport * from './env_Ctx.js'\nexport * from './env_ctx_I.generated.js'\nexport * from './is_development$_b.js'\nexport * from './is_production$_b.js'\nexport * from './is_staging$_b.js'\nexport * from './NODE_ENV$_b.js'\nexport * from './throw_missing_env.js'\nexport * from './VERSION$_b.js'\n"],"names":[],"mappings":"cAAc,CAAuB;cACvB,CAAc;cACd,CAA0B;cAC1B,CAAwB;cACxB,CAAuB;cACvB,CAAoB;cACpB,CAAkB;cAClB,CAAwB;cACxB,CAAiB"}
|
|
@@ -2,6 +2,9 @@ import { be_ } from '@ctx-core/object';
|
|
|
2
2
|
import { derived$ } from '@ctx-core/store';
|
|
3
3
|
import { NODE_ENV$_b } from './NODE_ENV$_b.js';
|
|
4
4
|
const key = 'is_development$';
|
|
5
|
-
export const is_development$_b = be_(key, ctx
|
|
5
|
+
export const is_development$_b = be_(key, (ctx)=>derived$(NODE_ENV$_b(ctx), (NODE_ENV)=>NODE_ENV === 'dev' || NODE_ENV === 'development.js'
|
|
6
|
+
)
|
|
7
|
+
);
|
|
6
8
|
export { is_development$_b as b__is__development };
|
|
9
|
+
|
|
7
10
|
//# sourceMappingURL=is_development$_b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/is_development$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { derived$, Readable$ } from '@ctx-core/store'\nimport type { env_Ctx } from './env_Ctx.js'\nimport { NODE_ENV$_b } from './NODE_ENV$_b.js'\nconst key = 'is_development$'\nexport const is_development$_b:B<env_Ctx, typeof key> = be_(key, ctx=>\n\tderived$(NODE_ENV$_b(ctx),\n\t\tNODE_ENV=>\n\t\t\tNODE_ENV === 'dev' || NODE_ENV === 'development.js'\n\t) as is_development$_T\n)\nexport type is_development_T = boolean\nexport interface is_development$_T extends Readable$<is_development_T> {}\nexport { is_development$_b as b__is__development }\n"],"names":["be_","derived$","NODE_ENV$_b","key","is_development$_b","ctx","NODE_ENV","b__is__development"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,QAAQ,QAAmB,CAAiB;AAErD,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,KAAK,CAACC,GAAG,GAAG,CAAiB;AAC7B,MAAM,CAAC,KAAK,CAACC,iBAAiB,GAA0BJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GACnEJ,QAAQ,CAACC,WAAW,CAACG,GAAG,IACvBC,QAAQ,GACPA,QAAQ,KAAK,CAAK,QAAIA,QAAQ,KAAK,CAAgB;;;AAKtD,MAAM,GAAGF,iBAAiB,IAAIG,kBAAkB"}
|
package/dist/is_production$_b.js
CHANGED
|
@@ -2,6 +2,9 @@ import { be_ } from '@ctx-core/object';
|
|
|
2
2
|
import { derived$ } from '@ctx-core/store';
|
|
3
3
|
import { NODE_ENV$_b } from './NODE_ENV$_b.js';
|
|
4
4
|
const key = 'is_production$';
|
|
5
|
-
export const is_production$_b = be_(key, ctx
|
|
5
|
+
export const is_production$_b = be_(key, (ctx)=>derived$(NODE_ENV$_b(ctx), (NODE_ENV)=>NODE_ENV === 'prod' || NODE_ENV === 'production.js'
|
|
6
|
+
)
|
|
7
|
+
);
|
|
6
8
|
export { is_production$_b as b__is__production };
|
|
9
|
+
|
|
7
10
|
//# sourceMappingURL=is_production$_b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/is_production$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { derived$, Readable$ } from '@ctx-core/store'\nimport type { env_Ctx } from './env_Ctx.js'\nimport { NODE_ENV$_b } from './NODE_ENV$_b.js'\nconst key = 'is_production$'\nexport const is_production$_b:B<env_Ctx, typeof key> = be_(key, ctx=>\n\tderived$(NODE_ENV$_b(ctx), NODE_ENV=>\n\t\tNODE_ENV === 'prod' || NODE_ENV === 'production.js'\n\t) as is_production$_T\n)\nexport type is_production_T = boolean\nexport interface is_production$_T extends Readable$<is_production_T> {}\nexport { is_production$_b as b__is__production }\n"],"names":["be_","derived$","NODE_ENV$_b","key","is_production$_b","ctx","NODE_ENV","b__is__production"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,QAAQ,QAAmB,CAAiB;AAErD,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,KAAK,CAACC,GAAG,GAAG,CAAgB;AAC5B,MAAM,CAAC,KAAK,CAACC,gBAAgB,GAA0BJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GAClEJ,QAAQ,CAACC,WAAW,CAACG,GAAG,IAAGC,QAAQ,GAClCA,QAAQ,KAAK,CAAM,SAAIA,QAAQ,KAAK,CAAe;;;AAKrD,MAAM,GAAGF,gBAAgB,IAAIG,iBAAiB"}
|
package/dist/is_staging$_b.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { be_ } from '@ctx-core/object';
|
|
2
1
|
import { eql_ } from '@ctx-core/function';
|
|
2
|
+
import { be_ } from '@ctx-core/object';
|
|
3
3
|
import { derived$ } from '@ctx-core/store';
|
|
4
4
|
import { NODE_ENV$_b } from './NODE_ENV$_b.js';
|
|
5
5
|
const key = 'is_staging$';
|
|
6
|
-
export const is_staging$_b = be_(key, ctx
|
|
6
|
+
export const is_staging$_b = be_(key, (ctx)=>derived$(NODE_ENV$_b(ctx), eql_([
|
|
7
|
+
'staging'
|
|
8
|
+
]))
|
|
9
|
+
);
|
|
7
10
|
export { is_staging$_b as b__is__staging };
|
|
11
|
+
|
|
8
12
|
//# sourceMappingURL=is_staging$_b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/is_staging$_b.ts"],"sourcesContent":["import { eql_ } from '@ctx-core/function'\nimport { B, be_ } from '@ctx-core/object'\nimport { derived$, Readable$ } from '@ctx-core/store'\nimport type { env_Ctx } from './env_Ctx.js'\nimport { NODE_ENV$_b } from './NODE_ENV$_b.js'\nconst key = 'is_staging$'\nexport const is_staging$_b:B<env_Ctx, typeof key> = be_(key, ctx=>\n\tderived$(\n\t\tNODE_ENV$_b(ctx),\n\t\teql_(['staging'])\n\t) as is_staging$_T\n)\nexport type is_staging_T = boolean\nexport interface is_staging$_T extends Readable$<is_staging_T> {}\nexport { is_staging$_b as b__is__staging }\n"],"names":["eql_","be_","derived$","NODE_ENV$_b","key","is_staging$_b","ctx","b__is__staging"],"mappings":"AAAA,MAAM,GAAGA,IAAI,QAAQ,CAAoB;AACzC,MAAM,GAAMC,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,QAAQ,QAAmB,CAAiB;AAErD,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,KAAK,CAACC,GAAG,GAAG,CAAa;AACzB,MAAM,CAAC,KAAK,CAACC,aAAa,GAA0BJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GAC/DJ,QAAQ,CACPC,WAAW,CAACG,GAAG,GACfN,IAAI,CAAC,CAAC;QAAA,CAAS;IAAA,CAAC;;AAKlB,MAAM,GAAGK,aAAa,IAAIE,cAAc"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { throw_error } from '@ctx-core/error';
|
|
2
2
|
/**
|
|
3
3
|
* Throws an error for for a missing env variable
|
|
4
|
-
*/
|
|
5
|
-
export function throw_missing_env(env_name) {
|
|
4
|
+
*/ export function throw_missing_env(env_name) {
|
|
6
5
|
const error_message = `
|
|
7
6
|
${env_name} environment variable not set.
|
|
8
7
|
dev: make sure ${env_name} is set in your .env file
|
|
9
8
|
heroku: make sure ${env_name} is set using \`heroku config:set\`
|
|
10
9
|
`.trim();
|
|
11
|
-
throw_error({
|
|
10
|
+
throw_error({
|
|
11
|
+
error_message,
|
|
12
|
+
type: 'missing_env'
|
|
13
|
+
});
|
|
12
14
|
}
|
|
13
15
|
export { throw_missing_env as throw__missing__env };
|
|
16
|
+
|
|
14
17
|
//# sourceMappingURL=throw_missing_env.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/throw_missing_env.ts"],"sourcesContent":["import { error_ctx_I, throw_error } from '@ctx-core/error'\n/**\n * Throws an error for for a missing env variable\n */\nexport function throw_missing_env(env_name: string) {\n\tconst error_message = `\n${env_name} environment variable not set.\ndev: make sure ${env_name} is set in your .env file\nheroku: make sure ${env_name} is set using \\`heroku config:set\\`\n\t`.trim()\n\tthrow_error({ error_message, type: 'missing_env' } as error_ctx_I)\n}\nexport {\n\tthrow_missing_env as throw__missing__env\n}\n"],"names":["throw_error","throw_missing_env","env_name","error_message","trim","type","throw__missing__env"],"mappings":"AAAA,MAAM,GAAgBA,WAAW,QAAQ,CAAiB;AAC1D,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,MAAM,UAAUC,iBAAiB,CAACC,QAAgB,EAAE,CAAC;IACpD,KAAK,CAACC,aAAa,IAAI,CACxB,EAAED,QAAQ,CAAC,8CACI,EAAEA,QAAQ,CAAC,4CACR,EAAEA,QAAQ,CAAC,qCAC5B,EAAEE,IAAI;IACNJ,WAAW,CAAC,CAAC;QAACG,aAAa;QAAEE,IAAI,EAAE,CAAa;IAAC,CAAC;AACnD,CAAC;AACD,MAAM,GACLJ,iBAAiB,IAAIK,mBAAmB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/env",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.49",
|
|
4
4
|
"description": "ctx-core env",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "Brian Takita",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"main": "./dist/index.
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
21
|
"module": "./dist/index.js",
|
|
22
|
-
"types": "./
|
|
22
|
+
"types": "./src/index.ts",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"require": "./dist/index.cjs",
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ctx-core/error": "^11.
|
|
32
|
-
"@ctx-core/function": "^20.2.
|
|
33
|
-
"@ctx-core/object": "^21.0.
|
|
34
|
-
"@ctx-core/store": "^27.0.
|
|
35
|
-
"
|
|
36
|
-
"svelte": "3.44.1"
|
|
31
|
+
"@ctx-core/error": "^11.1.3",
|
|
32
|
+
"@ctx-core/function": "^20.2.7",
|
|
33
|
+
"@ctx-core/object": "^21.0.26",
|
|
34
|
+
"@ctx-core/store": "^27.0.40",
|
|
35
|
+
"svelte": "3.44.2"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@ctx-core/dev-tools": "^7.
|
|
40
|
-
"
|
|
38
|
+
"@ctx-core/dev-tools": "^7.2.4",
|
|
39
|
+
"@swc/cli": "^0.1.52",
|
|
40
|
+
"@swc/core": "^1.2.113",
|
|
41
|
+
"typescript": "next"
|
|
41
42
|
},
|
|
42
43
|
"publishConfig": {
|
|
43
44
|
"access": "public",
|
|
44
45
|
"cache": "~/.npm"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
|
47
|
-
"build": "npm run
|
|
48
|
-
"clean": "rm -
|
|
49
|
-
"compile": "
|
|
50
|
-
"copy-mjs": "cd dist && echo \"module.exports = (async () => import('./index.js'))()\" > index.cjs",
|
|
48
|
+
"build": "npm run generate_ctx_I_file && npm run compile",
|
|
49
|
+
"clean": "rm -rf dist",
|
|
50
|
+
"compile": "swc src --out-dir dist --copy-files --source-maps --config-file .swcrc",
|
|
51
51
|
"exec": "$@",
|
|
52
|
-
"generate_ctx_I_file": "./node_modules/.bin/generate_ctx_I_file"
|
|
52
|
+
"generate_ctx_I_file": "swc $(./node_modules/.bin/generate_ctx_I_file | tail -n1) --out-dir dist --source-maps --config-file .swcrc"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/src/CACHE_VERSION$_b.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B, be_ } from '@ctx-core/object'
|
|
2
2
|
import { Writable$, writable$ } from '@ctx-core/store'
|
|
3
|
-
import type { env_Ctx } from './env_Ctx'
|
|
3
|
+
import type { env_Ctx } from './env_Ctx.js'
|
|
4
4
|
const key = 'CACHE_VERSION$'
|
|
5
5
|
export const CACHE_VERSION$_b:B<env_Ctx, typeof key> = be_(key, ()=>
|
|
6
6
|
writable$(
|
package/src/NODE_ENV$_b.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B, be_ } from '@ctx-core/object'
|
|
2
2
|
import { writable$, Writable$ } from '@ctx-core/store'
|
|
3
|
-
import type { env_Ctx } from './env_Ctx'
|
|
3
|
+
import type { env_Ctx } from './env_Ctx.js'
|
|
4
4
|
const key = 'NODE_ENV$'
|
|
5
5
|
export const NODE_ENV$_b:B<env_Ctx, typeof key> = be_(key, ()=>
|
|
6
6
|
writable$(process.env.NODE_ENV) as NODE_ENV$_T
|
package/src/VERSION$_b.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B, be_ } from '@ctx-core/object'
|
|
2
2
|
import { Writable$, writable$ } from '@ctx-core/store'
|
|
3
|
-
import type { env_Ctx } from './env_Ctx'
|
|
3
|
+
import type { env_Ctx } from './env_Ctx.js'
|
|
4
4
|
const key = 'VERSION$'
|
|
5
5
|
export const VERSION$_b:B<env_Ctx, typeof key> = be_(key, ()=>
|
|
6
6
|
writable$(
|
package/src/is_development$_b.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { B, be_ } from '@ctx-core/object'
|
|
2
2
|
import { derived$, Readable$ } from '@ctx-core/store'
|
|
3
|
+
import type { env_Ctx } from './env_Ctx.js'
|
|
3
4
|
import { NODE_ENV$_b } from './NODE_ENV$_b.js'
|
|
4
|
-
import type { env_Ctx } from './env_Ctx'
|
|
5
5
|
const key = 'is_development$'
|
|
6
6
|
export const is_development$_b:B<env_Ctx, typeof key> = be_(key, ctx=>
|
|
7
7
|
derived$(NODE_ENV$_b(ctx),
|
package/src/is_production$_b.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { B, be_ } from '@ctx-core/object'
|
|
2
2
|
import { derived$, Readable$ } from '@ctx-core/store'
|
|
3
|
+
import type { env_Ctx } from './env_Ctx.js'
|
|
3
4
|
import { NODE_ENV$_b } from './NODE_ENV$_b.js'
|
|
4
|
-
import type { env_Ctx } from './env_Ctx'
|
|
5
5
|
const key = 'is_production$'
|
|
6
6
|
export const is_production$_b:B<env_Ctx, typeof key> = be_(key, ctx=>
|
|
7
7
|
derived$(NODE_ENV$_b(ctx), NODE_ENV=>
|
package/src/is_staging$_b.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B, be_ } from '@ctx-core/object'
|
|
2
1
|
import { eql_ } from '@ctx-core/function'
|
|
2
|
+
import { B, be_ } from '@ctx-core/object'
|
|
3
3
|
import { derived$, Readable$ } from '@ctx-core/store'
|
|
4
|
+
import type { env_Ctx } from './env_Ctx.js'
|
|
4
5
|
import { NODE_ENV$_b } from './NODE_ENV$_b.js'
|
|
5
|
-
import type { env_Ctx } from './env_Ctx'
|
|
6
6
|
const key = 'is_staging$'
|
|
7
7
|
export const is_staging$_b:B<env_Ctx, typeof key> = be_(key, ctx=>
|
|
8
8
|
derived$(
|
package/COMMIT_EDITMSG
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
|
-
import type { env_Ctx } from './env_Ctx';
|
|
4
|
-
declare const key = "CACHE_VERSION$";
|
|
5
|
-
export declare const CACHE_VERSION$_b: B<env_Ctx, typeof key>;
|
|
6
|
-
export declare type CACHE_VERSION_T = false | string;
|
|
7
|
-
export interface CACHE_VERSION$_T extends Writable$<CACHE_VERSION_T> {
|
|
8
|
-
}
|
|
9
|
-
export { CACHE_VERSION$_b as b__CACHE_VERSION, };
|
package/dist/NODE_ENV$_b.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
|
-
import type { env_Ctx } from './env_Ctx';
|
|
4
|
-
declare const key = "NODE_ENV$";
|
|
5
|
-
export declare const NODE_ENV$_b: B<env_Ctx, typeof key>;
|
|
6
|
-
export declare type NODE_ENV_T = string;
|
|
7
|
-
export interface NODE_ENV$_T extends Writable$<NODE_ENV_T> {
|
|
8
|
-
}
|
|
9
|
-
export { NODE_ENV$_b as b__NODE_ENV };
|
package/dist/VERSION$_b.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
|
-
import type { env_Ctx } from './env_Ctx';
|
|
4
|
-
declare const key = "VERSION$";
|
|
5
|
-
export declare const VERSION$_b: B<env_Ctx, typeof key>;
|
|
6
|
-
export declare type VERSION_T = string;
|
|
7
|
-
export interface VERSION$_T extends Writable$<VERSION_T> {
|
|
8
|
-
}
|
|
9
|
-
export { VERSION$_b as b__VERSION, };
|
package/dist/env_Ctx.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CACHE_VERSION$_T } from './CACHE_VERSION$_b.js';
|
|
2
|
-
import type { NODE_ENV$_T } from './NODE_ENV$_b.js';
|
|
3
|
-
import type { VERSION$_T } from './VERSION$_b.js';
|
|
4
|
-
import type { is_development$_T } from './is_development$_b.js';
|
|
5
|
-
import type { is_production$_T } from './is_production$_b.js';
|
|
6
|
-
import type { is_staging$_T } from './is_staging$_b.js';
|
|
7
|
-
export interface env_ctx_I {
|
|
8
|
-
CACHE_VERSION$?: CACHE_VERSION$_T;
|
|
9
|
-
NODE_ENV$?: NODE_ENV$_T;
|
|
10
|
-
VERSION$?: VERSION$_T;
|
|
11
|
-
is_development$?: is_development$_T;
|
|
12
|
-
is_production$?: is_production$_T;
|
|
13
|
-
is_staging$?: is_staging$_T;
|
|
14
|
-
}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = (async () => import('./index.js'))()
|
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './CACHE_VERSION$_b.js';
|
|
2
|
-
export * from './env_Ctx.js';
|
|
3
|
-
export * from './env_ctx_I.generated.js';
|
|
4
|
-
export * from './is_development$_b.js';
|
|
5
|
-
export * from './is_production$_b.js';
|
|
6
|
-
export * from './is_staging$_b.js';
|
|
7
|
-
export * from './NODE_ENV$_b.js';
|
|
8
|
-
export * from './throw_missing_env.js';
|
|
9
|
-
export * from './VERSION$_b.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Readable$ } from '@ctx-core/store';
|
|
3
|
-
import type { env_Ctx } from './env_Ctx';
|
|
4
|
-
declare const key = "is_development$";
|
|
5
|
-
export declare const is_development$_b: B<env_Ctx, typeof key>;
|
|
6
|
-
export declare type is_development_T = boolean;
|
|
7
|
-
export interface is_development$_T extends Readable$<is_development_T> {
|
|
8
|
-
}
|
|
9
|
-
export { is_development$_b as b__is__development };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Readable$ } from '@ctx-core/store';
|
|
3
|
-
import type { env_Ctx } from './env_Ctx';
|
|
4
|
-
declare const key = "is_production$";
|
|
5
|
-
export declare const is_production$_b: B<env_Ctx, typeof key>;
|
|
6
|
-
export declare type is_production_T = boolean;
|
|
7
|
-
export interface is_production$_T extends Readable$<is_production_T> {
|
|
8
|
-
}
|
|
9
|
-
export { is_production$_b as b__is__production };
|
package/dist/is_staging$_b.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Readable$ } from '@ctx-core/store';
|
|
3
|
-
import type { env_Ctx } from './env_Ctx';
|
|
4
|
-
declare const key = "is_staging$";
|
|
5
|
-
export declare const is_staging$_b: B<env_Ctx, typeof key>;
|
|
6
|
-
export declare type is_staging_T = boolean;
|
|
7
|
-
export interface is_staging$_T extends Readable$<is_staging_T> {
|
|
8
|
-
}
|
|
9
|
-
export { is_staging$_b as b__is__staging };
|