@ctx-core/env 16.1.43 → 16.2.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 +12 -0
- package/package.json +2 -2
- package/src/{CACHE_VERSION__.d.ts → CACHE_VERSION__/index.d.ts} +2 -2
- package/src/{CACHE_VERSION__.js → CACHE_VERSION__/index.js} +2 -3
- package/src/{NODE_ENV__.d.ts → NODE_ENV__/index.d.ts} +2 -2
- package/src/{NODE_ENV__.js → NODE_ENV__/index.js} +3 -2
- package/src/VERSION__/index.d.ts +4 -0
- package/src/{VERSION__.js → VERSION__/index.js} +1 -1
- package/src/index.js +7 -7
- package/src/{is_development__.d.ts → is_development__/index.d.ts} +2 -2
- package/src/{is_development__.js → is_development__/index.js} +3 -5
- package/src/is_production__/index.d.ts +8 -0
- package/src/{is_production__.js → is_production__/index.js} +3 -5
- package/src/{is_staging__.d.ts → is_staging__/index.d.ts} +2 -2
- package/src/{is_staging__.js → is_staging__/index.js} +3 -4
- package/src/throw_missing_env/index.d.ts +5 -0
- package/src/{throw_missing_env.js → throw_missing_env/index.js} +4 -4
- package/src/VERSION__.d.ts +0 -4
- package/src/is_production__.d.ts +0 -8
- package/src/throw_missing_env.d.ts +0 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/env",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0",
|
|
4
4
|
"description": "ctx-core env",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"./package.json": "./package.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ctx-core/error": "^11.
|
|
26
|
+
"@ctx-core/error": "^11.6.0",
|
|
27
27
|
"@ctx-core/function": "^21.6.1",
|
|
28
28
|
"@ctx-core/nanostores": "^2.2.22",
|
|
29
29
|
"@ctx-core/object": "^24.1.4",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { WritableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import type { B } from '@ctx-core/object'
|
|
3
3
|
export declare const CACHE_VERSION__:B<WritableAtom_<false|string>>
|
|
4
4
|
export {
|
|
5
5
|
CACHE_VERSION__ as CACHE_VERSION$_,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { atom_ } from '@ctx-core/nanostores'
|
|
2
2
|
import { be_ } from '@ctx-core/object'
|
|
3
|
-
/** @type {import('./
|
|
3
|
+
/** @type {typeof import('./index.d.ts').CACHE_VERSION__} */
|
|
4
4
|
export const CACHE_VERSION__ = be_('CACHE_VERSION__', ()=>
|
|
5
|
-
atom_(typeof process === 'object' && process.env.CACHE_VERSION)
|
|
6
|
-
)
|
|
5
|
+
atom_(typeof process === 'object' && process.env.CACHE_VERSION))
|
|
7
6
|
export {
|
|
8
7
|
CACHE_VERSION__ as CACHE_VERSION$_,
|
|
9
8
|
CACHE_VERSION__ as b__CACHE_VERSION,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { WritableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import type { B } from '@ctx-core/object'
|
|
3
3
|
export declare const NODE_ENV__:B<WritableAtom_<string>>
|
|
4
4
|
export {
|
|
5
5
|
NODE_ENV__ as NODE_ENV$_,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { atom_ } from '@ctx-core/nanostores'
|
|
2
2
|
import { be_ } from '@ctx-core/object'
|
|
3
|
-
/** @type {import('
|
|
4
|
-
export const NODE_ENV__ = be_('NODE_ENV__', ()=>
|
|
3
|
+
/** @type {typeof import('./index.d.ts').NODE_ENV__} */
|
|
4
|
+
export const NODE_ENV__ = be_('NODE_ENV__', ()=>
|
|
5
|
+
atom_(process.env.NODE_ENV))
|
|
5
6
|
export {
|
|
6
7
|
NODE_ENV__ as NODE_ENV$_,
|
|
7
8
|
NODE_ENV__ as b__NODE_ENV,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { atom_ } from '@ctx-core/nanostores'
|
|
2
2
|
import { be_ } from '@ctx-core/object'
|
|
3
|
-
/** @type {import('
|
|
3
|
+
/** @type {typeof import('./index.d.ts').VERSION__} */
|
|
4
4
|
export const VERSION__ = be_('VERSION__', ()=>
|
|
5
5
|
atom_(
|
|
6
6
|
typeof process === 'object' && (
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './CACHE_VERSION__.js'
|
|
2
|
-
export * from './is_development__.js'
|
|
3
|
-
export * from './is_production__.js'
|
|
4
|
-
export * from './is_staging__.js'
|
|
5
|
-
export * from './NODE_ENV__.js'
|
|
6
|
-
export * from './throw_missing_env.js'
|
|
7
|
-
export * from './VERSION__.js'
|
|
1
|
+
export * from './CACHE_VERSION__/index.js'
|
|
2
|
+
export * from './is_development__/index.js'
|
|
3
|
+
export * from './is_production__/index.js'
|
|
4
|
+
export * from './is_staging__/index.js'
|
|
5
|
+
export * from './NODE_ENV__/index.js'
|
|
6
|
+
export * from './throw_missing_env/index.js'
|
|
7
|
+
export * from './VERSION__/index.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import type { B } from '@ctx-core/object'
|
|
3
3
|
export declare const is_development__:B<ReadableAtom_<boolean>>
|
|
4
4
|
export { is_development__ as is_development$_ }
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { computed_ } from '@ctx-core/nanostores'
|
|
2
2
|
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { NODE_ENV__ } from '
|
|
4
|
-
/** @type {import('
|
|
3
|
+
import { NODE_ENV__ } from '../NODE_ENV__/index.js'
|
|
4
|
+
/** @type {typeof import('./index.d.ts').is_development__} */
|
|
5
5
|
export const is_development__ = be_('is_development__', ctx=>
|
|
6
6
|
computed_(NODE_ENV__(ctx),
|
|
7
7
|
(NODE_ENV)=>
|
|
8
|
-
NODE_ENV === 'dev' || NODE_ENV === 'development'
|
|
9
|
-
)
|
|
10
|
-
)
|
|
8
|
+
NODE_ENV === 'dev' || NODE_ENV === 'development'))
|
|
11
9
|
export { is_development__ as is_development$_ }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import type { B } from '@ctx-core/object'
|
|
3
|
+
export declare const is_production__:B<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,13 +1,11 @@
|
|
|
1
1
|
import { computed_ } from '@ctx-core/nanostores'
|
|
2
2
|
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { NODE_ENV__ } from '
|
|
4
|
-
/** @type {import('
|
|
3
|
+
import { NODE_ENV__ } from '../NODE_ENV__/index.js'
|
|
4
|
+
/** @type {typeof import('./index.d.ts').is_production__} */
|
|
5
5
|
export const is_production__ = be_('is_production__', ctx=>
|
|
6
6
|
computed_(NODE_ENV__(ctx),
|
|
7
7
|
(NODE_ENV)=>
|
|
8
|
-
NODE_ENV === 'prod' || NODE_ENV === 'production'
|
|
9
|
-
)
|
|
10
|
-
)
|
|
8
|
+
NODE_ENV === 'prod' || NODE_ENV === 'production'))
|
|
11
9
|
export {
|
|
12
10
|
is_production__ as is_production$_,
|
|
13
11
|
is_production__ as b__is__production,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import type { B } from '@ctx-core/object'
|
|
3
3
|
export declare const is_staging__:B<ReadableAtom_<boolean>>
|
|
4
4
|
export {
|
|
5
5
|
is_staging__ as is_staging$_,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { eql_ } from '@ctx-core/function'
|
|
2
2
|
import { computed_ } from '@ctx-core/nanostores'
|
|
3
3
|
import { be_ } from '@ctx-core/object'
|
|
4
|
-
import { NODE_ENV__ } from '
|
|
5
|
-
/** @type {import('
|
|
4
|
+
import { NODE_ENV__ } from '../NODE_ENV__/index.js'
|
|
5
|
+
/** @type {typeof import('./index.d.ts').is_staging__} */
|
|
6
6
|
export const is_staging__ = be_('is_staging__', ctx=>
|
|
7
7
|
computed_(NODE_ENV__(ctx),
|
|
8
8
|
eql_([
|
|
9
9
|
'staging'
|
|
10
|
-
]))
|
|
11
|
-
)
|
|
10
|
+
])))
|
|
12
11
|
export {
|
|
13
12
|
is_staging__ as is_staging$_,
|
|
14
13
|
is_staging__ as b__is__staging,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { error__throw } from '@ctx-core/error'
|
|
2
2
|
/**
|
|
3
|
-
* Throws an error for
|
|
3
|
+
* Throws an error for a missing env variable
|
|
4
4
|
*/
|
|
5
5
|
/** @type {import('throw_missing_env').throw_missing_env} */
|
|
6
6
|
export const throw_missing_env = (env_name)=>{
|
|
@@ -9,9 +9,9 @@ ${env_name} environment variable not set.
|
|
|
9
9
|
dev: make sure ${env_name} is set in your .env file
|
|
10
10
|
heroku: make sure ${env_name} is set using \`heroku config:set\`
|
|
11
11
|
`.trim()
|
|
12
|
-
|
|
12
|
+
error__throw({
|
|
13
13
|
error_message,
|
|
14
|
-
type: 'missing_env'
|
|
14
|
+
type: 'missing_env',
|
|
15
15
|
})
|
|
16
16
|
}
|
|
17
17
|
export { throw_missing_env as throw__missing__env }
|
package/src/VERSION__.d.ts
DELETED
package/src/is_production__.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { type B } from '@ctx-core/object'
|
|
3
|
-
export declare const is_production__:B<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
|
-
}
|