@travetto/scaffold 5.0.8 → 5.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/scaffold",
3
- "version": "5.0.8",
3
+ "version": "5.0.10",
4
4
  "description": "App Scaffold for the Travetto framework",
5
5
  "keywords": [
6
6
  "generator",
@@ -12,8 +12,7 @@
12
12
  "resources/application.yml": {},
13
13
  "src/model/todo.ts": {
14
14
  "requires": [
15
- "@travetto/model",
16
- "@travetto/model-memory"
15
+ "@travetto/model"
17
16
  ]
18
17
  },
19
18
  "src/rest/todo.ts": {
@@ -31,6 +30,7 @@
31
30
  "src/rest/auth.config.ts": {
32
31
  "requires": [
33
32
  "@travetto/rest",
33
+ "@travetto/model-memory",
34
34
  "@travetto/auth-rest"
35
35
  ]
36
36
  },
@@ -139,6 +139,7 @@ export class Context {
139
139
  .replaceAll('_$', '}}}'),
140
140
  this.templateContext(),
141
141
  )
142
+ .replace(/^[ ]*[/][/][ ]*\n/gsm, '')
142
143
  .replace(/[ ]*[/][/][ ]*@ts-expect-error[^\n]*\n/gsm, '') // Excluding errors
143
144
  .replace(/^[ ]*[/][/][ ]*[{][{][^\n]*\n/gsm, '') // Excluding conditional comments, full-line
144
145
  .replace(/[ ]*[/][/][ ]*[{][{][^\n]*/gsm, ''); // Excluding conditional comments
@@ -154,14 +155,17 @@ export class Context {
154
155
 
155
156
  async resolveFeature(feat: Feature): Promise<void> {
156
157
  if (feat.package) {
157
- if (feat.package.startsWith('@travetto')) {
158
- if (DEV_DEPS.has(feat.package)) {
159
- this.#devDependencies.push(feat.package);
158
+ const pkgs = Array.isArray(feat.package) ? feat.package : [feat.package];
159
+ for (const pkg of pkgs) {
160
+ if (pkg.startsWith('@travetto')) {
161
+ if (DEV_DEPS.has(pkg)) {
162
+ this.#devDependencies.push(pkg);
163
+ } else {
164
+ this.#dependencies.push(pkg);
165
+ }
160
166
  } else {
161
- this.#dependencies.push(feat.package);
167
+ this.#peerDependencies.push(pkg);
162
168
  }
163
- } else {
164
- this.#peerDependencies.push(feat.package);
165
169
  }
166
170
  }
167
171
  if (feat.field) {
@@ -1,6 +1,6 @@
1
1
  export type Feature = {
2
2
  title?: string;
3
- package?: string;
3
+ package?: string | string[];
4
4
  field?: string;
5
5
  value?: string;
6
6
  required?: boolean;
@@ -45,8 +45,8 @@ export const FEATURES: Feature[] = [
45
45
  title: 'Rest Authentication',
46
46
  package: '@travetto/auth-rest',
47
47
  addons: [
48
- { title: 'Rest Session', package: '@travetto/rest-session' },
49
- { title: 'Auth Rest Session', package: '@travetto/auth-rest-session' },
48
+ { title: 'Rest Session', package: ['@travetto/rest-session', '@travetto/model-memory'] },
49
+ { title: 'Auth Rest Session', package: ['@travetto/auth-rest-session', '@travetto/model-memory'] },
50
50
  ]
51
51
  },
52
52
  {