@travetto/scaffold 5.0.0-rc.1 → 5.0.0-rc.10

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
@@ -62,6 +62,7 @@ export class Todo implements ModelType {
62
62
  id: string;
63
63
  text: string;
64
64
  completed?: boolean;
65
+ userId?: string;
65
66
  }
66
67
  ```
67
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/scaffold",
3
- "version": "5.0.0-rc.1",
3
+ "version": "5.0.0-rc.10",
4
4
  "description": "App Scaffold for the Travetto framework",
5
5
  "keywords": [
6
6
  "generator",
@@ -27,13 +27,14 @@
27
27
  "trv-scaffold": "./bin/trv-scaffold.js"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/base": "^5.0.0-rc.1",
31
- "@travetto/cli": "^5.0.0-rc.1",
30
+ "@travetto/runtime": "^5.0.0-rc.9",
31
+ "@travetto/cli": "^5.0.0-rc.10",
32
32
  "enquirer": "^2.4.1",
33
33
  "mustache": "^4.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/mustache": "^4.2.5"
36
+ "@types/mustache": "^4.2.5",
37
+ "@travetto/model": "^5.0.0-rc.10"
37
38
  },
38
39
  "travetto": {
39
40
  "displayName": "App Scaffold"
@@ -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}} // @doc-exclude
9
- userId?: string; // @doc-exclude
10
- // {{/modules.auth_rest}} // @doc-exclude
8
+ // {{#modules.auth_rest}}
9
+ userId?: string;
10
+ // {{/modules.auth_rest}}
11
11
  }
@@ -1,7 +1,7 @@
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/base';
4
+ import { AppError } from '@travetto/runtime';
5
5
  import { ModelExpirySupport, MemoryModelService } from '@travetto/model';
6
6
 
7
7
  export const BasicAuthⲐ = Symbol.for('AUTH_BASIC');
@@ -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, Util } from '@travetto/base';
7
+ import { castKey, castTo, ExecUtil, RuntimeIndex } from '@travetto/runtime';
9
8
  import { cliTpl } from '@travetto/cli';
10
- import { RuntimeIndex, NodePackageManager, PackageUtil } from '@travetto/manifest';
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
- Util.consumeAsyncItr(rl.createInterface(proc.stderr),
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(/\/\/\s*@ts-expect-error.*$/gm, '')
144
- .replace(/(\/\/.*@doc-exclude.*)$/gm, '')
145
- .replace(/\s*(\/\/.*@doc-exclude.*)/gm, '')
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
- // @ts-expect-error
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);