@ctx-core/env 17.4.59 → 17.4.65

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/index.d.ts CHANGED
@@ -1,8 +1 @@
1
- export * from './CACHE_VERSION/index.js'
2
- export * from './import_meta_env/index.js'
3
- export * from './is_development/index.js'
4
- export * from './is_production/index.js'
5
- export * from './is_staging/index.js'
6
- export * from './missing_env__throw/index.js'
7
- export * from './NODE_ENV/index.js'
8
- export * from './VERSION/index.js'
1
+ export * from 'ctx-core/env'
package/index.js CHANGED
@@ -1,8 +1 @@
1
- export * from './CACHE_VERSION/index.js'
2
- export * from './import_meta_env/index.js'
3
- export * from './is_development/index.js'
4
- export * from './is_production/index.js'
5
- export * from './is_staging/index.js'
6
- export * from './missing_env__throw/index.js'
7
- export * from './NODE_ENV/index.js'
8
- export * from './VERSION/index.js'
1
+ export * from 'ctx-core/env'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/env",
3
- "version": "17.4.59",
3
+ "version": "17.4.65",
4
4
  "description": "ctx-core env",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -20,15 +20,7 @@
20
20
  "files": [
21
21
  "*.d.ts",
22
22
  "*.js",
23
- "*.json",
24
- "./CACHE_VERSION",
25
- "./import_meta_env",
26
- "./is_development",
27
- "./is_production",
28
- "./is_staging",
29
- "./missing_env__throw",
30
- "./NODE_ENV",
31
- "./VERSION"
23
+ "*.json"
32
24
  ],
33
25
  "types": "./index.d.ts",
34
26
  "exports": {
@@ -36,15 +28,12 @@
36
28
  "./package.json": "./package.json"
37
29
  },
38
30
  "dependencies": {
39
- "@ctx-core/error": "^12.4.53",
40
- "@ctx-core/function": "^21.24.8",
41
- "@ctx-core/nanostores": "^10.0.2",
42
- "@ctx-core/object": "^31.1.35"
31
+ "ctx-core": "^5.2.3"
43
32
  },
44
33
  "devDependencies": {
45
34
  "c8": "^8.0.1",
46
35
  "check-dts": "^0.7.2",
47
- "tsx": "^4.6.2",
36
+ "tsx": "^4.7.0",
48
37
  "typescript": "next",
49
38
  "uvu": "^0.5.6"
50
39
  },
@@ -1,10 +0,0 @@
1
- import type { be_atom_triple_T, WritableAtom_ } from '@ctx-core/nanostores'
2
- export declare const [
3
- CACHE_VERSION$_,
4
- CACHE_VERSION_,
5
- CACHE_VERSION__set,
6
- ]:be_atom_triple_T<false|string>
7
- export {
8
- CACHE_VERSION$_ as CACHE_VERSION__,
9
- CACHE_VERSION$_ as b__CACHE_VERSION,
10
- }
@@ -1,14 +0,0 @@
1
- import { atom_, be_atom_triple_ } from '@ctx-core/nanostores'
2
- import { import_meta_env_ } from '../import_meta_env/index.js'
3
- /** @typedef {import('@ctx-core/nanostores').be_atom_triple_T} */
4
- export const [
5
- CACHE_VERSION$_,
6
- CACHE_VERSION_,
7
- CACHE_VERSION__set,
8
- ] = /** @type {be_atom_triple_T<false|string>} */ be_atom_triple_(()=>
9
- typeof process === 'object' && import_meta_env_().CACHE_VERSION,
10
- { id: 'CACHE_VERSION' })
11
- export {
12
- CACHE_VERSION$_ as CACHE_VERSION__,
13
- CACHE_VERSION$_ as b__CACHE_VERSION,
14
- }
@@ -1,10 +0,0 @@
1
- import type { be_atom_triple_T } from '@ctx-core/nanostores'
2
- export declare const [
3
- NODE_ENV$_,
4
- NODE_ENV_,
5
- NODE_ENV__set,
6
- ]:be_atom_triple_T<string>
7
- export {
8
- NODE_ENV$_ as NODE_ENV__,
9
- NODE_ENV$_ as b__NODE_ENV,
10
- }
package/NODE_ENV/index.js DELETED
@@ -1,14 +0,0 @@
1
- import { be_atom_triple_ } from '@ctx-core/nanostores'
2
- import { import_meta_env_ } from '../import_meta_env/index.js'
3
- /** @typedef {import('@ctx-core/nanostores').be_atom_triple_T} */
4
- export const [
5
- NODE_ENV$_,
6
- NODE_ENV_,
7
- NODE_ENV__set,
8
- ] = /** @type {be_atom_triple_T<string>} */be_atom_triple_(()=>
9
- import_meta_env_().NODE_ENV,
10
- { id: 'NODE_ENV' })
11
- export {
12
- NODE_ENV$_ as NODE_ENV__,
13
- NODE_ENV$_ as b__NODE_ENV,
14
- }
@@ -1,7 +0,0 @@
1
- import type { be_atom_triple_T } from '@ctx-core/nanostores'
2
- export declare const [
3
- VERSION$_,
4
- VERSION_,
5
- VERSION__set,
6
- ]:be_atom_triple_T<string>
7
- export { VERSION$_ as VERSION__ }
package/VERSION/index.js DELETED
@@ -1,14 +0,0 @@
1
- import { be_atom_triple_ } from '@ctx-core/nanostores'
2
- import { import_meta_env_ } from '../import_meta_env/index.js'
3
- /** @typedef {import('@ctx-core/nanostores').be_atom_triple_T} */
4
- export const [
5
- VERSION$_,
6
- VERSION_,
7
- VERSION__set,
8
- ] = /** @type {be_atom_triple_T<string>} */be_atom_triple_(()=>
9
- typeof process === 'object' && (
10
- import_meta_env_().VERSION || import_meta_env_().HEROKU_SLUG_COMMIT
11
- )
12
- || Math.random().toString(),
13
- { id: 'VERSION' })
14
- export { VERSION$_ as VERSION__ }
@@ -1,10 +0,0 @@
1
- export function import_meta_env_<R extends ImportMetaEnv>():R
2
- export function import_meta_env__ensure<R extends ImportMetaEnv>():R
3
- declare global {
4
- interface ImportMeta {
5
- readonly env:ImportMetaEnv
6
- }
7
- }
8
- interface ImportMetaEnv {
9
- [key:string]:string
10
- }
@@ -1,18 +0,0 @@
1
- export function import_meta_env_() {
2
- return import_meta_env__ensure()
3
- }
4
- export function import_meta_env__ensure() {
5
- if (!import.meta.env) {
6
- Object.assign(import.meta, {
7
- env: new Proxy(process.env, {
8
- get(target, prop, receiver) {
9
- return Reflect.get(target, prop, receiver)
10
- },
11
- set(target, prop, value) {
12
- return Reflect.get(target, prop, value)
13
- }
14
- })
15
- })
16
- }
17
- return import.meta.env
18
- }
@@ -1,6 +0,0 @@
1
- import type { be_computed_pair_T } from '@ctx-core/nanostores'
2
- export declare const [
3
- is_development$_,
4
- is_development_,
5
- ]:be_computed_pair_T<boolean>
6
- export { is_development$_ as is_development__ }
@@ -1,9 +0,0 @@
1
- import { be_computed_pair_ } from '@ctx-core/nanostores'
2
- import { NODE_ENV$_ } from '../NODE_ENV/index.js'
3
- export const [
4
- is_development$_,
5
- is_development_,
6
- ] = be_computed_pair_(ctx=>NODE_ENV$_(ctx),
7
- NODE_ENV=>NODE_ENV === 'dev' || NODE_ENV === 'development',
8
- { id: 'is_development' })
9
- export { is_development$_ as is_development__ }
@@ -1,10 +0,0 @@
1
- import type { be_computed_pair_T, ReadableAtom_ } from '@ctx-core/nanostores'
2
- export declare const [
3
- is_production$_,
4
- is_production_,
5
- ]:be_computed_pair_T<is_production__T>
6
- export {
7
- is_production$_ as is_production__,
8
- is_production$_ as b__is__production,
9
- }
10
- export declare type is_production__T = ReadableAtom_<boolean>
@@ -1,12 +0,0 @@
1
- import { be_computed_pair_ } from '@ctx-core/nanostores'
2
- import { NODE_ENV$_ } from '../NODE_ENV/index.js'
3
- export const [
4
- is_production$_,
5
- is_production_,
6
- ] = be_computed_pair_(ctx=>NODE_ENV$_(ctx),
7
- NODE_ENV=>NODE_ENV === 'prod' || NODE_ENV === 'production',
8
- { id: 'is_production' })
9
- export {
10
- is_production$_ as is_production__,
11
- is_production$_ as b__is__production,
12
- }
@@ -1,9 +0,0 @@
1
- import type { be_computed_pair_T } from '@ctx-core/nanostores'
2
- export const [
3
- is_staging$_,
4
- is_staging_,
5
- ]: be_computed_pair_T<boolean>
6
- export {
7
- is_staging$_ as is_staging__,
8
- is_staging$_ as b__is__staging,
9
- }
@@ -1,12 +0,0 @@
1
- import { be_computed_pair_ } from '@ctx-core/nanostores'
2
- import { NODE_ENV$_ } from '../NODE_ENV/index.js'
3
- export const [
4
- is_staging$_,
5
- is_staging_,
6
- ] = be_computed_pair_(ctx=>NODE_ENV$_(ctx),
7
- NODE_ENV=>NODE_ENV === 'staging',
8
- { id: 'is_staging' })
9
- export {
10
- is_staging$_ as is_staging__,
11
- is_staging$_ as b__is__staging,
12
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Throws an error for a missing env variable
3
- */
4
- export declare function missing_env__throw(env_name:string):void
5
- export {
6
- missing_env__throw as throw_missing_env,
7
- missing_env__throw as throw__missing__env,
8
- }
@@ -1,19 +0,0 @@
1
- import { error_o__throw } from '@ctx-core/error'
2
- /**
3
- * Throws an error for a missing env variable
4
- * @param {string}env_name
5
- */
6
- export function missing_env__throw(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
- error_o__throw(error_message, {
13
- type: 'missing_env',
14
- })
15
- }
16
- export {
17
- missing_env__throw as throw_missing_env,
18
- missing_env__throw as throw__missing__env,
19
- }