@voxgig/model 5.0.0 → 5.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/bin/voxgig-model +19 -17
- package/dist/build.d.ts +6 -5
- package/dist/build.js +86 -38
- package/dist/build.js.map +1 -1
- package/dist/builder/local.js +42 -29
- package/dist/builder/local.js.map +1 -1
- package/dist/builder/model.js +14 -19
- package/dist/builder/model.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.js +3 -3
- package/dist/config.js.map +1 -1
- package/dist/model.d.ts +3 -2
- package/dist/model.js +43 -31
- package/dist/model.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +21 -7
- package/dist/watch.d.ts +1 -2
- package/dist/watch.js +83 -93
- package/dist/watch.js.map +1 -1
- package/package.json +9 -8
package/bin/voxgig-model
CHANGED
|
@@ -41,15 +41,6 @@ async function run() {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
function exit(err) {
|
|
45
|
-
let code = 0
|
|
46
|
-
if(err) {
|
|
47
|
-
code = 1
|
|
48
|
-
}
|
|
49
|
-
process.exit(code)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
44
|
function resolveOptions() {
|
|
54
45
|
|
|
55
46
|
const args = parseArgs({
|
|
@@ -99,7 +90,7 @@ function resolveOptions() {
|
|
|
99
90
|
|
|
100
91
|
function validateOptions(rawOptions) {
|
|
101
92
|
const optShape = Gubu({
|
|
102
|
-
model: Fault('The first argument
|
|
93
|
+
model: Fault('The first command line argument must be the model file path.', String),
|
|
103
94
|
watch: Boolean,
|
|
104
95
|
debug: One(String,Boolean),
|
|
105
96
|
help: Boolean,
|
|
@@ -110,7 +101,9 @@ function validateOptions(rawOptions) {
|
|
|
110
101
|
const options = optShape(rawOptions,{err})
|
|
111
102
|
|
|
112
103
|
if(err[0]) {
|
|
113
|
-
|
|
104
|
+
const errtext = 'ERROR: '+err.map(err=>err.text).join('\n')
|
|
105
|
+
console.error(errtext)
|
|
106
|
+
exit(1)
|
|
114
107
|
}
|
|
115
108
|
|
|
116
109
|
return options
|
|
@@ -118,8 +111,7 @@ function validateOptions(rawOptions) {
|
|
|
118
111
|
|
|
119
112
|
|
|
120
113
|
async function handleError(err) {
|
|
121
|
-
CONSOLE.
|
|
122
|
-
CONSOLE.log(err)
|
|
114
|
+
CONSOLE.error(err)
|
|
123
115
|
exit(err)
|
|
124
116
|
}
|
|
125
117
|
|
|
@@ -135,10 +127,23 @@ function help() {
|
|
|
135
127
|
}
|
|
136
128
|
|
|
137
129
|
|
|
130
|
+
function exit(err) {
|
|
131
|
+
let code = 0
|
|
132
|
+
if(err) {
|
|
133
|
+
code = 1
|
|
134
|
+
}
|
|
135
|
+
process.exit(code)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
138
|
|
|
139
139
|
async function generate(options) {
|
|
140
140
|
let path = options.model
|
|
141
141
|
|
|
142
|
+
if(!Fs.existsSync(path)) {
|
|
143
|
+
console.error('ERROR: model file does not exist: '+(path.replace(process.cwd(),'.')))
|
|
144
|
+
exit(1)
|
|
145
|
+
}
|
|
146
|
+
|
|
142
147
|
let fstats = Fs.statSync(path)
|
|
143
148
|
let base = Path.resolve(path)
|
|
144
149
|
|
|
@@ -149,10 +154,7 @@ async function generate(options) {
|
|
|
149
154
|
|
|
150
155
|
path = Path.resolve(path)
|
|
151
156
|
|
|
152
|
-
let src = Fs.readFileSync(path).toString()
|
|
153
|
-
|
|
154
157
|
let spec = {
|
|
155
|
-
src,
|
|
156
158
|
path,
|
|
157
159
|
base,
|
|
158
160
|
require: process.cwd(),
|
|
@@ -165,7 +167,7 @@ async function generate(options) {
|
|
|
165
167
|
model.start()
|
|
166
168
|
}
|
|
167
169
|
else {
|
|
168
|
-
|
|
170
|
+
await model.run()
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
|
package/dist/build.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { Val } from 'aontu';
|
|
2
|
-
import type { Build, BuildResult,
|
|
2
|
+
import type { Build, BuildResult, BuildContext, BuildSpec, RunSpec, Log } from './types';
|
|
3
3
|
declare class BuildImpl implements Build {
|
|
4
4
|
id: string;
|
|
5
|
-
src: string;
|
|
6
5
|
base: string;
|
|
7
6
|
path: string;
|
|
8
7
|
root: any;
|
|
9
8
|
opts: any;
|
|
10
|
-
res:
|
|
9
|
+
res: any[];
|
|
11
10
|
spec: BuildSpec;
|
|
12
11
|
model: any;
|
|
13
12
|
use: {};
|
|
14
|
-
|
|
13
|
+
errs: any[];
|
|
15
14
|
ctx: BuildContext;
|
|
16
15
|
log: Log;
|
|
16
|
+
fs: any;
|
|
17
17
|
constructor(spec: BuildSpec, log: Log);
|
|
18
|
-
run(): Promise<BuildResult>;
|
|
18
|
+
run(rspec: RunSpec): Promise<BuildResult>;
|
|
19
|
+
resolveModel(): Promise<boolean>;
|
|
19
20
|
}
|
|
20
21
|
declare function makeBuild(spec: BuildSpec, log: Log): BuildImpl;
|
|
21
22
|
export { makeBuild, BuildSpec, Val };
|
package/dist/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* Copyright © 2021-
|
|
2
|
+
/* Copyright © 2021-2024 Voxgig Ltd, MIT License. */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.makeBuild = makeBuild;
|
|
5
5
|
const aontu_1 = require("aontu");
|
|
@@ -7,15 +7,15 @@ class BuildImpl {
|
|
|
7
7
|
constructor(spec, log) {
|
|
8
8
|
this.root = aontu_1.Nil.make();
|
|
9
9
|
this.use = {};
|
|
10
|
-
this.
|
|
10
|
+
this.errs = [];
|
|
11
11
|
this.id = String(Math.random()).substring(3, 9);
|
|
12
12
|
this.log = log;
|
|
13
13
|
this.spec = spec;
|
|
14
|
-
this.
|
|
14
|
+
this.fs = spec.fs;
|
|
15
15
|
this.base = null == spec.base ? '' : spec.base;
|
|
16
16
|
this.path = null == spec.path ? '' : spec.path;
|
|
17
17
|
this.opts = {};
|
|
18
|
-
this.ctx = { step: 'pre', state: {} };
|
|
18
|
+
this.ctx = { step: 'pre', watch: false, state: {} };
|
|
19
19
|
if (null != spec.base) {
|
|
20
20
|
this.opts.base = spec.base;
|
|
21
21
|
this.opts.path = spec.path;
|
|
@@ -26,59 +26,107 @@ class BuildImpl {
|
|
|
26
26
|
this.res = spec.res || [];
|
|
27
27
|
Object.assign(this.use, spec.use || {});
|
|
28
28
|
}
|
|
29
|
-
async run() {
|
|
29
|
+
async run(rspec) {
|
|
30
30
|
let hasErr = false;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
let runlog = [];
|
|
32
|
+
// console.log('BUILD RUN RES', this.res)
|
|
33
|
+
this.ctx = { step: 'pre', state: {}, watch: rspec.watch };
|
|
33
34
|
const brlog = [];
|
|
34
|
-
|
|
35
|
+
if (!hasErr) {
|
|
36
|
+
runlog.push('model:initial');
|
|
37
|
+
hasErr = await this.resolveModel();
|
|
38
|
+
// console.log('MODEL', this.path, hasErr, rspec, this.errs)
|
|
39
|
+
}
|
|
40
|
+
if (!hasErr) {
|
|
41
|
+
for (let builder of this.res) {
|
|
42
|
+
try {
|
|
43
|
+
runlog.push('builder:pre:' + builder.build.name);
|
|
44
|
+
let br = await builder.build(this, this.ctx);
|
|
45
|
+
br.step = this.ctx.step;
|
|
46
|
+
br.path = builder.path;
|
|
47
|
+
br.builder = builder.build.name;
|
|
48
|
+
brlog.push(br);
|
|
49
|
+
if (!br.ok) {
|
|
50
|
+
hasErr = true;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
hasErr = true;
|
|
56
|
+
this.errs.push(err);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// TODO: only reload if mode changed
|
|
62
|
+
if (!hasErr) {
|
|
63
|
+
runlog.push('model:full');
|
|
64
|
+
hasErr = await this.resolveModel();
|
|
65
|
+
}
|
|
66
|
+
if (!hasErr) {
|
|
67
|
+
this.ctx.step = 'post';
|
|
68
|
+
for (let builder of this.res) {
|
|
69
|
+
try {
|
|
70
|
+
runlog.push('builder:post:' + builder.build.name);
|
|
71
|
+
let br = await builder.build(this, this.ctx);
|
|
72
|
+
br.step = this.ctx.step;
|
|
73
|
+
br.path = builder.path;
|
|
74
|
+
br.builder = builder.build.name;
|
|
75
|
+
brlog.push(br);
|
|
76
|
+
if (!br.ok) {
|
|
77
|
+
hasErr = true;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
hasErr = true;
|
|
83
|
+
this.errs.push(err);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const br = {
|
|
89
|
+
// TODO: remove need for this
|
|
90
|
+
build: () => this,
|
|
91
|
+
ok: !hasErr,
|
|
92
|
+
builders: brlog,
|
|
93
|
+
errs: this.errs,
|
|
94
|
+
runlog
|
|
95
|
+
};
|
|
96
|
+
// console.log('BUILD RESULT', br.ok, br.runlog)
|
|
97
|
+
return br;
|
|
98
|
+
}
|
|
99
|
+
async resolveModel() {
|
|
100
|
+
let hasErr = false;
|
|
101
|
+
let src = '';
|
|
102
|
+
if (!hasErr) {
|
|
35
103
|
try {
|
|
36
|
-
|
|
37
|
-
br.step = this.ctx.step;
|
|
38
|
-
br.path = builder.path;
|
|
39
|
-
br.builder = builder.build.name;
|
|
40
|
-
brlog.push(br);
|
|
104
|
+
src = this.fs.readFileSync(this.path, 'utf8');
|
|
41
105
|
}
|
|
42
|
-
catch (
|
|
43
|
-
this.err.push(e);
|
|
106
|
+
catch (err) {
|
|
44
107
|
hasErr = true;
|
|
45
|
-
|
|
108
|
+
this.errs.push(err);
|
|
46
109
|
}
|
|
47
110
|
}
|
|
48
111
|
if (!hasErr) {
|
|
49
|
-
this.root = (0, aontu_1.Aontu)(
|
|
112
|
+
this.root = (0, aontu_1.Aontu)(src, this.opts);
|
|
50
113
|
hasErr = this.root.err && 0 < this.root.err.length;
|
|
51
114
|
if (hasErr) {
|
|
52
|
-
this.
|
|
115
|
+
this.errs.push(...this.root.err);
|
|
116
|
+
// console.log('AONTU PARSE ERRS', this.errs)
|
|
53
117
|
}
|
|
54
118
|
}
|
|
55
119
|
if (!hasErr) {
|
|
56
120
|
let genctx = new aontu_1.Context({ root: this.root });
|
|
57
121
|
this.model = this.root.gen(genctx);
|
|
122
|
+
// console.log('AAA', Object.keys(this.model.main?.api?.entity || {}))
|
|
58
123
|
hasErr = genctx.err && 0 < genctx.err.length;
|
|
59
124
|
if (hasErr) {
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
else {
|
|
63
|
-
// TODO: only call if path value has changed
|
|
64
|
-
this.ctx.step = 'post';
|
|
65
|
-
for (let builder of this.res) {
|
|
66
|
-
try {
|
|
67
|
-
let br = await builder.build(this, this.ctx);
|
|
68
|
-
br.step = this.ctx.step;
|
|
69
|
-
br.path = builder.path;
|
|
70
|
-
br.builder = builder.build.name;
|
|
71
|
-
brlog.push(br);
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
this.err.push(e);
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
125
|
+
this.errs.push(...genctx.err);
|
|
126
|
+
// console.log('AONTU GEN ERRS', this.errs)
|
|
78
127
|
}
|
|
79
128
|
}
|
|
80
|
-
|
|
81
|
-
return br;
|
|
129
|
+
return hasErr;
|
|
82
130
|
}
|
|
83
131
|
}
|
|
84
132
|
function makeBuild(spec, log) {
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":";AAAA,oDAAoD;;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":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AAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAElC,sEAAsE;YAEtE,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAA;YAC5C,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;gBAC7B,2CAA2C;YAC7C,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAGD,SAAS,SAAS,CAAC,IAAe,EAAE,GAAQ;IAC1C,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC"}
|
package/dist/builder/local.js
CHANGED
|
@@ -10,46 +10,59 @@ const local_builder = async (build, ctx) => {
|
|
|
10
10
|
ctx.state.local = (ctx.state.local || {});
|
|
11
11
|
let actionDefs = ctx.state.local.actionDefs;
|
|
12
12
|
if (null == actionDefs) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
const step = action.step || 'post';
|
|
32
|
-
actionDefs.push({ name, builder, action, step });
|
|
13
|
+
actionDefs = ctx.state.local.actionDefs = [];
|
|
14
|
+
// TODO: need to provide project root via build
|
|
15
|
+
let root = path_1.default.resolve(build.path, '..', '..');
|
|
16
|
+
// TODO: build should do this
|
|
17
|
+
let configBuildResult = build.use.config.watch.last;
|
|
18
|
+
let configBuild = configBuildResult?.build();
|
|
19
|
+
let config = configBuild?.model || {};
|
|
20
|
+
let builders = config.sys?.model.builders || {};
|
|
21
|
+
// console.log('LOCAL BUILDERS', builders)
|
|
22
|
+
// TODO: order by comma sep string
|
|
23
|
+
// Load builders
|
|
24
|
+
for (let name in builders) {
|
|
25
|
+
let builder = builders[name];
|
|
26
|
+
let action_path = path_1.default.join(root, builder.load);
|
|
27
|
+
let action = require(action_path);
|
|
28
|
+
if (action instanceof Promise) {
|
|
29
|
+
action = await action;
|
|
33
30
|
}
|
|
31
|
+
const step = action.step || 'post';
|
|
32
|
+
actionDefs.push({ name, builder, action, step });
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
throw e;
|
|
37
|
-
}
|
|
34
|
+
// console.log('LOCAL ACTION DEFS', actionDefs)
|
|
38
35
|
}
|
|
39
36
|
const runActionDefs = actionDefs.filter((ad) => ctx.step === ad.step || 'all' === ad.step);
|
|
40
|
-
// console.log(runActionDefs)
|
|
41
37
|
build.log.info({
|
|
42
38
|
point: ctx.step + '-actions', step: ctx.step, actions: runActionDefs,
|
|
43
39
|
note: runActionDefs.map((ad) => ad.name).join(';')
|
|
44
40
|
});
|
|
45
41
|
let ok = true;
|
|
46
|
-
let
|
|
42
|
+
let areslog = [];
|
|
47
43
|
for (let actionDef of runActionDefs) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
try {
|
|
45
|
+
let ares = await actionDef.action(build.model, build, ctx);
|
|
46
|
+
ok = ok && (null == ares || !!ares.ok);
|
|
47
|
+
areslog.push(ares);
|
|
48
|
+
console.log('ARES', ares);
|
|
49
|
+
if (!ok) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (!err.__logged__) {
|
|
55
|
+
build.log.error({
|
|
56
|
+
point: ctx.step + '-action', step: ctx.step, action: actionDef,
|
|
57
|
+
note: actionDef.name,
|
|
58
|
+
err
|
|
59
|
+
});
|
|
60
|
+
err.__logged__ = true;
|
|
61
|
+
}
|
|
62
|
+
throw err;
|
|
63
|
+
}
|
|
51
64
|
}
|
|
52
|
-
return { ok
|
|
65
|
+
return { ok, step: ctx.step, active: true, errs: [], runlog: [] };
|
|
53
66
|
};
|
|
54
67
|
exports.local_builder = local_builder;
|
|
55
68
|
//# sourceMappingURL=local.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/builder/local.ts"],"names":[],"mappings":";;;;;;AACA,gDAAuB;AAKvB,uCAAuC;AACvC,MAAM,aAAa,GAAY,KAAK,EAAE,KAAY,EAAE,GAAiB,EAAE,EAAE;IACvE,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IACzC,IAAI,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAA;IAE3C,IAAI,IAAI,IAAI,UAAU,EAAE,CAAC;QACvB,
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/builder/local.ts"],"names":[],"mappings":";;;;;;AACA,gDAAuB;AAKvB,uCAAuC;AACvC,MAAM,aAAa,GAAY,KAAK,EAAE,KAAY,EAAE,GAAiB,EAAE,EAAE;IACvE,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IACzC,IAAI,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAA;IAE3C,IAAI,IAAI,IAAI,UAAU,EAAE,CAAC;QACvB,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,CAAA;QAE5C,+CAA+C;QAC/C,IAAI,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QAE/C,6BAA6B;QAC7B,IAAI,iBAAiB,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAA;QACnD,IAAI,WAAW,GAAG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F,IAAI,EAAE,GAAG,IAAI,CAAA;IACb,IAAI,OAAO,GAAG,EAAE,CAAA;IAEhB,KAAK,IAAI,SAAS,IAAI,aAAa,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,IAAI,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;YAC1D,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACtC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAElB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAEzB,IAAI,CAAC,EAAE,EAAE,CAAC;gBAAC,MAAK;YAAC,CAAC;QACpB,CAAC;QACD,OAAO,GAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;gBACpB,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;oBACd,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS;oBAC9D,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,GAAG;iBACJ,CAAC,CAAA;gBACF,GAAG,CAAC,UAAU,GAAG,IAAI,CAAA;YACvB,CAAC;YACD,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;AACnE,CAAC,CAAA;AAIC,sCAAa"}
|
package/dist/builder/model.js
CHANGED
|
@@ -9,27 +9,22 @@ const promises_1 = require("fs/promises");
|
|
|
9
9
|
// Builds the main model file, after unification.
|
|
10
10
|
const model_builder = async (build, ctx) => {
|
|
11
11
|
if ('post' !== ctx.step) {
|
|
12
|
-
return { ok: true, step: ctx.step, active: false };
|
|
12
|
+
return { ok: true, step: ctx.step, active: false, errs: [], runlog: [] };
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
filename = filenameparts[1];
|
|
20
|
-
}
|
|
21
|
-
let file = build.opts.base + '/' + filename + '.json';
|
|
22
|
-
build.log.info({
|
|
23
|
-
point: 'write-model',
|
|
24
|
-
path: file,
|
|
25
|
-
note: file.replace(process.cwd(), '.')
|
|
26
|
-
});
|
|
27
|
-
await (0, promises_1.writeFile)(file, json);
|
|
28
|
-
return { ok: true, step: ctx.step, active: true };
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
throw e;
|
|
14
|
+
let json = JSON.stringify(build.model, null, 2);
|
|
15
|
+
let filename = path_1.default.basename(build.path);
|
|
16
|
+
let filenameparts = filename.match(/^(.*)\.[^.]+$/);
|
|
17
|
+
if (filenameparts) {
|
|
18
|
+
filename = filenameparts[1];
|
|
32
19
|
}
|
|
20
|
+
let file = build.opts.base + '/' + filename + '.json';
|
|
21
|
+
build.log.info({
|
|
22
|
+
point: 'write-model',
|
|
23
|
+
path: file,
|
|
24
|
+
note: file.replace(process.cwd(), '.')
|
|
25
|
+
});
|
|
26
|
+
await (0, promises_1.writeFile)(file, json);
|
|
27
|
+
return { ok: true, step: ctx.step, active: true, errs: [], runlog: [] };
|
|
33
28
|
};
|
|
34
29
|
exports.model_builder = model_builder;
|
|
35
30
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/builder/model.ts"],"names":[],"mappings":";;;;;;AACA,gDAAuB;AAEvB,0CAAuC;AAKvC,iDAAiD;AACjD,MAAM,aAAa,GAAY,KAAK,EAAE,KAAY,EAAE,GAAiB,EAAE,EAAE;IACvE,IAAI,MAAM,K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IAAI,CAAC,CAAA;IAE3B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;AACzE,CAAC,CAAA;AAGC,sCAAa"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BuildResult, BuildSpec, Log } from './types';
|
|
2
2
|
import { Watch } from './watch';
|
|
3
3
|
declare class Config {
|
|
4
|
-
build:
|
|
4
|
+
build: BuildSpec;
|
|
5
5
|
watch: Watch;
|
|
6
6
|
log: Log;
|
|
7
7
|
constructor(spec: BuildSpec, log: Log);
|
|
8
|
-
run(): Promise<BuildResult>;
|
|
8
|
+
run(watch: boolean): Promise<BuildResult>;
|
|
9
9
|
start(): Promise<void>;
|
|
10
10
|
stop(): Promise<void>;
|
|
11
11
|
}
|
package/dist/config.js
CHANGED
|
@@ -7,7 +7,6 @@ class Config {
|
|
|
7
7
|
constructor(spec, log) {
|
|
8
8
|
this.log = log;
|
|
9
9
|
this.build = {
|
|
10
|
-
src: spec.src,
|
|
11
10
|
path: spec.path,
|
|
12
11
|
base: spec.base,
|
|
13
12
|
res: [
|
|
@@ -15,11 +14,12 @@ class Config {
|
|
|
15
14
|
],
|
|
16
15
|
require: spec.require,
|
|
17
16
|
log: this.log,
|
|
17
|
+
fs: spec.fs
|
|
18
18
|
};
|
|
19
19
|
this.watch = new watch_1.Watch(this.build, this.log);
|
|
20
20
|
}
|
|
21
|
-
async run() {
|
|
22
|
-
return this.watch.run('config',
|
|
21
|
+
async run(watch) {
|
|
22
|
+
return this.watch.run('config', watch, '<config>');
|
|
23
23
|
}
|
|
24
24
|
async start() {
|
|
25
25
|
return this.watch.start();
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAKpD,mCAA+B;AAI/B,MAAM,MAAM;IAKV,YAAY,IAAe,EAAE,GAAQ;QACnC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QAEd,IAAI,CAAC,KAAK,GAAG;YACX,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAKpD,mCAA+B;AAI/B,MAAM,MAAM;IAKV,YAAY,IAAe,EAAE,GAAQ;QACnC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QAEd,IAAI,CAAC,KAAK,GAAG;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE;gBACH,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;aACpB;YACD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAc;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA;IACpD,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IAC3B,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF;AAGQ,wBAAM"}
|
package/dist/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BuildResult, BuildSpec, Log } from './types';
|
|
1
|
+
import type { BuildResult, BuildSpec, ModelSpec, Log } from './types';
|
|
2
2
|
import { Config } from './config';
|
|
3
3
|
import { Watch } from './watch';
|
|
4
4
|
declare class Model {
|
|
@@ -7,7 +7,8 @@ declare class Model {
|
|
|
7
7
|
watch: Watch;
|
|
8
8
|
trigger_model: boolean;
|
|
9
9
|
log: Log;
|
|
10
|
-
|
|
10
|
+
fs: any;
|
|
11
|
+
constructor(mspec: ModelSpec);
|
|
11
12
|
run(): Promise<BuildResult>;
|
|
12
13
|
start(): Promise<void | BuildResult>;
|
|
13
14
|
stop(): Promise<void>;
|
package/dist/model.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.Model = void 0;
|
|
8
|
-
// TODO: remove need for this
|
|
9
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
9
|
const util_1 = require("@voxgig/util");
|
|
11
10
|
const config_1 = require("./config");
|
|
@@ -13,53 +12,54 @@ const watch_1 = require("./watch");
|
|
|
13
12
|
const model_1 = require("./builder/model");
|
|
14
13
|
const local_1 = require("./builder/local");
|
|
15
14
|
class Model {
|
|
16
|
-
constructor(
|
|
15
|
+
constructor(mspec) {
|
|
17
16
|
this.trigger_model = false;
|
|
18
17
|
const self = this;
|
|
19
|
-
|
|
18
|
+
self.fs = mspec.fs || node_fs_1.default;
|
|
19
|
+
const pino = (0, util_1.prettyPino)('model', mspec);
|
|
20
20
|
this.log = pino.child({ cmp: 'model' });
|
|
21
21
|
this.log.info({ point: 'model-init' });
|
|
22
22
|
this.log.debug({
|
|
23
|
-
point: 'model-spec',
|
|
24
|
-
JSON.stringify({ ...
|
|
23
|
+
point: 'model-spec', mspec, note: '\n' +
|
|
24
|
+
JSON.stringify({ ...mspec, src: '<NOT-SHOWN>' }, null, 2)
|
|
25
25
|
.replace(/"/g, '')
|
|
26
26
|
.replaceAll(process.cwd(), '.')
|
|
27
27
|
});
|
|
28
28
|
// Config is a special Watch to handle model config.
|
|
29
|
-
this.config = makeConfig(
|
|
29
|
+
this.config = makeConfig(mspec, this.log, this.fs, {
|
|
30
30
|
path: '/',
|
|
31
31
|
build: async function trigger_model(build, ctx) {
|
|
32
32
|
if ('post' !== ctx.step) {
|
|
33
|
-
return { ok: true };
|
|
33
|
+
return { ok: true, errs: [], runlog: [] };
|
|
34
34
|
}
|
|
35
|
-
let res;
|
|
36
|
-
// console.log('TRIGGER', build.id, self.trigger_model, ctx)
|
|
37
|
-
// console.log(new Error().stack)
|
|
35
|
+
let res = { ok: false, errs: [], runlog: [] };
|
|
38
36
|
if (self.trigger_model) {
|
|
39
37
|
// TODO: better design
|
|
40
38
|
if (self.build.use) {
|
|
41
39
|
self.build.use.config.watch.last.build = build;
|
|
42
40
|
}
|
|
43
|
-
res = self.watch.run('model', true);
|
|
41
|
+
res = await self.watch.run('model', true);
|
|
44
42
|
}
|
|
45
43
|
else {
|
|
46
44
|
self.trigger_model = true;
|
|
47
|
-
res = { ok: true };
|
|
45
|
+
res = { ok: true, errs: [], runlog: [] };
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
if (ctx.watch) {
|
|
48
|
+
const watchmap = build.model?.sys?.model?.watch;
|
|
49
|
+
if (watchmap) {
|
|
50
|
+
Object.keys(watchmap).map((file) => {
|
|
51
|
+
self.watch.add(file);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
54
|
}
|
|
55
55
|
return res;
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
// The actual model.
|
|
59
59
|
this.build = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
path: mspec.path,
|
|
61
|
+
base: mspec.base,
|
|
62
|
+
debug: mspec.debug,
|
|
63
63
|
use: { config: self.config },
|
|
64
64
|
res: [
|
|
65
65
|
{
|
|
@@ -71,20 +71,22 @@ class Model {
|
|
|
71
71
|
build: local_1.local_builder
|
|
72
72
|
}
|
|
73
73
|
],
|
|
74
|
-
require:
|
|
74
|
+
require: mspec.require,
|
|
75
75
|
log: this.log,
|
|
76
|
+
fs: this.fs
|
|
76
77
|
};
|
|
77
78
|
this.watch = new watch_1.Watch(self.build, this.log);
|
|
78
79
|
}
|
|
80
|
+
// Run once.
|
|
79
81
|
async run() {
|
|
80
82
|
this.trigger_model = false;
|
|
81
|
-
const br = await this.config.run();
|
|
82
|
-
return br.ok ? this.watch.run('model',
|
|
83
|
+
const br = await this.config.run(false);
|
|
84
|
+
return br.ok ? this.watch.run('model', false, '<start>') : br;
|
|
83
85
|
}
|
|
86
|
+
// Start watching for file changes. Run once initially.
|
|
84
87
|
async start() {
|
|
85
88
|
this.trigger_model = false;
|
|
86
|
-
const br = await this.config.run();
|
|
87
|
-
// console.log('MODEL CONFIG START', br.ok)
|
|
89
|
+
const br = await this.config.run(true);
|
|
88
90
|
return br.ok ? this.watch.start() : br;
|
|
89
91
|
}
|
|
90
92
|
async stop() {
|
|
@@ -92,16 +94,25 @@ class Model {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
exports.Model = Model;
|
|
95
|
-
function makeConfig(
|
|
96
|
-
let cbase =
|
|
97
|
+
function makeConfig(mspec, log, fs, trigger_model_build) {
|
|
98
|
+
let cbase = mspec.base + '/.model-config';
|
|
97
99
|
let cpath = cbase + '/model-config.jsonic';
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
/*
|
|
101
|
+
try {
|
|
102
|
+
src = Fs.readFileSync(cpath).toString()
|
|
103
|
+
}
|
|
104
|
+
catch (err: any) {
|
|
105
|
+
log.error({
|
|
106
|
+
fail: 'read-file', point: 'model-config', path: cpath, err
|
|
107
|
+
})
|
|
108
|
+
throw err
|
|
109
|
+
}
|
|
110
|
+
*/
|
|
100
111
|
let cspec = {
|
|
101
112
|
name: 'config',
|
|
102
|
-
src: src,
|
|
103
113
|
path: cpath,
|
|
104
114
|
base: cbase,
|
|
115
|
+
debug: mspec.debug,
|
|
105
116
|
res: [
|
|
106
117
|
// Generate full config model and save as a file.
|
|
107
118
|
{
|
|
@@ -111,8 +122,9 @@ function makeConfig(spec, log, trigger_model_build) {
|
|
|
111
122
|
// Trigger main model build.
|
|
112
123
|
trigger_model_build
|
|
113
124
|
],
|
|
114
|
-
require:
|
|
125
|
+
require: mspec.require,
|
|
115
126
|
log,
|
|
127
|
+
fs,
|
|
116
128
|
};
|
|
117
129
|
return new config_1.Config(cspec, log);
|
|
118
130
|
}
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;AAGpD,sDAAwB;AAExB,uCAAyC;AAazC,qCAAiC;AACjC,mCAA+B;AAE/B,2CAA+C;AAC/C,2CAA+C;AAI/C,MAAM,KAAK;IAUT,YAAY,KAAgB;QAL5B,kBAAa,GAAG,KAAK,CAAA;QAMnB,MAAM,IAAI,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,iBAAE,CAAA;QAExB,MAAM,IAAI,GAAG,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAY,CAAC,CAAA;QAE9C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAA;QAEvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAA;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YACb,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI;gBACpC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,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,EAAE,CAAA;IAC/D,CAAC;IAGD,uDAAuD;IACvD,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,aAAa,GAAG,KAAK,CAAA;QAC1B,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACtC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACxC,CAAC;IAGD,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF;AA8CC,sBAAK;AA3CP,SAAS,UAAU,CAAC,KAAgB,EAAE,GAAQ,EAAE,EAAO,EAAE,mBAAgC;IACvF,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,GAAG,gBAAgB,CAAA;IACzC,IAAI,KAAK,GAAG,KAAK,GAAG,sBAAsB,CAAA;IAE1C;;;;;;;;;;MAUE;IAEF,IAAI,KAAK,GAAc;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,EAAE;YAEH,iDAAiD;YACjD;gBACE,IAAI,EAAE,GAAG;gBACT,KAAK,EAAE,qBAAa;aACrB;YAED,4BAA4B;YAC5B,mBAAmB;SACpB;QACD,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG;QACH,EAAE;KACH,CAAA;IAED,OAAO,IAAI,eAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/build.ts","../src/config.ts","../src/model.ts","../src/types.ts","../src/watch.ts","../src/builder/local.ts","../src/builder/model.ts"],"version":"5.
|
|
1
|
+
{"root":["../src/build.ts","../src/config.ts","../src/model.ts","../src/types.ts","../src/watch.ts","../src/builder/local.ts","../src/builder/model.ts"],"version":"5.7.2"}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import Pino from 'pino';
|
|
|
2
2
|
type Log = ReturnType<typeof Pino>;
|
|
3
3
|
interface Build {
|
|
4
4
|
id: string;
|
|
5
|
-
src: string;
|
|
6
5
|
base: string;
|
|
7
6
|
path: string;
|
|
8
7
|
root: any;
|
|
@@ -15,19 +14,20 @@ interface Build {
|
|
|
15
14
|
use: {
|
|
16
15
|
[name: string]: any;
|
|
17
16
|
};
|
|
18
|
-
|
|
17
|
+
errs: any[];
|
|
19
18
|
ctx: BuildContext;
|
|
20
|
-
run: () => Promise<BuildResult>;
|
|
19
|
+
run: (rspec: RunSpec) => Promise<BuildResult>;
|
|
21
20
|
log: Log;
|
|
22
21
|
}
|
|
23
22
|
interface BuildResult {
|
|
24
23
|
ok: boolean;
|
|
25
24
|
builder?: string;
|
|
26
25
|
path?: string;
|
|
27
|
-
build?: Build;
|
|
28
26
|
builders?: BuildResult[];
|
|
29
27
|
step?: string;
|
|
30
|
-
|
|
28
|
+
errs: any[];
|
|
29
|
+
runlog: string[];
|
|
30
|
+
build?: () => Build;
|
|
31
31
|
}
|
|
32
32
|
interface BuildAction {
|
|
33
33
|
path: string;
|
|
@@ -35,11 +35,11 @@ interface BuildAction {
|
|
|
35
35
|
}
|
|
36
36
|
interface BuildContext {
|
|
37
37
|
step: 'pre' | 'post';
|
|
38
|
+
watch: boolean;
|
|
38
39
|
state: Record<string, any>;
|
|
39
40
|
}
|
|
40
41
|
type Builder = (build: Build, ctx: BuildContext) => Promise<BuildResult>;
|
|
41
42
|
interface BuildSpec {
|
|
42
|
-
src: string;
|
|
43
43
|
path?: string;
|
|
44
44
|
base?: string;
|
|
45
45
|
res?: BuildAction[];
|
|
@@ -51,12 +51,17 @@ interface BuildSpec {
|
|
|
51
51
|
idle?: number;
|
|
52
52
|
name?: string;
|
|
53
53
|
debug?: boolean | string;
|
|
54
|
+
fs: any;
|
|
54
55
|
}
|
|
55
56
|
type Run = {
|
|
56
57
|
canon: string;
|
|
57
58
|
path: string;
|
|
58
59
|
start: number;
|
|
59
60
|
end: number;
|
|
61
|
+
result?: BuildResult;
|
|
62
|
+
};
|
|
63
|
+
type RunSpec = {
|
|
64
|
+
watch: boolean;
|
|
60
65
|
};
|
|
61
66
|
type Canon = {
|
|
62
67
|
path: string;
|
|
@@ -67,4 +72,13 @@ type ChangeItem = {
|
|
|
67
72
|
path: string;
|
|
68
73
|
when: number;
|
|
69
74
|
};
|
|
70
|
-
|
|
75
|
+
interface ModelSpec {
|
|
76
|
+
path?: string;
|
|
77
|
+
base?: string;
|
|
78
|
+
require?: any;
|
|
79
|
+
log?: Log;
|
|
80
|
+
idle?: number;
|
|
81
|
+
debug?: boolean | string;
|
|
82
|
+
fs?: any;
|
|
83
|
+
}
|
|
84
|
+
export type { Build, BuildResult, BuildAction, Builder, BuildContext, BuildSpec, Log, Run, Canon, ChangeItem, RunSpec, ModelSpec, };
|
package/dist/watch.d.ts
CHANGED
|
@@ -24,9 +24,8 @@ declare class Watch {
|
|
|
24
24
|
drain(): Promise<void>;
|
|
25
25
|
add(path: string): Promise<void>;
|
|
26
26
|
update(br: BuildResult): Promise<void>;
|
|
27
|
-
run(name: string,
|
|
27
|
+
run(name: string, watch?: boolean, trigger?: string): Promise<BuildResult>;
|
|
28
28
|
stop(): Promise<void>;
|
|
29
|
-
handleErrors(br: BuildResult): void;
|
|
30
29
|
descDeps(deps: Record<string, Record<string, {
|
|
31
30
|
tar: string;
|
|
32
31
|
}>>): string;
|
package/dist/watch.js
CHANGED
|
@@ -9,8 +9,6 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
9
9
|
const build_1 = require("./build");
|
|
10
10
|
const chokidar_1 = require("chokidar");
|
|
11
11
|
const promises_1 = require("fs/promises");
|
|
12
|
-
const print = console.log;
|
|
13
|
-
const warn = console.warn;
|
|
14
12
|
class Watch {
|
|
15
13
|
constructor(wspec, log) {
|
|
16
14
|
this.wspec = wspec;
|
|
@@ -28,7 +26,7 @@ class Watch {
|
|
|
28
26
|
this.lastrun = undefined;
|
|
29
27
|
this.idle = wspec.idle || 111;
|
|
30
28
|
this.fsw.on('change', async (path) => {
|
|
31
|
-
// console.log('CHANGE',
|
|
29
|
+
// console.log('CHANGE:', path)
|
|
32
30
|
this.handleChange(path);
|
|
33
31
|
});
|
|
34
32
|
}
|
|
@@ -41,17 +39,11 @@ class Watch {
|
|
|
41
39
|
// const start = this.startTime
|
|
42
40
|
const now = Date.now();
|
|
43
41
|
const idleDuration = now - this.lastChange.when;
|
|
44
|
-
// Only trigger a build if there was
|
|
45
|
-
const trigger = this.lastChange.when !== this.lastTrigger.when &&
|
|
46
|
-
|
|
47
|
-
// console.log('CHECK-A', {
|
|
48
|
-
// tick: (now - start),
|
|
49
|
-
// idleDuration,
|
|
50
|
-
// trigger,
|
|
51
|
-
// running: this.running,
|
|
52
|
-
// path: this.lastChange.path
|
|
53
|
-
// })
|
|
42
|
+
// Only trigger a build if there was an actual change
|
|
43
|
+
const trigger = this.lastChange.when !== this.lastTrigger.when; // &&
|
|
44
|
+
// this.lastChange.path !== this.lastTrigger.path
|
|
54
45
|
if (trigger) {
|
|
46
|
+
// console.log('TRIGGER', this.idle < idleDuration, this.idle, idleDuration)
|
|
55
47
|
// Only add to build queue if we've been idle.
|
|
56
48
|
// This allows external compilation outputting multiple files to complete fully.
|
|
57
49
|
// IMPORTANT: always trigger a new build if there were changes *inside* a build period
|
|
@@ -60,12 +52,14 @@ class Watch {
|
|
|
60
52
|
this.lastTrigger.when = this.lastChange.when;
|
|
61
53
|
const path = this.lastChange.path;
|
|
62
54
|
const canon = this.canon(path);
|
|
63
|
-
|
|
55
|
+
const entry = {
|
|
64
56
|
canon,
|
|
65
57
|
path,
|
|
66
58
|
start: now,
|
|
67
59
|
end: -1,
|
|
68
|
-
}
|
|
60
|
+
};
|
|
61
|
+
// console.log('RUNQ ENTRY', entry)
|
|
62
|
+
this.runq.push(entry);
|
|
69
63
|
// Defer builds to the event loop to keep idle checking separate.
|
|
70
64
|
setImmediate(this.drain.bind(this));
|
|
71
65
|
}
|
|
@@ -95,14 +89,11 @@ class Watch {
|
|
|
95
89
|
let r;
|
|
96
90
|
// While there are queued runs, run them sequentially
|
|
97
91
|
while (r = this.runq.shift()) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
let br = await this.run(this.name, false, r.canon);
|
|
101
|
-
// console.log('BR', br)
|
|
92
|
+
let br = await this.run(this.name, true, r.canon);
|
|
93
|
+
r.result = br;
|
|
102
94
|
r.end = Date.now();
|
|
103
95
|
this.doneq.push(r);
|
|
104
96
|
this.lastrun = r;
|
|
105
|
-
// console.log('===DRAIN-DONE', this.runq.length, new Date(), r.start, r.canon)
|
|
106
97
|
}
|
|
107
98
|
this.running = false;
|
|
108
99
|
}
|
|
@@ -122,91 +113,90 @@ class Watch {
|
|
|
122
113
|
};
|
|
123
114
|
this.canons.push(canon);
|
|
124
115
|
this.fsw.add(path);
|
|
125
|
-
// console.log('ADD', canon)
|
|
126
116
|
}
|
|
127
117
|
async update(br) {
|
|
128
|
-
let build = br.build;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
118
|
+
let build = br.build ? br.build() : undefined;
|
|
119
|
+
// console.log('UPDATE BR BUILD', build)
|
|
120
|
+
if (build?.root?.deps) {
|
|
121
|
+
let files = Object.keys(build.root.deps).reduce((files, target) => {
|
|
122
|
+
files = files.concat(Object.keys(build.root.deps[target]));
|
|
123
|
+
return files;
|
|
124
|
+
}, [build.path]);
|
|
125
|
+
// console.log('DEPS', files)
|
|
126
|
+
// TODO: remove deleted files
|
|
127
|
+
files.forEach(async (file) => {
|
|
128
|
+
if ('string' === typeof (file) &&
|
|
129
|
+
'' !== file &&
|
|
130
|
+
build.opts.base !== file) {
|
|
131
|
+
await this.add(file);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
141
135
|
}
|
|
142
|
-
async run(name,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
note: 'watch:' + name + ' last:' + new Date(this.lastChangeTime).toISOString()
|
|
150
|
-
});
|
|
151
|
-
this.log.info({
|
|
152
|
-
point: 'build-trigger', trigger,
|
|
153
|
-
note: 'watch:' + name + ' trigger:' + ('' + trigger).replace(process.cwd() + '/', '')
|
|
154
|
-
});
|
|
155
|
-
// TODO: build spec should not have src!
|
|
156
|
-
let src = (await (0, promises_1.readFile)(this.wspec.path)).toString();
|
|
157
|
-
this.wspec.src = src;
|
|
158
|
-
this.build = this.build || (0, build_1.makeBuild)(this.wspec, this.log);
|
|
159
|
-
// TODO: better way to do this?
|
|
160
|
-
this.build.src = src;
|
|
161
|
-
let br = await this.build.run();
|
|
162
|
-
// print('\nFILES:\n' + this.descDeps((br as any).build.root.deps) + '\n')
|
|
163
|
-
const deps = this.descDeps(br.build.root.deps);
|
|
164
|
-
this.log.debug({
|
|
165
|
-
point: 'deps', deps,
|
|
166
|
-
note: 'watch:' + name + ' deps:\n' + deps
|
|
167
|
-
});
|
|
168
|
-
if (br.ok) {
|
|
169
|
-
const rootkeys = Object.keys(br?.build?.model).join(';');
|
|
136
|
+
async run(name, watch, trigger) {
|
|
137
|
+
try {
|
|
138
|
+
this.lastChangeTime = Date.now();
|
|
139
|
+
this.log.info({
|
|
140
|
+
point: 'build-start', last: this.lastChangeTime, watch: name,
|
|
141
|
+
note: 'watch:' + name + ' last:' + new Date(this.lastChangeTime).toISOString()
|
|
142
|
+
});
|
|
170
143
|
this.log.info({
|
|
171
|
-
point: '
|
|
172
|
-
note: 'watch:' + name + '
|
|
144
|
+
point: 'build-trigger', trigger,
|
|
145
|
+
note: 'watch:' + name + ' trigger:' + ('' + trigger).replace(process.cwd() + '/', '')
|
|
173
146
|
});
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
147
|
+
this.build = this.build || (0, build_1.makeBuild)(this.wspec, this.log);
|
|
148
|
+
let rspec = { watch: true === watch };
|
|
149
|
+
let br = await this.build.run(rspec);
|
|
150
|
+
if (br.ok) {
|
|
151
|
+
const deps = this.descDeps(br.build ? br.build().root?.deps : undefined);
|
|
152
|
+
this.log.debug({
|
|
153
|
+
point: 'deps', deps,
|
|
154
|
+
note: 'watch:' + name + ' deps:\n' + deps
|
|
155
|
+
});
|
|
156
|
+
const rootkeys = Object.keys(this.build.model).join(';');
|
|
157
|
+
this.log.info({
|
|
158
|
+
point: 'root-keys', keys: rootkeys,
|
|
159
|
+
note: 'watch:' + name + ' keys: ' + rootkeys
|
|
160
|
+
});
|
|
161
|
+
if (watch) {
|
|
162
|
+
// There may be new files.
|
|
163
|
+
await this.update(br);
|
|
164
|
+
}
|
|
165
|
+
this.log.info({
|
|
166
|
+
point: 'build-end', watch: name,
|
|
167
|
+
note: 'watch:' + name + '\n',
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
let errs = br.errs || [new Error('Unknown build error')];
|
|
172
|
+
errs.filter(err => !err.__logged__).map((err) => {
|
|
173
|
+
this.log.error({
|
|
174
|
+
fail: 'build', point: 'run-build', build: this, err
|
|
175
|
+
});
|
|
176
|
+
err.__logged__ = true;
|
|
177
|
+
});
|
|
178
178
|
}
|
|
179
|
+
this.last = br;
|
|
180
|
+
return br;
|
|
179
181
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
catch (err) {
|
|
183
|
+
if (!err.__logged__) {
|
|
184
|
+
this.log.error({
|
|
185
|
+
fail: 'build', point: 'run-build', build: this, err
|
|
186
|
+
});
|
|
187
|
+
err.__logged__ = true;
|
|
188
|
+
}
|
|
189
|
+
let br = {
|
|
190
|
+
ok: false,
|
|
191
|
+
errs: [err],
|
|
192
|
+
runlog: []
|
|
193
|
+
};
|
|
194
|
+
return br;
|
|
183
195
|
}
|
|
184
|
-
this.last = br;
|
|
185
|
-
this.log.info({
|
|
186
|
-
point: 'build-end', watch: name,
|
|
187
|
-
note: 'watch:' + name + '\n',
|
|
188
|
-
});
|
|
189
|
-
return br;
|
|
190
196
|
}
|
|
191
197
|
async stop() {
|
|
192
198
|
await this.fsw.close();
|
|
193
199
|
}
|
|
194
|
-
handleErrors(br) {
|
|
195
|
-
if (br.err) {
|
|
196
|
-
for (let be of br.err) {
|
|
197
|
-
// TODO: print stack if not a model error
|
|
198
|
-
if (be.isVal && be.msg) {
|
|
199
|
-
warn(be.msg);
|
|
200
|
-
}
|
|
201
|
-
// else if (be.message) {
|
|
202
|
-
// warn(be.message)
|
|
203
|
-
// }
|
|
204
|
-
else {
|
|
205
|
-
warn(be);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
200
|
descDeps(deps) {
|
|
211
201
|
if (null == deps) {
|
|
212
202
|
return '';
|
package/dist/watch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;AAEpD,0DAA4B;
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;AAEpD,0DAA4B;AAc5B,mCAAmC;AACnC,uCAAoC;AAEpC,0CAAkC;AAIlC,MAAM,KAAK;IAkBT,YAAY,KAAgB,EAAE,GAAQ;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QAEd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,CAAA;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAS,EAAE,CAAA;QAC1B,IAAI,CAAC,cAAc,GAAG,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|
|
6
6
|
"types": "dist/model.d.ts",
|
|
@@ -44,16 +44,17 @@
|
|
|
44
44
|
"LICENSE"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"aontu": "0.25.
|
|
48
|
-
"chokidar": "4.0.
|
|
49
|
-
"gubu": "^
|
|
47
|
+
"aontu": "0.25.3",
|
|
48
|
+
"chokidar": "4.0.3",
|
|
49
|
+
"gubu": "^9.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@voxgig/util": ">=0"
|
|
52
|
+
"@voxgig/util": ">=0",
|
|
53
|
+
"pino": ">=9"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"
|
|
56
|
+
"@hapi/code": "^9.0.3",
|
|
57
|
+
"@types/node": "22.10.2",
|
|
58
|
+
"typescript": "^5.7.2"
|
|
58
59
|
}
|
|
59
60
|
}
|