@voxgig/build 4.12.0 → 4.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/build",
3
- "version": "4.12.0",
3
+ "version": "4.12.1",
4
4
  "main": "dist/build.js",
5
5
  "type": "commonjs",
6
6
  "types": "dist/build.d.ts",
@@ -6,7 +6,7 @@
6
6
  // shared setup (src/env/shared/basic.ts).
7
7
 
8
8
  import Seneca from 'seneca'
9
- import { Live } from '@voxgig/system'
9
+ import { Live, context } from '@voxgig/system'
10
10
 
11
11
  import { basic, base } from '../shared/basic'
12
12
 
@@ -32,11 +32,10 @@ async function getSeneca(srvname: string, complete: Function): Promise<any> {
32
32
  timeout: srv.env.lambda.timeout * 60 * 1000,
33
33
  })).test()
34
34
 
35
- seneca.context.model = Model
36
- seneca.context.srvname = srvname
37
- seneca.context.stage = STAGE
38
- seneca.context.env = 'lambda'
39
- seneca.context.pkg = Pkg
35
+ // Runtime context: model/pkg/env/stage/srvname. Lambda is the one
36
+ // deployment with a service PER function, so srvname is explicit, and
37
+ // STAGE is resolved here (above) rather than left to context().
38
+ context(seneca, Model, Pkg, { env: 'lambda', srvname, stage: STAGE })
40
39
 
41
40
  basic(seneca, { reload: { active: false } })
42
41
 
@@ -4,6 +4,7 @@
4
4
  // wire the Seneca gateway the way src/env/lambda/lambda.ts does for AWS.
5
5
 
6
6
  import Seneca from 'seneca'
7
+ import { context } from '@voxgig/system'
7
8
 
8
9
  import { basic, base } from '../shared/basic'
9
10
 
@@ -19,9 +20,9 @@ async function getSeneca(): Promise<any> {
19
20
  tag: '$$name$$-azure@' + Pkg.version,
20
21
  })).test()
21
22
 
22
- seneca.context.model = Model
23
- seneca.context.env = 'azure'
24
- seneca.context.pkg = Pkg
23
+ // Runtime context: model/pkg/env/stage/srvname. This entry used to set
24
+ // only model/env/pkg - `stage` and `srvname` were simply missing.
25
+ context(seneca, Model, Pkg, { env: 'azure' })
25
26
 
26
27
  basic(seneca, { reload: { active: false } })
27
28
 
@@ -5,7 +5,7 @@
5
5
  // (main.env.$$env$$).
6
6
 
7
7
  import Seneca from 'seneca'
8
- import { Local } from '@voxgig/system'
8
+ import { Local, context } from '@voxgig/system'
9
9
 
10
10
  import { basic, base } from '../shared/basic'
11
11
 
@@ -26,11 +26,9 @@ async function run() {
26
26
  log: { level: envdef.log || 'warn' },
27
27
  }, envdef.seneca || {}))
28
28
 
29
- seneca.context.model = Model
30
- seneca.context.env = '$$env$$'
31
- seneca.context.stage = process.env.STAGE || '$$env$$'
32
- seneca.context.srvname = 'all'
33
- seneca.context.pkg = Pkg
29
+ // Runtime context: model/pkg/env/stage/srvname. `stage` resolves from
30
+ // STAGE, then the model's main.env.$$env$$.stage, then the env name.
31
+ context(seneca, Model, Pkg, { env: '$$env$$' })
34
32
 
35
33
  basic(seneca)
36
34
 
@@ -15,7 +15,7 @@ import Express from 'express'
15
15
  import CookieParser from 'cookie-parser'
16
16
 
17
17
  import Seneca from 'seneca'
18
- import { Local } from '@voxgig/system'
18
+ import { Local, context } from '@voxgig/system'
19
19
 
20
20
  import { basic, base } from '../shared/basic'
21
21
  import { seedDemo } from '../shared/seed'
@@ -40,11 +40,10 @@ async function run() {
40
40
 
41
41
  const seneca = Seneca(deep(base.seneca, { tag: '$$name$$-web' }))
42
42
 
43
- seneca.context.model = Model
44
- seneca.context.env = 'local'
45
- seneca.context.stage = 'local'
46
- seneca.context.srvname = 'all'
47
- seneca.context.pkg = Pkg
43
+ // Runtime context: model/pkg/env/stage/srvname. env is 'web' - this IS
44
+ // the web environment entry. It reported 'local' before context()
45
+ // existed, which no longer matched the entry it was generated for.
46
+ context(seneca, Model, Pkg, { env: 'web' })
48
47
 
49
48
  seneca.test()
50
49