@travetto/scaffold 5.0.0-rc.1 → 5.0.0-rc.11
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/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/scaffold",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.11",
|
|
4
4
|
"description": "App Scaffold for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generator",
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
"trv-scaffold": "./bin/trv-scaffold.js"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/
|
|
31
|
-
"@travetto/
|
|
30
|
+
"@travetto/cli": "^5.0.0-rc.11",
|
|
31
|
+
"@travetto/runtime": "^5.0.0-rc.10",
|
|
32
32
|
"enquirer": "^2.4.1",
|
|
33
33
|
"mustache": "^4.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
+
"@travetto/model": "^5.0.0-rc.11",
|
|
36
37
|
"@types/mustache": "^4.2.5"
|
|
37
38
|
},
|
|
38
39
|
"travetto": {
|
|
@@ -5,7 +5,7 @@ export class Todo implements ModelType {
|
|
|
5
5
|
id: string;
|
|
6
6
|
text: string;
|
|
7
7
|
completed?: boolean;
|
|
8
|
-
// {{#modules.auth_rest}}
|
|
9
|
-
userId?: string;
|
|
10
|
-
// {{/modules.auth_rest}}
|
|
8
|
+
// {{#modules.auth_rest}}
|
|
9
|
+
userId?: string;
|
|
10
|
+
// {{/modules.auth_rest}}
|
|
11
11
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Authorizer, Authenticator } from '@travetto/auth';
|
|
2
2
|
import { SessionModelⲐ } from '@travetto/rest-session';
|
|
3
3
|
import { InjectableFactory } from '@travetto/di';
|
|
4
|
-
import { AppError } from '@travetto/
|
|
5
|
-
import { ModelExpirySupport
|
|
4
|
+
import { AppError } from '@travetto/runtime';
|
|
5
|
+
import { ModelExpirySupport } from '@travetto/model';
|
|
6
|
+
import { MemoryModelService } from '@travetto/model-memory';
|
|
6
7
|
|
|
7
8
|
export const BasicAuthⲐ = Symbol.for('AUTH_BASIC');
|
|
8
9
|
|
package/support/bin/context.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
-
import rl from 'node:readline/promises';
|
|
4
3
|
import path from 'node:path';
|
|
5
4
|
|
|
6
5
|
import mustache from 'mustache';
|
|
7
6
|
|
|
8
|
-
import { ExecUtil,
|
|
7
|
+
import { castKey, castTo, ExecUtil, RuntimeIndex } from '@travetto/runtime';
|
|
9
8
|
import { cliTpl } from '@travetto/cli';
|
|
10
|
-
import {
|
|
9
|
+
import { NodePackageManager, PackageUtil } from '@travetto/manifest';
|
|
11
10
|
import { Terminal } from '@travetto/terminal';
|
|
12
11
|
|
|
13
12
|
import { Feature } from './features';
|
|
@@ -64,7 +63,7 @@ export class Context {
|
|
|
64
63
|
});
|
|
65
64
|
|
|
66
65
|
if (proc.stderr) {
|
|
67
|
-
|
|
66
|
+
ExecUtil.readLines(proc.stderr,
|
|
68
67
|
line => term.writer.writeLine(cliTpl` ${{ identifier: [cmd, ...args].join(' ') }}: ${line.trimEnd()}`).commit());
|
|
69
68
|
}
|
|
70
69
|
|
|
@@ -140,10 +139,9 @@ export class Context {
|
|
|
140
139
|
.replaceAll('_$', '}}}'),
|
|
141
140
|
this.templateContext(),
|
|
142
141
|
)
|
|
143
|
-
.replace(
|
|
144
|
-
.replace(/
|
|
145
|
-
.replace(
|
|
146
|
-
.replace(/^\s*(\/\/\s*)\n/gsm, '');
|
|
142
|
+
.replace(/[ ]*[/][/][ ]*@ts-expect-error[^\n]*\n/gsm, '') // Excluding errors
|
|
143
|
+
.replace(/^[ ]*[/][/][ ]*[{][{][^\n]*\n/gsm, '') // Excluding conditional comments, full-line
|
|
144
|
+
.replace(/[ ]*[/][/][ ]*[{][{][^\n]*/gsm, ''); // Excluding conditional comments
|
|
147
145
|
await fs.mkdir(path.dirname(out), { recursive: true });
|
|
148
146
|
await fs.writeFile(out, rendered, 'utf8');
|
|
149
147
|
}
|
|
@@ -167,8 +165,7 @@ export class Context {
|
|
|
167
165
|
}
|
|
168
166
|
}
|
|
169
167
|
if (feat.field) {
|
|
170
|
-
|
|
171
|
-
this[feat.field] = feat.value!;
|
|
168
|
+
this[castKey(feat.field)] = castTo(feat.value);
|
|
172
169
|
}
|
|
173
170
|
if (feat.context) {
|
|
174
171
|
this.#featureContexts.push(feat.context);
|