@ctx-core/env 17.2.128 → 17.3.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/CHANGELOG.md +33 -0
- package/COMMIT_EDITMSG +0 -2
- package/package.json +2 -2
- package/src/CACHE_VERSION/index.d.ts +10 -0
- package/src/CACHE_VERSION/index.js +12 -0
- package/src/NODE_ENV/index.d.ts +10 -0
- package/src/NODE_ENV/index.js +12 -0
- package/src/VERSION/index.d.ts +7 -0
- package/src/VERSION/index.js +14 -0
- package/src/index.d.ts +6 -6
- package/src/index.js +6 -6
- package/src/is_development/index.d.ts +6 -0
- package/src/is_development/index.js +9 -0
- package/src/is_production/index.d.ts +10 -0
- package/src/is_production/index.js +12 -0
- package/src/is_staging/index.js +11 -0
- package/src/missing_env__throw/index.js +2 -2
- package/src/CACHE_VERSION__/index.d.ts +0 -7
- package/src/CACHE_VERSION__/index.js +0 -10
- package/src/NODE_ENV__/index.d.ts +0 -7
- package/src/NODE_ENV__/index.js +0 -10
- package/src/VERSION__/index.d.ts +0 -4
- package/src/VERSION__/index.js +0 -12
- package/src/is_development__/index.d.ts +0 -4
- package/src/is_development__/index.js +0 -9
- package/src/is_production__/index.d.ts +0 -8
- package/src/is_production__/index.js +0 -12
- package/src/is_staging__/index.js +0 -14
- /package/src/{is_staging__ → is_staging}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @ctx-core/env
|
|
2
2
|
|
|
3
|
+
## 17.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- - is*staging*
|
|
8
|
+
|
|
9
|
+
is*staging$*: aliased by is_staging\_\_
|
|
10
|
+
|
|
11
|
+
- - CACHE*VERSION*
|
|
12
|
+
|
|
13
|
+
CACHE*VERSION$*: aliased by CACHE_VERSION\_\_
|
|
14
|
+
|
|
15
|
+
- - is*production*
|
|
16
|
+
|
|
17
|
+
is*production$*: aliased by is_production\_\_
|
|
18
|
+
|
|
19
|
+
- - NODE*ENV*
|
|
20
|
+
|
|
21
|
+
NODE*ENV$*: aliased by NODE_ENV\_\_
|
|
22
|
+
|
|
23
|
+
- - is*development*
|
|
24
|
+
|
|
25
|
+
is*development$*: aliased by is_development\_\_
|
|
26
|
+
|
|
27
|
+
- - VERSION\_
|
|
28
|
+
|
|
29
|
+
VERSION$\_: aliased by VERSION\_\_
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
- @ctx-core/object@28.0.5
|
|
35
|
+
|
|
3
36
|
## 17.2.128
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/COMMIT_EDITMSG
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/env",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.3.0",
|
|
4
4
|
"description": "ctx-core env",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@ctx-core/error": "^12.3.39",
|
|
27
27
|
"@ctx-core/function": "^21.19.0",
|
|
28
28
|
"@ctx-core/nanostores": "^6.0.1",
|
|
29
|
-
"@ctx-core/object": "^28.0.
|
|
29
|
+
"@ctx-core/object": "^28.0.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"c8": "^8.0.1",
|
|
@@ -0,0 +1,10 @@
|
|
|
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<WritableAtom_<false|string>>
|
|
7
|
+
export {
|
|
8
|
+
CACHE_VERSION$_ as CACHE_VERSION__,
|
|
9
|
+
CACHE_VERSION$_ as b__CACHE_VERSION,
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { atom_, be_atom_triple_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { import_meta_env_ } from '../import_meta_env/index.js'
|
|
3
|
+
export const [
|
|
4
|
+
CACHE_VERSION$_,
|
|
5
|
+
CACHE_VERSION_,
|
|
6
|
+
CACHE_VERSION__set,
|
|
7
|
+
] = be_atom_triple_('CACHE_VERSION', ()=>
|
|
8
|
+
atom_(typeof process === 'object' && import_meta_env_().CACHE_VERSION))
|
|
9
|
+
export {
|
|
10
|
+
CACHE_VERSION$_ as CACHE_VERSION__,
|
|
11
|
+
CACHE_VERSION$_ as b__CACHE_VERSION,
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { be_atom_triple_T, WritableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
export declare const [
|
|
3
|
+
NODE_ENV$_,
|
|
4
|
+
NODE_ENV_,
|
|
5
|
+
NODE_ENV__set,
|
|
6
|
+
]:be_atom_triple_T<WritableAtom_<string>>
|
|
7
|
+
export {
|
|
8
|
+
NODE_ENV$_ as NODE_ENV__,
|
|
9
|
+
NODE_ENV$_ as b__NODE_ENV,
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { atom_, be_atom_triple_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { import_meta_env_ } from '../import_meta_env/index.js'
|
|
3
|
+
export const [
|
|
4
|
+
NODE_ENV$_,
|
|
5
|
+
NODE_ENV_,
|
|
6
|
+
NODE_ENV__set,
|
|
7
|
+
] = be_atom_triple_('NODE_ENV', ()=>
|
|
8
|
+
atom_(import_meta_env_().NODE_ENV))
|
|
9
|
+
export {
|
|
10
|
+
NODE_ENV$_ as NODE_ENV__,
|
|
11
|
+
NODE_ENV$_ as b__NODE_ENV,
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { atom_, be_atom_triple_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { import_meta_env_ } from '../import_meta_env/index.js'
|
|
3
|
+
export const [
|
|
4
|
+
VERSION$_,
|
|
5
|
+
VERSION_,
|
|
6
|
+
VERSION__set,
|
|
7
|
+
] = be_atom_triple_('VERSION', ()=>
|
|
8
|
+
atom_(
|
|
9
|
+
typeof process === 'object' && (
|
|
10
|
+
import_meta_env_().VERSION || import_meta_env_().HEROKU_SLUG_COMMIT
|
|
11
|
+
)
|
|
12
|
+
|| Math.random().toString())
|
|
13
|
+
)
|
|
14
|
+
export { VERSION$_ as VERSION__ }
|
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './CACHE_VERSION'
|
|
2
2
|
export * from './import_meta_env'
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
3
|
+
export * from './is_development'
|
|
4
|
+
export * from './is_production'
|
|
5
|
+
export * from './is_staging'
|
|
6
6
|
export * from './missing_env__throw'
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './NODE_ENV'
|
|
8
|
+
export * from './VERSION'
|
package/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './CACHE_VERSION/index.js'
|
|
2
2
|
export * from './import_meta_env/index.js'
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
3
|
+
export * from './is_development/index.js'
|
|
4
|
+
export * from './is_production/index.js'
|
|
5
|
+
export * from './is_staging/index.js'
|
|
6
6
|
export * from './missing_env__throw/index.js'
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './NODE_ENV/index.js'
|
|
8
|
+
export * from './VERSION/index.js'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { val__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
|
+
] = val__be_computed_pair_('is_development', ctx=>
|
|
7
|
+
NODE_ENV_(ctx) === 'dev'
|
|
8
|
+
|| NODE_ENV_(ctx) === 'development')
|
|
9
|
+
export { is_development$_ as is_development__ }
|
|
@@ -0,0 +1,10 @@
|
|
|
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>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { val__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
|
+
] = val__be_computed_pair_('is_production', ctx=>
|
|
7
|
+
NODE_ENV_(ctx) === 'prod'
|
|
8
|
+
|| NODE_ENV_(ctx) === 'production')
|
|
9
|
+
export {
|
|
10
|
+
is_production$_ as is_production__,
|
|
11
|
+
is_production$_ as b__is__production,
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { val__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
|
+
] = val__be_computed_pair_('is_staging', ctx=>
|
|
7
|
+
NODE_ENV_(ctx) === 'staging')
|
|
8
|
+
export {
|
|
9
|
+
is_staging$_ as is_staging__,
|
|
10
|
+
is_staging$_ as b__is__staging,
|
|
11
|
+
}
|
|
@@ -3,7 +3,7 @@ import { error_o__throw } from '@ctx-core/error'
|
|
|
3
3
|
* Throws an error for a missing env variable
|
|
4
4
|
*/
|
|
5
5
|
/** @type {import('missing_env__throw').missing_env__throw} */
|
|
6
|
-
export const missing_env__throw =
|
|
6
|
+
export const missing_env__throw = env_name=>{
|
|
7
7
|
const error_message = `
|
|
8
8
|
${env_name} environment variable not set.
|
|
9
9
|
dev: make sure ${env_name} is set in your .env file
|
|
@@ -16,5 +16,5 @@ heroku: make sure ${env_name} is set using \`heroku config:set\`
|
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
18
|
missing_env__throw as throw_missing_env,
|
|
19
|
-
missing_env__throw as throw__missing__env,
|
|
19
|
+
missing_env__throw as throw__missing__env,
|
|
20
20
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { atom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { import_meta_env_ } from '../import_meta_env/index.js'
|
|
4
|
-
/** @type {typeof import('./index.d.ts').CACHE_VERSION__} */
|
|
5
|
-
export const CACHE_VERSION__ = be_('CACHE_VERSION__', ()=>
|
|
6
|
-
atom_(typeof process === 'object' && import_meta_env_().CACHE_VERSION))
|
|
7
|
-
export {
|
|
8
|
-
CACHE_VERSION__ as CACHE_VERSION$_,
|
|
9
|
-
CACHE_VERSION__ as b__CACHE_VERSION,
|
|
10
|
-
}
|
package/src/NODE_ENV__/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { atom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { import_meta_env_ } from '../import_meta_env/index.js'
|
|
4
|
-
/** @type {typeof import('./index.d.ts').NODE_ENV__} */
|
|
5
|
-
export const NODE_ENV__ = be_('NODE_ENV__', ()=>
|
|
6
|
-
atom_(import_meta_env_().NODE_ENV))
|
|
7
|
-
export {
|
|
8
|
-
NODE_ENV__ as NODE_ENV$_,
|
|
9
|
-
NODE_ENV__ as b__NODE_ENV,
|
|
10
|
-
}
|
package/src/VERSION__/index.d.ts
DELETED
package/src/VERSION__/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { atom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { import_meta_env_ } from '../import_meta_env/index.js'
|
|
4
|
-
/** @type {typeof import('./index.d.ts').VERSION__} */
|
|
5
|
-
export const VERSION__ = be_('VERSION__', ()=>
|
|
6
|
-
atom_(
|
|
7
|
-
typeof process === 'object' && (
|
|
8
|
-
import_meta_env_().VERSION || import_meta_env_().HEROKU_SLUG_COMMIT
|
|
9
|
-
)
|
|
10
|
-
|| Math.random().toString())
|
|
11
|
-
)
|
|
12
|
-
export { VERSION__ as VERSION$_ }
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { computed_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { NODE_ENV__ } from '../NODE_ENV__/index.js'
|
|
4
|
-
/** @type {typeof import('./index.d.ts').is_development__} */
|
|
5
|
-
export const is_development__ = be_('is_development__', ctx=>
|
|
6
|
-
computed_(NODE_ENV__(ctx),
|
|
7
|
-
(NODE_ENV)=>
|
|
8
|
-
NODE_ENV === 'dev' || NODE_ENV === 'development'))
|
|
9
|
-
export { is_development__ as is_development$_ }
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import type { Be } from '@ctx-core/object'
|
|
3
|
-
export declare const is_production__:Be<is_production__T>
|
|
4
|
-
export declare type is_production__T = ReadableAtom_<boolean>
|
|
5
|
-
export {
|
|
6
|
-
is_production__ as is_production$_,
|
|
7
|
-
is_production__ as b__is__production,
|
|
8
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { computed_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { NODE_ENV__ } from '../NODE_ENV__/index.js'
|
|
4
|
-
/** @type {typeof import('./index.d.ts').is_production__} */
|
|
5
|
-
export const is_production__ = be_('is_production__', ctx=>
|
|
6
|
-
computed_(NODE_ENV__(ctx),
|
|
7
|
-
(NODE_ENV)=>
|
|
8
|
-
NODE_ENV === 'prod' || NODE_ENV === 'production'))
|
|
9
|
-
export {
|
|
10
|
-
is_production__ as is_production$_,
|
|
11
|
-
is_production__ as b__is__production,
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { eql_ } from '@ctx-core/function'
|
|
2
|
-
import { computed_ } from '@ctx-core/nanostores'
|
|
3
|
-
import { be_ } from '@ctx-core/object'
|
|
4
|
-
import { NODE_ENV__ } from '../NODE_ENV__/index.js'
|
|
5
|
-
/** @type {typeof import('./index.d.ts').is_staging__} */
|
|
6
|
-
export const is_staging__ = be_('is_staging__', ctx=>
|
|
7
|
-
computed_(NODE_ENV__(ctx),
|
|
8
|
-
eql_([
|
|
9
|
-
'staging'
|
|
10
|
-
])))
|
|
11
|
-
export {
|
|
12
|
-
is_staging__ as is_staging$_,
|
|
13
|
-
is_staging__ as b__is__staging,
|
|
14
|
-
}
|
|
File without changes
|