@ctx-core/env 15.0.3 → 15.0.9

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 (50) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/package.json +20 -20
  3. package/src/CACHE_VERSION$_b.d.ts +5 -0
  4. package/src/CACHE_VERSION$_b.js +8 -0
  5. package/src/NODE_ENV$_b.d.ts +5 -0
  6. package/src/NODE_ENV$_b.js +7 -0
  7. package/src/VERSION$_b.d.ts +5 -0
  8. package/src/VERSION$_b.js +6 -0
  9. package/src/index.d.ts +7 -0
  10. package/src/{index.ts → index.js} +0 -0
  11. package/src/is_development$_b.d.ts +5 -0
  12. package/src/is_development$_b.js +12 -0
  13. package/src/is_production$_b.d.ts +5 -0
  14. package/src/is_production$_b.js +12 -0
  15. package/src/is_staging$_b.d.ts +5 -0
  16. package/src/is_staging$_b.js +13 -0
  17. package/src/throw_missing_env.d.ts +5 -0
  18. package/src/throw_missing_env.js +17 -0
  19. package/tsconfig.json +3 -3
  20. package/dist/CACHE_VERSION$_b.d.ts +0 -5
  21. package/dist/CACHE_VERSION$_b.js +0 -8
  22. package/dist/CACHE_VERSION$_b.js.map +0 -1
  23. package/dist/NODE_ENV$_b.d.ts +0 -5
  24. package/dist/NODE_ENV$_b.js +0 -8
  25. package/dist/NODE_ENV$_b.js.map +0 -1
  26. package/dist/VERSION$_b.d.ts +0 -5
  27. package/dist/VERSION$_b.js +0 -8
  28. package/dist/VERSION$_b.js.map +0 -1
  29. package/dist/index.d.ts +0 -7
  30. package/dist/index.js +0 -9
  31. package/dist/index.js.map +0 -1
  32. package/dist/is_development$_b.d.ts +0 -5
  33. package/dist/is_development$_b.js +0 -10
  34. package/dist/is_development$_b.js.map +0 -1
  35. package/dist/is_production$_b.d.ts +0 -5
  36. package/dist/is_production$_b.js +0 -10
  37. package/dist/is_production$_b.js.map +0 -1
  38. package/dist/is_staging$_b.d.ts +0 -5
  39. package/dist/is_staging$_b.js +0 -12
  40. package/dist/is_staging$_b.js.map +0 -1
  41. package/dist/throw_missing_env.d.ts +0 -5
  42. package/dist/throw_missing_env.js +0 -17
  43. package/dist/throw_missing_env.js.map +0 -1
  44. package/src/CACHE_VERSION$_b.ts +0 -12
  45. package/src/NODE_ENV$_b.ts +0 -8
  46. package/src/VERSION$_b.ts +0 -16
  47. package/src/is_development$_b.ts +0 -12
  48. package/src/is_production$_b.ts +0 -11
  49. package/src/is_staging$_b.ts +0 -13
  50. package/src/throw_missing_env.ts +0 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @ctx-core/env
2
2
 
3
+ ## 15.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - uvu: ^0.5.2 -> ^0.5.3
8
+ - svelte: ^3.44.3 -> ^3.45.0
9
+ - Updated dependencies
10
+ - @ctx-core/error@11.1.22
11
+ - @ctx-core/function@20.2.24
12
+ - @ctx-core/nanostores@0.3.3
13
+ - @ctx-core/object@22.0.11
14
+
15
+ ## 15.0.8
16
+
17
+ ### Patch Changes
18
+
19
+ - version bump
20
+ - Updated dependencies
21
+ - @ctx-core/error@11.1.21
22
+ - @ctx-core/function@20.2.23
23
+ - @ctx-core/nanostores@0.3.2
24
+ - @ctx-core/object@22.0.10
25
+
26
+ ## 15.0.7
27
+
28
+ ### Patch Changes
29
+
30
+ - .js + .d.ts instead of .ts
31
+ - Updated dependencies
32
+ - @ctx-core/error@11.1.18
33
+ - @ctx-core/function@20.2.21
34
+ - @ctx-core/nanostores@0.3.1
35
+
36
+ ## 15.0.6
37
+
38
+ ### Patch Changes
39
+
40
+ - .js + .d.ts instead of .ts
41
+
42
+ ## 15.0.5
43
+
44
+ ### Patch Changes
45
+
46
+ - update dependencies
47
+
48
+ ## 15.0.4
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies
53
+ - @ctx-core/nanostores@0.3.0
54
+
3
55
  ## 15.0.3
4
56
 
5
57
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/env",
3
- "version": "15.0.3",
3
+ "version": "15.0.9",
4
4
  "description": "ctx-core env",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -17,38 +17,38 @@
17
17
  "license": "Apache-2.0",
18
18
  "author": "Brian Takita",
19
19
  "type": "module",
20
- "types": "./dist/index.d.ts",
20
+ "types": "./src/index.d.ts",
21
21
  "exports": {
22
22
  ".": {
23
- "import": "./dist/index.js"
23
+ "import": "./src/index.js"
24
24
  },
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@ctx-core/error": "^11.1.17",
29
- "@ctx-core/function": "^20.2.20",
30
- "@ctx-core/nanostores": "^0.2.0",
31
- "@ctx-core/object": "^22.0.8",
32
- "svelte": "^3.44.3"
28
+ "@ctx-core/error": "^11.1.22",
29
+ "@ctx-core/function": "^20.2.24",
30
+ "@ctx-core/nanostores": "^0.3.3",
31
+ "@ctx-core/object": "^22.0.11",
32
+ "svelte": "^3.45.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@swc/cli": "^0.1.55",
36
- "@swc/core": "^1.2.121",
37
- "rimraf": "^3.0.2",
38
- "typescript": "next"
35
+ "c8": "^7.11.0",
36
+ "check-dts": "^0.6.6",
37
+ "tsm": "^2.2.1",
38
+ "typescript": "next",
39
+ "uvu": "^0.5.3"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public",
42
43
  "cache": "~/.npm"
43
44
  },
44
- "svelte": "./dist/index.js",
45
+ "svelte": "./src/index.js",
45
46
  "scripts": {
46
- "build": "npm run compile",
47
- "clean": "rimraf dist && npm run clean_tsbuildinfo",
48
- "clean_tsbuildinfo": "rm -f tsconfig.tsbuildinfo && rm -f dist/**/*.d.ts",
49
- "compile": "npm run compile_source && npm run compile_declaration",
50
- "compile_source": "swc src --out-dir dist --copy-files --source-maps --config-file .swcrc",
51
- "compile_declaration": "npm run clean_tsbuildinfo && tsc --declaration --emitDeclarationOnly --declarationDir dist",
52
- "exec": "$@"
47
+ "build": ":",
48
+ "clean": ":",
49
+ "exec": "$@",
50
+ "test": "pnpm test-unit && check-dts",
51
+ "test-unit": "tsm node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
52
+ "test-unit-coverage": "c8 pnpm test-unit"
53
53
  }
54
54
  }
@@ -0,0 +1,5 @@
1
+ import { B } from '@ctx-core/object'
2
+ import { WritableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const CACHE_VERSION$_b:B<CACHE_VERSION$_T>
4
+ export declare type CACHE_VERSION$_T = WritableAtom$<false|string>;
5
+ export { CACHE_VERSION$_b as b__CACHE_VERSION, }
@@ -0,0 +1,8 @@
1
+ import { be_ } from '@ctx-core/object'
2
+ import { atom$ } from '@ctx-core/nanostores'
3
+ const key = 'CACHE_VERSION$'
4
+ /** @type {import('./CACHE_VERSION$_b').CACHE_VERSION$_b} */
5
+ export const CACHE_VERSION$_b = be_(key, ()=>
6
+ atom$(typeof process === 'object' && process.env.CACHE_VERSION)
7
+ )
8
+ export { CACHE_VERSION$_b as b__CACHE_VERSION, }
@@ -0,0 +1,5 @@
1
+ import { B } from '@ctx-core/object'
2
+ import { WritableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const NODE_ENV$_b:B<NODE_ENV$_T>
4
+ export declare type NODE_ENV$_T = WritableAtom$<string>;
5
+ export { NODE_ENV$_b as b__NODE_ENV }
@@ -0,0 +1,7 @@
1
+ import { be_ } from '@ctx-core/object'
2
+ import { atom$ } from '@ctx-core/nanostores'
3
+ const key = 'NODE_ENV$'
4
+ /** @type {import('NODE_ENV$_b').NODE_ENV$_b} */
5
+ export const NODE_ENV$_b = be_(key, ()=>atom$(process.env.NODE_ENV)
6
+ )
7
+ export { NODE_ENV$_b as b__NODE_ENV }
@@ -0,0 +1,5 @@
1
+ import { B } from '@ctx-core/object'
2
+ import { WritableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const VERSION$_b:B<VERSION$_T>
4
+ export declare type VERSION$_T = WritableAtom$<string>;
5
+ export { VERSION$_b as b__VERSION, }
@@ -0,0 +1,6 @@
1
+ import { be_ } from '@ctx-core/object'
2
+ import { atom$ } from '@ctx-core/nanostores'
3
+ const key = 'VERSION$'
4
+ /** @type {import('VERSION$_b').VERSION$_b} */
5
+ export const VERSION$_b = be_(key, ()=>atom$(typeof process === 'object' && (process.env.VERSION || process.env.HEROKU_SLUG_COMMIT) || Math.random().toString()))
6
+ export { VERSION$_b as b__VERSION, }
package/src/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './CACHE_VERSION$_b'
2
+ export * from './is_development$_b'
3
+ export * from './is_production$_b'
4
+ export * from './is_staging$_b'
5
+ export * from './NODE_ENV$_b'
6
+ export * from './throw_missing_env'
7
+ export * from './VERSION$_b'
File without changes
@@ -0,0 +1,5 @@
1
+ import { B } from '@ctx-core/object'
2
+ import { ReadableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const is_development$_b:B<is_development$_T>
4
+ export declare type is_development$_T = ReadableAtom$<boolean>;
5
+ export { is_development$_b as b__is__development }
@@ -0,0 +1,12 @@
1
+ import { be_ } from '@ctx-core/object'
2
+ import { computed$ } from '@ctx-core/nanostores'
3
+ import { NODE_ENV$_b } from './NODE_ENV$_b.js'
4
+ const key = 'is_development$'
5
+ /** @type {import('is_development$_b').is_development$_b} */
6
+ export const is_development$_b = be_(key, (ctx)=>
7
+ computed$(NODE_ENV$_b(ctx),
8
+ (NODE_ENV)=>
9
+ NODE_ENV === 'dev' || NODE_ENV === 'development.js'
10
+ )
11
+ )
12
+ export { is_development$_b as b__is__development }
@@ -0,0 +1,5 @@
1
+ import { B } from '@ctx-core/object'
2
+ import { ReadableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const is_production$_b:B<is_production$_T>
4
+ export declare type is_production$_T = ReadableAtom$<boolean>;
5
+ export { is_production$_b as b__is__production }
@@ -0,0 +1,12 @@
1
+ import { be_ } from '@ctx-core/object'
2
+ import { computed$ } from '@ctx-core/nanostores'
3
+ import { NODE_ENV$_b } from './NODE_ENV$_b.js'
4
+ const key = 'is_production$'
5
+ /** @type {import('is_production$_b').is_production$_b} */
6
+ export const is_production$_b = be_(key, (ctx)=>
7
+ computed$(NODE_ENV$_b(ctx),
8
+ (NODE_ENV)=>
9
+ NODE_ENV === 'prod' || NODE_ENV === 'production.js'
10
+ )
11
+ )
12
+ export { is_production$_b as b__is__production }
@@ -0,0 +1,5 @@
1
+ import { B } from '@ctx-core/object'
2
+ import { ReadableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const is_staging$_b:B<is_staging$_T>
4
+ export declare type is_staging$_T = ReadableAtom$<boolean>;
5
+ export { is_staging$_b as b__is__staging }
@@ -0,0 +1,13 @@
1
+ import { eql_ } from '@ctx-core/function'
2
+ import { be_ } from '@ctx-core/object'
3
+ import { computed$ } from '@ctx-core/nanostores'
4
+ import { NODE_ENV$_b } from './NODE_ENV$_b.js'
5
+ const key = 'is_staging$'
6
+ /** @type {import('is_staging$_b').is_staging$_b} */
7
+ export const is_staging$_b = be_(key, (ctx)=>
8
+ computed$(NODE_ENV$_b(ctx),
9
+ eql_([
10
+ 'staging'
11
+ ]))
12
+ )
13
+ export { is_staging$_b as b__is__staging }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Throws an error for for a missing env variable
3
+ */
4
+ export declare function throw_missing_env(env_name:string):void;
5
+ export { throw_missing_env as throw__missing__env }
@@ -0,0 +1,17 @@
1
+ import { throw_error } from '@ctx-core/error'
2
+ /**
3
+ * Throws an error for for a missing env variable
4
+ */
5
+ /** @type {import('throw_missing_env').throw_missing_env} */
6
+ export const throw_missing_env = (env_name)=>{
7
+ const error_message = `
8
+ ${env_name} environment variable not set.
9
+ dev: make sure ${env_name} is set in your .env file
10
+ heroku: make sure ${env_name} is set using \`heroku config:set\`
11
+ `.trim()
12
+ throw_error({
13
+ error_message,
14
+ type: 'missing_env'
15
+ })
16
+ }
17
+ export { throw_missing_env as throw__missing__env }
package/tsconfig.json CHANGED
@@ -22,15 +22,15 @@
22
22
  "node_modules/@types"
23
23
  ],
24
24
  "rootDir": "src",
25
- "outDir": "dist",
26
- "declarationDir": "dist",
25
+ "outDir": "lib",
26
+ "declarationDir": "lib",
27
27
  "lib": ["dom", "ESNext"],
28
28
  "importsNotUsedAsValues": "error",
29
29
  "strict": true
30
30
  },
31
31
  "exclude": [
32
32
  "node_modules",
33
- "dist"
33
+ "lib"
34
34
  ],
35
35
  "references": []
36
36
  }
@@ -1,5 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { WritableAtom$ } from '@ctx-core/nanostores';
3
- export declare const CACHE_VERSION$_b: B<CACHE_VERSION$_T>;
4
- export declare type CACHE_VERSION$_T = WritableAtom$<false | string>;
5
- export { CACHE_VERSION$_b as b__CACHE_VERSION, };
@@ -1,8 +0,0 @@
1
- import { be_ } from '@ctx-core/object';
2
- import { atom$ } from '@ctx-core/nanostores';
3
- const key = 'CACHE_VERSION$';
4
- export const CACHE_VERSION$_b = be_(key, ()=>atom$(typeof process === 'object' && process.env.CACHE_VERSION)
5
- );
6
- export { CACHE_VERSION$_b as b__CACHE_VERSION, };
7
-
8
- //# sourceMappingURL=CACHE_VERSION$_b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/CACHE_VERSION$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { WritableAtom$, atom$ } from '@ctx-core/nanostores'\nconst key = 'CACHE_VERSION$'\nexport const CACHE_VERSION$_b:B<CACHE_VERSION$_T> = be_(key, ()=>\n\tatom$(\n\t\ttypeof process === 'object' && process.env.CACHE_VERSION\n\t) as CACHE_VERSION$_T\n)\nexport type CACHE_VERSION$_T = WritableAtom$<false|string>\nexport {\n\tCACHE_VERSION$_b as b__CACHE_VERSION,\n}\n"],"names":["be_","atom$","key","CACHE_VERSION$_b","process","env","CACHE_VERSION","b__CACHE_VERSION"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAkBC,KAAK,QAAQ,CAAsB;AAC3D,KAAK,CAACC,GAAG,GAAG,CAAgB;AAC5B,MAAM,CAAC,KAAK,CAACC,gBAAgB,GAAuBH,GAAG,CAACE,GAAG,MAC1DD,KAAK,CACJ,MAAM,CAACG,OAAO,KAAK,CAAQ,WAAIA,OAAO,CAACC,GAAG,CAACC,aAAa;;AAI1D,MAAM,GACLH,gBAAgB,IAAII,gBAAgB"}
@@ -1,5 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { WritableAtom$ } from '@ctx-core/nanostores';
3
- export declare const NODE_ENV$_b: B<NODE_ENV$_T>;
4
- export declare type NODE_ENV$_T = WritableAtom$<string>;
5
- export { NODE_ENV$_b as b__NODE_ENV };
@@ -1,8 +0,0 @@
1
- import { be_ } from '@ctx-core/object';
2
- import { atom$ } from '@ctx-core/nanostores';
3
- const key = 'NODE_ENV$';
4
- export const NODE_ENV$_b = be_(key, ()=>atom$(process.env.NODE_ENV)
5
- );
6
- export { NODE_ENV$_b as b__NODE_ENV };
7
-
8
- //# sourceMappingURL=NODE_ENV$_b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/NODE_ENV$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { atom$, WritableAtom$ } from '@ctx-core/nanostores'\nconst key = 'NODE_ENV$'\nexport const NODE_ENV$_b:B<NODE_ENV$_T> = be_(key, ()=>\n\tatom$(process.env.NODE_ENV) as NODE_ENV$_T\n)\nexport type NODE_ENV$_T = WritableAtom$<string>\nexport { NODE_ENV$_b as b__NODE_ENV }\n"],"names":["be_","atom$","key","NODE_ENV$_b","process","env","NODE_ENV","b__NODE_ENV"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,KAAK,QAAuB,CAAsB;AAC3D,KAAK,CAACC,GAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAAkBH,GAAG,CAACE,GAAG,MAChDD,KAAK,CAACG,OAAO,CAACC,GAAG,CAACC,QAAQ;;AAG3B,MAAM,GAAGH,WAAW,IAAII,WAAW"}
@@ -1,5 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { WritableAtom$ } from '@ctx-core/nanostores';
3
- export declare const VERSION$_b: B<VERSION$_T>;
4
- export declare type VERSION$_T = WritableAtom$<string>;
5
- export { VERSION$_b as b__VERSION, };
@@ -1,8 +0,0 @@
1
- import { be_ } from '@ctx-core/object';
2
- import { atom$ } from '@ctx-core/nanostores';
3
- const key = 'VERSION$';
4
- export const VERSION$_b = be_(key, ()=>atom$(typeof process === 'object' && (process.env.VERSION || process.env.HEROKU_SLUG_COMMIT) || Math.random().toString())
5
- );
6
- export { VERSION$_b as b__VERSION, };
7
-
8
- //# sourceMappingURL=VERSION$_b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/VERSION$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { WritableAtom$, atom$ } from '@ctx-core/nanostores'\nconst key = 'VERSION$'\nexport const VERSION$_b:B<VERSION$_T> = be_(key, ()=>\n\tatom$(\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 = WritableAtom$<string>\nexport {\n\tVERSION$_b as b__VERSION,\n}\n"],"names":["be_","atom$","key","VERSION$_b","process","env","VERSION","HEROKU_SLUG_COMMIT","Math","random","toString","b__VERSION"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAkBC,KAAK,QAAQ,CAAsB;AAC3D,KAAK,CAACC,GAAG,GAAG,CAAU;AACtB,MAAM,CAAC,KAAK,CAACC,UAAU,GAAiBH,GAAG,CAACE,GAAG,MAC9CD,KAAK,CACH,MAAM,CAACG,OAAO,KAAK,CAAQ,YAC3BA,OAAO,CAACC,GAAG,CAACC,OAAO,IAChBF,OAAO,CAACC,GAAG,CAACE,kBAAkB,KAE/BC,IAAI,CAACC,MAAM,GAAGC,QAAQ;;AAI3B,MAAM,GACLP,UAAU,IAAIQ,UAAU"}
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export * from './CACHE_VERSION$_b.js';
2
- export * from './is_development$_b.js';
3
- export * from './is_production$_b.js';
4
- export * from './is_staging$_b.js';
5
- export * from './NODE_ENV$_b.js';
6
- export * from './throw_missing_env.js';
7
- export * from './VERSION$_b.js';
package/dist/index.js DELETED
@@ -1,9 +0,0 @@
1
- export * from './CACHE_VERSION$_b.js';
2
- export * from './is_development$_b.js';
3
- export * from './is_production$_b.js';
4
- export * from './is_staging$_b.js';
5
- export * from './NODE_ENV$_b.js';
6
- export * from './throw_missing_env.js';
7
- export * from './VERSION$_b.js';
8
-
9
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './CACHE_VERSION$_b.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,CAAwB;cACxB,CAAuB;cACvB,CAAoB;cACpB,CAAkB;cAClB,CAAwB;cACxB,CAAiB"}
@@ -1,5 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { ReadableAtom$ } from '@ctx-core/nanostores';
3
- export declare const is_development$_b: B<is_development$_T>;
4
- export declare type is_development$_T = ReadableAtom$<boolean>;
5
- export { is_development$_b as b__is__development };
@@ -1,10 +0,0 @@
1
- import { be_ } from '@ctx-core/object';
2
- import { computed$ } from '@ctx-core/nanostores';
3
- import { NODE_ENV$_b } from './NODE_ENV$_b.js';
4
- const key = 'is_development$';
5
- export const is_development$_b = be_(key, (ctx)=>computed$(NODE_ENV$_b(ctx), (NODE_ENV)=>NODE_ENV === 'dev' || NODE_ENV === 'development.js'
6
- )
7
- );
8
- export { is_development$_b as b__is__development };
9
-
10
- //# sourceMappingURL=is_development$_b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/is_development$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { computed$, ReadableAtom$ } from '@ctx-core/nanostores'\nimport { NODE_ENV$_b } from './NODE_ENV$_b.js'\nconst key = 'is_development$'\nexport const is_development$_b:B<is_development$_T> = be_(key, ctx=>\n\tcomputed$(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 = ReadableAtom$<boolean>\nexport { is_development$_b as b__is__development }\n"],"names":["be_","computed$","NODE_ENV$_b","key","is_development$_b","ctx","NODE_ENV","b__is__development"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,SAAS,QAAuB,CAAsB;AAC/D,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,KAAK,CAACC,GAAG,GAAG,CAAiB;AAC7B,MAAM,CAAC,KAAK,CAACC,iBAAiB,GAAwBJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GACjEJ,SAAS,CAACC,WAAW,CAACG,GAAG,IACxBC,QAAQ,GACPA,QAAQ,KAAK,CAAK,QAAIA,QAAQ,KAAK,CAAgB;;;AAItD,MAAM,GAAGF,iBAAiB,IAAIG,kBAAkB"}
@@ -1,5 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { ReadableAtom$ } from '@ctx-core/nanostores';
3
- export declare const is_production$_b: B<is_production$_T>;
4
- export declare type is_production$_T = ReadableAtom$<boolean>;
5
- export { is_production$_b as b__is__production };
@@ -1,10 +0,0 @@
1
- import { be_ } from '@ctx-core/object';
2
- import { computed$ } from '@ctx-core/nanostores';
3
- import { NODE_ENV$_b } from './NODE_ENV$_b.js';
4
- const key = 'is_production$';
5
- export const is_production$_b = be_(key, (ctx)=>computed$(NODE_ENV$_b(ctx), (NODE_ENV)=>NODE_ENV === 'prod' || NODE_ENV === 'production.js'
6
- )
7
- );
8
- export { is_production$_b as b__is__production };
9
-
10
- //# sourceMappingURL=is_production$_b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/is_production$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { computed$, ReadableAtom$ } from '@ctx-core/nanostores'\nimport { NODE_ENV$_b } from './NODE_ENV$_b.js'\nconst key = 'is_production$'\nexport const is_production$_b:B<is_production$_T> = be_(key, ctx=>\n\tcomputed$(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 = ReadableAtom$<boolean>\nexport { is_production$_b as b__is__production }\n"],"names":["be_","computed$","NODE_ENV$_b","key","is_production$_b","ctx","NODE_ENV","b__is__production"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,SAAS,QAAuB,CAAsB;AAC/D,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,KAAK,CAACC,GAAG,GAAG,CAAgB;AAC5B,MAAM,CAAC,KAAK,CAACC,gBAAgB,GAAuBJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GAC/DJ,SAAS,CAACC,WAAW,CAACG,GAAG,IAAGC,QAAQ,GACnCA,QAAQ,KAAK,CAAM,SAAIA,QAAQ,KAAK,CAAe;;;AAIrD,MAAM,GAAGF,gBAAgB,IAAIG,iBAAiB"}
@@ -1,5 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { ReadableAtom$ } from '@ctx-core/nanostores';
3
- export declare const is_staging$_b: B<is_staging$_T>;
4
- export declare type is_staging$_T = ReadableAtom$<boolean>;
5
- export { is_staging$_b as b__is__staging };
@@ -1,12 +0,0 @@
1
- import { eql_ } from '@ctx-core/function';
2
- import { be_ } from '@ctx-core/object';
3
- import { computed$ } from '@ctx-core/nanostores';
4
- import { NODE_ENV$_b } from './NODE_ENV$_b.js';
5
- const key = 'is_staging$';
6
- export const is_staging$_b = be_(key, (ctx)=>computed$(NODE_ENV$_b(ctx), eql_([
7
- 'staging'
8
- ]))
9
- );
10
- export { is_staging$_b as b__is__staging };
11
-
12
- //# sourceMappingURL=is_staging$_b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/is_staging$_b.ts"],"sourcesContent":["import { eql_ } from '@ctx-core/function'\nimport { B, be_ } from '@ctx-core/object'\nimport { computed$, ReadableAtom$ } from '@ctx-core/nanostores'\nimport { NODE_ENV$_b } from './NODE_ENV$_b.js'\nconst key = 'is_staging$'\nexport const is_staging$_b:B<is_staging$_T> = be_(key, ctx=>\n\tcomputed$(\n\t\tNODE_ENV$_b(ctx),\n\t\teql_(['staging'])\n\t) as is_staging$_T\n)\nexport type is_staging$_T = ReadableAtom$<boolean>\nexport { is_staging$_b as b__is__staging }\n"],"names":["eql_","be_","computed$","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,SAAS,QAAuB,CAAsB;AAC/D,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,KAAK,CAACC,GAAG,GAAG,CAAa;AACzB,MAAM,CAAC,KAAK,CAACC,aAAa,GAAoBJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GACzDJ,SAAS,CACRC,WAAW,CAACG,GAAG,GACfN,IAAI,CAAC,CAAC;QAAA,CAAS;IAAA,CAAC;;AAIlB,MAAM,GAAGK,aAAa,IAAIE,cAAc"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Throws an error for for a missing env variable
3
- */
4
- export declare function throw_missing_env(env_name: string): void;
5
- export { throw_missing_env as throw__missing__env };
@@ -1,17 +0,0 @@
1
- import { throw_error } from '@ctx-core/error';
2
- /**
3
- * Throws an error for for a missing env variable
4
- */ export function throw_missing_env(env_name) {
5
- const error_message = `
6
- ${env_name} environment variable not set.
7
- dev: make sure ${env_name} is set in your .env file
8
- heroku: make sure ${env_name} is set using \`heroku config:set\`
9
- `.trim();
10
- throw_error({
11
- error_message,
12
- type: 'missing_env'
13
- });
14
- }
15
- export { throw_missing_env as throw__missing__env };
16
-
17
- //# sourceMappingURL=throw_missing_env.js.map
@@ -1 +0,0 @@
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;AACxB,EAAED,QAAQ,CAAC;eACI,EAAEA,QAAQ,CAAC;kBACR,EAAEA,QAAQ,CAAC;CAC5B,EAAEE,IAAI;IACNJ,WAAW,CAAC,CAAC;QAACG,aAAa;QAAEE,IAAI,EAAE,CAAa;IAAC,CAAC;AACnD,CAAC;AACD,MAAM,GACLJ,iBAAiB,IAAIK,mBAAmB"}
@@ -1,12 +0,0 @@
1
- import { B, be_ } from '@ctx-core/object'
2
- import { WritableAtom$, atom$ } from '@ctx-core/nanostores'
3
- const key = 'CACHE_VERSION$'
4
- export const CACHE_VERSION$_b:B<CACHE_VERSION$_T> = be_(key, ()=>
5
- atom$(
6
- typeof process === 'object' && process.env.CACHE_VERSION
7
- ) as CACHE_VERSION$_T
8
- )
9
- export type CACHE_VERSION$_T = WritableAtom$<false|string>
10
- export {
11
- CACHE_VERSION$_b as b__CACHE_VERSION,
12
- }
@@ -1,8 +0,0 @@
1
- import { B, be_ } from '@ctx-core/object'
2
- import { atom$, WritableAtom$ } from '@ctx-core/nanostores'
3
- const key = 'NODE_ENV$'
4
- export const NODE_ENV$_b:B<NODE_ENV$_T> = be_(key, ()=>
5
- atom$(process.env.NODE_ENV) as NODE_ENV$_T
6
- )
7
- export type NODE_ENV$_T = WritableAtom$<string>
8
- export { NODE_ENV$_b as b__NODE_ENV }
package/src/VERSION$_b.ts DELETED
@@ -1,16 +0,0 @@
1
- import { B, be_ } from '@ctx-core/object'
2
- import { WritableAtom$, atom$ } from '@ctx-core/nanostores'
3
- const key = 'VERSION$'
4
- export const VERSION$_b:B<VERSION$_T> = be_(key, ()=>
5
- atom$(
6
- (typeof process === 'object' && (
7
- process.env.VERSION
8
- || process.env.HEROKU_SLUG_COMMIT
9
- ))
10
- || Math.random().toString()
11
- ) as VERSION$_T
12
- )
13
- export type VERSION$_T = WritableAtom$<string>
14
- export {
15
- VERSION$_b as b__VERSION,
16
- }
@@ -1,12 +0,0 @@
1
- import { B, be_ } from '@ctx-core/object'
2
- import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'
3
- import { NODE_ENV$_b } from './NODE_ENV$_b.js'
4
- const key = 'is_development$'
5
- export const is_development$_b:B<is_development$_T> = be_(key, ctx=>
6
- computed$(NODE_ENV$_b(ctx),
7
- NODE_ENV=>
8
- NODE_ENV === 'dev' || NODE_ENV === 'development.js'
9
- ) as is_development$_T
10
- )
11
- export type is_development$_T = ReadableAtom$<boolean>
12
- export { is_development$_b as b__is__development }
@@ -1,11 +0,0 @@
1
- import { B, be_ } from '@ctx-core/object'
2
- import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'
3
- import { NODE_ENV$_b } from './NODE_ENV$_b.js'
4
- const key = 'is_production$'
5
- export const is_production$_b:B<is_production$_T> = be_(key, ctx=>
6
- computed$(NODE_ENV$_b(ctx), NODE_ENV=>
7
- NODE_ENV === 'prod' || NODE_ENV === 'production.js'
8
- ) as is_production$_T
9
- )
10
- export type is_production$_T = ReadableAtom$<boolean>
11
- export { is_production$_b as b__is__production }
@@ -1,13 +0,0 @@
1
- import { eql_ } from '@ctx-core/function'
2
- import { B, be_ } from '@ctx-core/object'
3
- import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'
4
- import { NODE_ENV$_b } from './NODE_ENV$_b.js'
5
- const key = 'is_staging$'
6
- export const is_staging$_b:B<is_staging$_T> = be_(key, ctx=>
7
- computed$(
8
- NODE_ENV$_b(ctx),
9
- eql_(['staging'])
10
- ) as is_staging$_T
11
- )
12
- export type is_staging$_T = ReadableAtom$<boolean>
13
- export { is_staging$_b as b__is__staging }
@@ -1,15 +0,0 @@
1
- import { error_ctx_I, throw_error } from '@ctx-core/error'
2
- /**
3
- * Throws an error for for a missing env variable
4
- */
5
- export function throw_missing_env(env_name: string) {
6
- const error_message = `
7
- ${env_name} environment variable not set.
8
- dev: make sure ${env_name} is set in your .env file
9
- heroku: make sure ${env_name} is set using \`heroku config:set\`
10
- `.trim()
11
- throw_error({ error_message, type: 'missing_env' } as error_ctx_I)
12
- }
13
- export {
14
- throw_missing_env as throw__missing__env
15
- }