@feathersjs/generators 5.0.13 → 5.0.15
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/CHANGELOG.md +12 -0
- package/lib/app/index.d.ts +19 -27
- package/lib/app/index.js +25 -30
- package/lib/app/index.js.map +1 -1
- package/lib/app/index.ts +17 -8
- package/lib/app/templates/app.test.tpl.d.ts +5 -2
- package/lib/app/templates/app.test.tpl.js +3 -7
- package/lib/app/templates/app.test.tpl.js.map +1 -1
- package/lib/app/templates/app.test.tpl.ts +4 -4
- package/lib/app/templates/app.tpl.d.ts +1 -1
- package/lib/app/templates/app.tpl.js +3 -7
- package/lib/app/templates/app.tpl.js.map +1 -1
- package/lib/app/templates/app.tpl.ts +4 -4
- package/lib/app/templates/channels.tpl.d.ts +1 -1
- package/lib/app/templates/channels.tpl.js +3 -7
- package/lib/app/templates/channels.tpl.js.map +1 -1
- package/lib/app/templates/channels.tpl.ts +4 -4
- package/lib/app/templates/client.test.tpl.d.ts +1 -1
- package/lib/app/templates/client.test.tpl.js +3 -7
- package/lib/app/templates/client.test.tpl.js.map +1 -1
- package/lib/app/templates/client.test.tpl.ts +4 -4
- package/lib/app/templates/client.tpl.d.ts +1 -1
- package/lib/app/templates/client.tpl.js +3 -7
- package/lib/app/templates/client.tpl.js.map +1 -1
- package/lib/app/templates/client.tpl.ts +4 -4
- package/lib/app/templates/configuration.tpl.d.ts +1 -1
- package/lib/app/templates/configuration.tpl.js +7 -11
- package/lib/app/templates/configuration.tpl.js.map +1 -1
- package/lib/app/templates/configuration.tpl.ts +4 -4
- package/lib/app/templates/declarations.tpl.d.ts +1 -1
- package/lib/app/templates/declarations.tpl.js +2 -6
- package/lib/app/templates/declarations.tpl.js.map +1 -1
- package/lib/app/templates/declarations.tpl.ts +3 -3
- package/lib/app/templates/index.html.tpl.d.ts +5 -2
- package/lib/app/templates/index.html.tpl.js +2 -6
- package/lib/app/templates/index.html.tpl.js.map +1 -1
- package/lib/app/templates/index.html.tpl.ts +3 -3
- package/lib/app/templates/index.tpl.d.ts +1 -1
- package/lib/app/templates/index.tpl.js +3 -7
- package/lib/app/templates/index.tpl.js.map +1 -1
- package/lib/app/templates/index.tpl.ts +4 -4
- package/lib/app/templates/logger.tpl.d.ts +1 -1
- package/lib/app/templates/logger.tpl.js +6 -10
- package/lib/app/templates/logger.tpl.js.map +1 -1
- package/lib/app/templates/logger.tpl.ts +4 -4
- package/lib/app/templates/package.json.tpl.d.ts +5 -2
- package/lib/app/templates/package.json.tpl.js +2 -6
- package/lib/app/templates/package.json.tpl.js.map +1 -1
- package/lib/app/templates/package.json.tpl.ts +3 -3
- package/lib/app/templates/prettierrc.tpl.d.ts +1 -1
- package/lib/app/templates/prettierrc.tpl.js +5 -9
- package/lib/app/templates/prettierrc.tpl.js.map +1 -1
- package/lib/app/templates/prettierrc.tpl.ts +4 -4
- package/lib/app/templates/readme.md.tpl.d.ts +5 -2
- package/lib/app/templates/readme.md.tpl.js +2 -6
- package/lib/app/templates/readme.md.tpl.js.map +1 -1
- package/lib/app/templates/readme.md.tpl.ts +3 -3
- package/lib/app/templates/services.tpl.d.ts +1 -1
- package/lib/app/templates/services.tpl.js +3 -7
- package/lib/app/templates/services.tpl.js.map +1 -1
- package/lib/app/templates/services.tpl.ts +4 -4
- package/lib/app/templates/tsconfig.json.tpl.d.ts +1 -1
- package/lib/app/templates/tsconfig.json.tpl.js +3 -7
- package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
- package/lib/app/templates/tsconfig.json.tpl.ts +3 -3
- package/lib/app/templates/validators.tpl.d.ts +1 -1
- package/lib/app/templates/validators.tpl.js +3 -7
- package/lib/app/templates/validators.tpl.js.map +1 -1
- package/lib/app/templates/validators.tpl.ts +4 -4
- package/lib/authentication/index.d.ts +10 -10
- package/lib/authentication/index.js +16 -19
- package/lib/authentication/index.js.map +1 -1
- package/lib/authentication/index.ts +65 -56
- package/lib/authentication/templates/authentication.tpl.d.ts +1 -1
- package/lib/authentication/templates/authentication.tpl.js +11 -15
- package/lib/authentication/templates/authentication.tpl.js.map +1 -1
- package/lib/authentication/templates/authentication.tpl.ts +5 -5
- package/lib/authentication/templates/client.test.tpl.d.ts +1 -1
- package/lib/authentication/templates/client.test.tpl.js +7 -11
- package/lib/authentication/templates/client.test.tpl.js.map +1 -1
- package/lib/authentication/templates/client.test.tpl.ts +5 -5
- package/lib/authentication/templates/config.tpl.d.ts +1 -1
- package/lib/authentication/templates/config.tpl.js +8 -15
- package/lib/authentication/templates/config.tpl.js.map +1 -1
- package/lib/authentication/templates/config.tpl.ts +3 -3
- package/lib/authentication/templates/declarations.tpl.d.ts +1 -1
- package/lib/authentication/templates/declarations.tpl.js +5 -9
- package/lib/authentication/templates/declarations.tpl.js.map +1 -1
- package/lib/authentication/templates/declarations.tpl.ts +3 -3
- package/lib/commons.d.ts +10 -2
- package/lib/commons.js +43 -76
- package/lib/commons.js.map +1 -1
- package/lib/commons.ts +22 -4
- package/lib/connection/index.d.ts +1 -1
- package/lib/connection/index.js +24 -30
- package/lib/connection/index.js.map +1 -1
- package/lib/connection/index.ts +10 -4
- package/lib/connection/templates/knex.tpl.d.ts +1 -1
- package/lib/connection/templates/knex.tpl.js +13 -20
- package/lib/connection/templates/knex.tpl.js.map +1 -1
- package/lib/connection/templates/knex.tpl.ts +4 -4
- package/lib/connection/templates/mongodb.tpl.d.ts +1 -1
- package/lib/connection/templates/mongodb.tpl.js +10 -14
- package/lib/connection/templates/mongodb.tpl.js.map +1 -1
- package/lib/connection/templates/mongodb.tpl.ts +4 -4
- package/lib/hook/index.d.ts +6 -6
- package/lib/hook/index.js +13 -17
- package/lib/hook/index.js.map +1 -1
- package/lib/hook/index.ts +7 -3
- package/lib/hook/templates/hook.tpl.d.ts +1 -1
- package/lib/hook/templates/hook.tpl.js +3 -7
- package/lib/hook/templates/hook.tpl.js.map +1 -1
- package/lib/hook/templates/hook.tpl.ts +4 -4
- package/lib/index.d.ts +7 -7
- package/lib/index.js +7 -36
- package/lib/index.js.map +1 -1
- package/lib/index.ts +7 -7
- package/lib/service/index.d.ts +1 -1
- package/lib/service/index.js +27 -31
- package/lib/service/index.js.map +1 -1
- package/lib/service/index.ts +94 -92
- package/lib/service/templates/client.tpl.d.ts +1 -1
- package/lib/service/templates/client.tpl.js +4 -8
- package/lib/service/templates/client.tpl.js.map +1 -1
- package/lib/service/templates/client.tpl.ts +4 -4
- package/lib/service/templates/schema.json.tpl.d.ts +1 -1
- package/lib/service/templates/schema.json.tpl.js +10 -14
- package/lib/service/templates/schema.json.tpl.js.map +1 -1
- package/lib/service/templates/schema.json.tpl.ts +4 -4
- package/lib/service/templates/schema.typebox.tpl.d.ts +1 -1
- package/lib/service/templates/schema.typebox.tpl.js +8 -12
- package/lib/service/templates/schema.typebox.tpl.js.map +1 -1
- package/lib/service/templates/schema.typebox.tpl.ts +4 -4
- package/lib/service/templates/service.tpl.d.ts +1 -1
- package/lib/service/templates/service.tpl.js +9 -14
- package/lib/service/templates/service.tpl.js.map +1 -1
- package/lib/service/templates/service.tpl.ts +4 -4
- package/lib/service/templates/shared.tpl.d.ts +1 -1
- package/lib/service/templates/shared.tpl.js +3 -7
- package/lib/service/templates/shared.tpl.js.map +1 -1
- package/lib/service/templates/shared.tpl.ts +4 -4
- package/lib/service/templates/test.tpl.d.ts +1 -1
- package/lib/service/templates/test.tpl.js +3 -7
- package/lib/service/templates/test.tpl.js.map +1 -1
- package/lib/service/templates/test.tpl.ts +4 -4
- package/lib/service/type/custom.tpl.d.ts +1 -1
- package/lib/service/type/custom.tpl.js +4 -9
- package/lib/service/type/custom.tpl.js.map +1 -1
- package/lib/service/type/custom.tpl.ts +4 -4
- package/lib/service/type/knex.tpl.d.ts +1 -1
- package/lib/service/type/knex.tpl.js +6 -11
- package/lib/service/type/knex.tpl.js.map +1 -1
- package/lib/service/type/knex.tpl.ts +4 -4
- package/lib/service/type/mongodb.tpl.d.ts +1 -1
- package/lib/service/type/mongodb.tpl.js +4 -9
- package/lib/service/type/mongodb.tpl.js.map +1 -1
- package/lib/service/type/mongodb.tpl.ts +4 -4
- package/package.json +31 -30
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **generators:** Move generators and CLI to featherscloud/pinion ([#3386](https://github.com/feathersjs/feathers/issues/3386)) ([eb87c99](https://github.com/feathersjs/feathers/commit/eb87c9922db56c5610e5b808f3ffe033c830e2b2))
|
|
11
|
+
|
|
12
|
+
## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **generators:** Harden mongodb.js to reliably extract database from any connection string ([#3264](https://github.com/feathersjs/feathers/issues/3264)) ([7b0f82c](https://github.com/feathersjs/feathers/commit/7b0f82c631ff5549cdc9a8e0ffcc705d067c2157))
|
|
17
|
+
|
|
6
18
|
## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @feathersjs/generators
|
package/lib/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FeathersBaseContext, FeathersAppInfo } from '../commons';
|
|
1
|
+
import { FeathersBaseContext, FeathersAppInfo } from '../commons.js';
|
|
2
2
|
export interface AppGeneratorData extends FeathersAppInfo {
|
|
3
3
|
/**
|
|
4
4
|
* The application name
|
|
@@ -28,35 +28,27 @@ export type AppGeneratorContext = FeathersBaseContext & AppGeneratorData & {
|
|
|
28
28
|
export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorData>;
|
|
29
29
|
export declare const generate: (ctx: AppGeneratorArguments) => Promise<{
|
|
30
30
|
dependencies: string[];
|
|
31
|
+
devDependencies: any[];
|
|
31
32
|
feathers: FeathersAppInfo;
|
|
32
|
-
pkg: import("../commons").AppPackageJson;
|
|
33
|
+
pkg: import("../commons.js").AppPackageJson & import("@featherscloud/pinion").JSONData;
|
|
33
34
|
lib: string;
|
|
34
35
|
test: string;
|
|
35
36
|
language: "ts" | "js";
|
|
36
|
-
dependencyVersions
|
|
37
|
+
dependencyVersions: import("../commons.js").DependencyVersions & {
|
|
38
|
+
'@feathersjs/cli': any;
|
|
39
|
+
} & {
|
|
40
|
+
'@feathersjs/cli': any;
|
|
41
|
+
};
|
|
37
42
|
cwd: string;
|
|
38
|
-
|
|
39
|
-
pinion: import("@
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* The database connection string
|
|
50
|
-
*/
|
|
51
|
-
connectionString: string;
|
|
52
|
-
/**
|
|
53
|
-
* Generate a client
|
|
54
|
-
*/
|
|
55
|
-
client: boolean;
|
|
56
|
-
database: "mongodb" | "mysql" | "postgresql" | "sqlite" | "mssql" | "other";
|
|
57
|
-
packager: "yarn" | "npm" | "pnpm";
|
|
58
|
-
transports: ("rest" | "websockets")[];
|
|
59
|
-
framework: "koa" | "express";
|
|
60
|
-
schema: false | "typebox" | "json";
|
|
61
|
-
devDependencies: string[];
|
|
43
|
+
argv: string[];
|
|
44
|
+
pinion: import("@featherscloud/pinion").Configuration;
|
|
45
|
+
name?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
connectionString?: string;
|
|
48
|
+
client?: boolean;
|
|
49
|
+
database?: "mongodb" | "mysql" | "postgresql" | "sqlite" | "mssql" | "other";
|
|
50
|
+
packager?: "yarn" | "npm" | "pnpm";
|
|
51
|
+
transports?: ("rest" | "websockets")[];
|
|
52
|
+
framework?: "koa" | "express";
|
|
53
|
+
schema?: false | "typebox" | "json";
|
|
62
54
|
}>;
|
package/lib/app/index.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const commons_1 = require("../commons");
|
|
11
|
-
const connection_1 = require("../connection");
|
|
12
|
-
const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
13
|
-
.then((0, commons_1.initializeBaseContext)())
|
|
1
|
+
import { sep, dirname } from 'path';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { prompt, runGenerators, fromFile, copyFiles, toFile } from '@featherscloud/pinion';
|
|
4
|
+
import { initializeBaseContext, addVersions, install } from '../commons.js';
|
|
5
|
+
import { generate as connectionGenerator, prompts as connectionPrompts } from '../connection/index.js';
|
|
6
|
+
// Set __dirname in es module
|
|
7
|
+
const __dirname = dirname(new URL(import.meta.url).pathname);
|
|
8
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
9
|
+
.then(initializeBaseContext())
|
|
14
10
|
.then((ctx) => ({
|
|
15
11
|
...ctx,
|
|
16
12
|
dependencies: [],
|
|
17
13
|
devDependencies: []
|
|
18
14
|
}))
|
|
19
|
-
.then(
|
|
15
|
+
.then(prompt((ctx) => [
|
|
20
16
|
{
|
|
21
17
|
name: 'language',
|
|
22
18
|
type: 'list',
|
|
@@ -32,7 +28,7 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
32
28
|
type: 'input',
|
|
33
29
|
when: !ctx.name,
|
|
34
30
|
message: 'What is the name of your application?',
|
|
35
|
-
default: ctx.cwd.split(
|
|
31
|
+
default: ctx.cwd.split(sep).pop(),
|
|
36
32
|
validate: (input) => {
|
|
37
33
|
if (ctx.dependencyVersions[input]) {
|
|
38
34
|
return `Application can not have the same name as a dependency`;
|
|
@@ -52,7 +48,7 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
52
48
|
when: !ctx.framework,
|
|
53
49
|
message: 'Which HTTP framework do you want to use?',
|
|
54
50
|
choices: [
|
|
55
|
-
{ value: 'koa', name: `KoaJS ${
|
|
51
|
+
{ value: 'koa', name: `KoaJS ${chalk.grey('(recommended)')}` },
|
|
56
52
|
{ value: 'express', name: 'Express' }
|
|
57
53
|
]
|
|
58
54
|
},
|
|
@@ -82,33 +78,33 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
82
78
|
type: 'confirm',
|
|
83
79
|
when: ctx.client === undefined,
|
|
84
80
|
message: (answers) => `Generate ${answers.language === 'ts' ? 'end-to-end typed ' : ''}client?`,
|
|
85
|
-
suffix:
|
|
81
|
+
suffix: chalk.grey(' Can be used with React, Angular, Vue, React Native, Node.js etc.')
|
|
86
82
|
},
|
|
87
83
|
{
|
|
88
84
|
type: 'list',
|
|
89
85
|
name: 'schema',
|
|
90
86
|
when: !ctx.schema,
|
|
91
87
|
message: 'What is your preferred schema (model) definition format?',
|
|
92
|
-
suffix:
|
|
88
|
+
suffix: chalk.grey(' Schemas allow to type, validate, secure and populate your data and configuration'),
|
|
93
89
|
choices: [
|
|
94
|
-
{ value: 'typebox', name: `TypeBox ${
|
|
90
|
+
{ value: 'typebox', name: `TypeBox ${chalk.grey('(recommended)')}` },
|
|
95
91
|
{ value: 'json', name: 'JSON schema' },
|
|
96
|
-
{ value: false, name: `No schema ${
|
|
92
|
+
{ value: false, name: `No schema ${chalk.grey('(not recommended)')}` }
|
|
97
93
|
]
|
|
98
94
|
},
|
|
99
|
-
...(
|
|
95
|
+
...connectionPrompts(ctx)
|
|
100
96
|
]))
|
|
101
|
-
.then(
|
|
102
|
-
.then(
|
|
103
|
-
.then(
|
|
97
|
+
.then(runGenerators(__dirname, 'templates'))
|
|
98
|
+
.then(copyFiles(fromFile(__dirname, 'static'), toFile('.')))
|
|
99
|
+
.then(initializeBaseContext())
|
|
104
100
|
.then(async (ctx) => {
|
|
105
|
-
const { dependencies } = await (
|
|
101
|
+
const { dependencies } = await connectionGenerator(ctx);
|
|
106
102
|
return {
|
|
107
103
|
...ctx,
|
|
108
104
|
dependencies
|
|
109
105
|
};
|
|
110
106
|
})
|
|
111
|
-
.then(
|
|
107
|
+
.then(install(({ transports, framework, dependencyVersions, dependencies, schema }) => {
|
|
112
108
|
const hasSocketio = transports.includes('websockets');
|
|
113
109
|
dependencies.push('@feathersjs/feathers', '@feathersjs/errors', '@feathersjs/schema', '@feathersjs/configuration', '@feathersjs/transport-commons', '@feathersjs/adapter-commons', '@feathersjs/authentication', '@feathersjs/authentication-client', 'winston');
|
|
114
110
|
if (hasSocketio) {
|
|
@@ -123,14 +119,13 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
123
119
|
if (schema === 'typebox') {
|
|
124
120
|
dependencies.push('@feathersjs/typebox');
|
|
125
121
|
}
|
|
126
|
-
return
|
|
122
|
+
return addVersions(dependencies, dependencyVersions);
|
|
127
123
|
}, false, ({ packager }) => packager))
|
|
128
|
-
.then(
|
|
124
|
+
.then(install(({ language, devDependencies, dependencyVersions }) => {
|
|
129
125
|
devDependencies.push('nodemon', 'axios', 'mocha', 'cross-env', 'prettier', '@feathersjs/cli', '@feathersjs/rest-client');
|
|
130
126
|
if (language === 'ts') {
|
|
131
127
|
devDependencies.push('@types/mocha', '@types/node', 'nodemon', 'ts-node', 'typescript', 'shx');
|
|
132
128
|
}
|
|
133
|
-
return
|
|
129
|
+
return addVersions(devDependencies, dependencyVersions);
|
|
134
130
|
}, true, ({ packager }) => packager));
|
|
135
|
-
exports.generate = generate;
|
|
136
131
|
//# sourceMappingURL=index.js.map
|
package/lib/app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"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AC1B,CAAA;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAA;IAChG,CAAC;IAED,OAAO,WAAW,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAA;AACzD,CAAC,EACD,IAAI,EACJ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAC3B,CACF,CAAA"}
|
package/lib/app/index.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { sep } from 'path'
|
|
1
|
+
import { sep, dirname } from 'path'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { prompt, runGenerators, fromFile, copyFiles, toFile } from '@featherscloud/pinion'
|
|
4
|
+
import {
|
|
5
|
+
FeathersBaseContext,
|
|
6
|
+
FeathersAppInfo,
|
|
7
|
+
initializeBaseContext,
|
|
8
|
+
addVersions,
|
|
9
|
+
install
|
|
10
|
+
} from '../commons.js'
|
|
11
|
+
import { generate as connectionGenerator, prompts as connectionPrompts } from '../connection/index.js'
|
|
12
|
+
|
|
13
|
+
// Set __dirname in es module
|
|
14
|
+
const __dirname = dirname(new URL(import.meta.url).pathname)
|
|
6
15
|
|
|
7
16
|
export interface AppGeneratorData extends FeathersAppInfo {
|
|
8
17
|
/**
|
|
@@ -36,7 +45,7 @@ export type AppGeneratorContext = FeathersBaseContext &
|
|
|
36
45
|
export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorData>
|
|
37
46
|
|
|
38
47
|
export const generate = (ctx: AppGeneratorArguments) =>
|
|
39
|
-
|
|
48
|
+
Promise.resolve(ctx)
|
|
40
49
|
.then(initializeBaseContext())
|
|
41
50
|
.then((ctx) => ({
|
|
42
51
|
...ctx,
|
|
@@ -44,7 +53,7 @@ export const generate = (ctx: AppGeneratorArguments) =>
|
|
|
44
53
|
devDependencies: []
|
|
45
54
|
}))
|
|
46
55
|
.then(
|
|
47
|
-
prompt
|
|
56
|
+
prompt((ctx) => [
|
|
48
57
|
{
|
|
49
58
|
name: 'language',
|
|
50
59
|
type: 'list',
|
|
@@ -142,7 +151,7 @@ export const generate = (ctx: AppGeneratorArguments) =>
|
|
|
142
151
|
}
|
|
143
152
|
})
|
|
144
153
|
.then(
|
|
145
|
-
install
|
|
154
|
+
install(
|
|
146
155
|
({ transports, framework, dependencyVersions, dependencies, schema }) => {
|
|
147
156
|
const hasSocketio = transports.includes('websockets')
|
|
148
157
|
|
|
@@ -181,7 +190,7 @@ export const generate = (ctx: AppGeneratorArguments) =>
|
|
|
181
190
|
)
|
|
182
191
|
)
|
|
183
192
|
.then(
|
|
184
|
-
install
|
|
193
|
+
install(
|
|
185
194
|
({ language, devDependencies, dependencyVersions }) => {
|
|
186
195
|
devDependencies.push(
|
|
187
196
|
'nodemon',
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
2
|
-
export declare const generate: (ctx: AppGeneratorContext) => Promise<
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
|
+
export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../../commons.js").FeathersBaseContext & import("../index.js").AppGeneratorData & {
|
|
3
|
+
dependencies: string[];
|
|
4
|
+
devDependencies: string[];
|
|
5
|
+
}>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
1
|
+
import { toFile } from '@featherscloud/pinion';
|
|
2
|
+
import { renderSource } from '../../commons.js';
|
|
6
3
|
const template = ({ lib }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/app.test.html
|
|
7
4
|
import assert from 'assert'
|
|
8
5
|
import axios from 'axios'
|
|
@@ -44,6 +41,5 @@ describe('Feathers application tests', () => {
|
|
|
44
41
|
})
|
|
45
42
|
})
|
|
46
43
|
`;
|
|
47
|
-
const generate = (ctx) =>
|
|
48
|
-
exports.generate = generate;
|
|
44
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderSource(template, toFile('test', 'app.test')));
|
|
49
45
|
//# sourceMappingURL=app.test.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.test.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/app.test.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.test.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/app.test.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAG/C,MAAM,QAAQ,GAAG,CAAC,EAChB,GAAG,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;0BAIV,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC5B,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AppGeneratorContext } from '../index'
|
|
1
|
+
import { toFile } from '@featherscloud/pinion'
|
|
2
|
+
import { renderSource } from '../../commons.js'
|
|
3
|
+
import { AppGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
const template = ({
|
|
6
6
|
lib
|
|
@@ -47,4 +47,4 @@ describe('Feathers application tests', () => {
|
|
|
47
47
|
`
|
|
48
48
|
|
|
49
49
|
export const generate = (ctx: AppGeneratorContext) =>
|
|
50
|
-
|
|
50
|
+
Promise.resolve(ctx).then(renderSource(template, toFile('test', 'app.test')))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
1
|
+
import { toFile } from '@featherscloud/pinion';
|
|
2
|
+
import { renderSource } from '../../commons.js';
|
|
6
3
|
const tsKoaApp = ({ transports, schema }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/application.html
|
|
7
4
|
import { feathers } from '@feathersjs/feathers'
|
|
8
5
|
import configuration from '@feathersjs/configuration'
|
|
@@ -119,6 +116,5 @@ app.hooks({
|
|
|
119
116
|
export { app }
|
|
120
117
|
`;
|
|
121
118
|
const template = (ctx) => ctx.framework === 'express' ? tsExpressApp(ctx) : tsKoaApp(ctx);
|
|
122
|
-
const generate = (ctx) =>
|
|
123
|
-
exports.generate = generate;
|
|
119
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderSource(template, toFile(({ lib }) => lib, 'app')));
|
|
124
120
|
//# sourceMappingURL=app.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/app.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/app.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA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CAAC,EACN;;EAEE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBnE,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CAC5C,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,YAAY,CACV,QAAQ,EACR,MAAM,CAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,CACrD,CACF,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AppGeneratorContext } from '../index'
|
|
1
|
+
import { toFile } from '@featherscloud/pinion'
|
|
2
|
+
import { renderSource } from '../../commons.js'
|
|
3
|
+
import { AppGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
const tsKoaApp = ({
|
|
6
6
|
transports,
|
|
@@ -133,7 +133,7 @@ const template = (ctx: AppGeneratorContext) =>
|
|
|
133
133
|
ctx.framework === 'express' ? tsExpressApp(ctx) : tsKoaApp(ctx)
|
|
134
134
|
|
|
135
135
|
export const generate = (ctx: AppGeneratorContext) =>
|
|
136
|
-
|
|
136
|
+
Promise.resolve(ctx).then(
|
|
137
137
|
renderSource(
|
|
138
138
|
template,
|
|
139
139
|
toFile<AppGeneratorContext>(({ lib }) => lib, 'app')
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion';
|
|
2
|
+
import { renderSource } from '../../commons.js';
|
|
6
3
|
const template = ({ language }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/channels.html
|
|
7
4
|
import type { RealTimeConnection, Params } from '@feathersjs/feathers'
|
|
8
5
|
import type { AuthenticationResult } from '@feathersjs/authentication'
|
|
@@ -40,6 +37,5 @@ export const channels = (app: Application) => {
|
|
|
40
37
|
})
|
|
41
38
|
}
|
|
42
39
|
`;
|
|
43
|
-
const generate = (ctx) =>
|
|
44
|
-
exports.generate = generate;
|
|
40
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(when(({ transports }) => transports.includes('websockets'), renderSource(template, toFile(({ lib }) => lib, 'channels'))));
|
|
45
41
|
//# sourceMappingURL=channels.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/channels.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channels.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/channels.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAG/C,MAAM,QAAQ,GAAG,CAAC,EAChB,QAAQ,EACY,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;kFAQ8C,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BzF,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CACF,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,EACrD,YAAY,CACV,QAAQ,EACR,MAAM,CAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAC1D,CACF,CACF,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AppGeneratorContext } from '../index'
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion'
|
|
2
|
+
import { renderSource } from '../../commons.js'
|
|
3
|
+
import { AppGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
const template = ({
|
|
6
6
|
language
|
|
@@ -43,7 +43,7 @@ export const channels = (app: Application) => {
|
|
|
43
43
|
`
|
|
44
44
|
|
|
45
45
|
export const generate = (ctx: AppGeneratorContext) =>
|
|
46
|
-
|
|
46
|
+
Promise.resolve(ctx).then(
|
|
47
47
|
when<AppGeneratorContext>(
|
|
48
48
|
({ transports }) => transports.includes('websockets'),
|
|
49
49
|
renderSource(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion';
|
|
2
|
+
import { renderSource } from '../../commons.js';
|
|
6
3
|
const template = ({ lib }) => /* ts */ `import assert from 'assert'
|
|
7
4
|
import axios from 'axios'
|
|
8
5
|
import type { Server } from 'http'
|
|
@@ -22,6 +19,5 @@ describe('client tests', () => {
|
|
|
22
19
|
})
|
|
23
20
|
})
|
|
24
21
|
`;
|
|
25
|
-
const generate = (ctx) =>
|
|
26
|
-
exports.generate = generate;
|
|
22
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(when((ctx) => ctx.client, renderSource(template, toFile('test', 'client.test'))));
|
|
27
23
|
//# sourceMappingURL=client.test.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.test.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/client.test.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.test.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/client.test.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAG/C,MAAM,QAAQ,GAAG,CAAC,EAAE,GAAG,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;0BAGlC,GAAG;mCACM,GAAG;;;;;;;;;;;;;;CAcrC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CAAsB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CACtG,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AppGeneratorContext } from '../index'
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion'
|
|
2
|
+
import { renderSource } from '../../commons.js'
|
|
3
|
+
import { AppGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
const template = ({ lib }: AppGeneratorContext) => /* ts */ `import assert from 'assert'
|
|
6
6
|
import axios from 'axios'
|
|
@@ -23,6 +23,6 @@ describe('client tests', () => {
|
|
|
23
23
|
`
|
|
24
24
|
|
|
25
25
|
export const generate = (ctx: AppGeneratorContext) =>
|
|
26
|
-
|
|
26
|
+
Promise.resolve(ctx).then(
|
|
27
27
|
when<AppGeneratorContext>((ctx) => ctx.client, renderSource(template, toFile('test', 'client.test')))
|
|
28
28
|
)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion';
|
|
2
|
+
import { renderSource } from '../../commons.js';
|
|
6
3
|
const template = ({ name, language }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/client.html
|
|
7
4
|
import { feathers } from '@feathersjs/feathers'
|
|
8
5
|
import type { TransportConnection, Application } from '@feathersjs/feathers'
|
|
@@ -38,6 +35,5 @@ export const createClient = <Configuration = any> (
|
|
|
38
35
|
return client
|
|
39
36
|
}
|
|
40
37
|
`;
|
|
41
|
-
const generate = async (ctx) =>
|
|
42
|
-
exports.generate = generate;
|
|
38
|
+
export const generate = async (ctx) => Promise.resolve(ctx).then(when((ctx) => ctx.client, renderSource(template, toFile(({ lib }) => lib, 'client'))));
|
|
43
39
|
//# sourceMappingURL=client.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/client.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/client.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAG/C,MAAM,QAAQ,GAAG,CAAC,EAChB,IAAI,EACJ,QAAQ,EACY,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;eAerB,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,mBAAmB,IAAI;;;;;;;;;;;;;;;;;;;CAmBrE,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAwB,EAAE,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EACnB,YAAY,CACV,QAAQ,EACR,MAAM,CAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CACxD,CACF,CACF,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AppGeneratorContext } from '../index'
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion'
|
|
2
|
+
import { renderSource } from '../../commons.js'
|
|
3
|
+
import { AppGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
const template = ({
|
|
6
6
|
name,
|
|
@@ -42,7 +42,7 @@ export const createClient = <Configuration = any> (
|
|
|
42
42
|
`
|
|
43
43
|
|
|
44
44
|
export const generate = async (ctx: AppGeneratorContext) =>
|
|
45
|
-
|
|
45
|
+
Promise.resolve(ctx).then(
|
|
46
46
|
when<AppGeneratorContext>(
|
|
47
47
|
(ctx) => ctx.client,
|
|
48
48
|
renderSource(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
1
|
+
import { toFile, when, writeJSON } from '@featherscloud/pinion';
|
|
2
|
+
import { renderSource } from '../../commons.js';
|
|
6
3
|
const defaultConfig = ({}) => ({
|
|
7
4
|
host: 'localhost',
|
|
8
5
|
port: 3030,
|
|
@@ -66,10 +63,9 @@ export type ApplicationConfiguration = Static<typeof configurationSchema>
|
|
|
66
63
|
|
|
67
64
|
export const configurationValidator = getValidator(configurationSchema, dataValidator)
|
|
68
65
|
`;
|
|
69
|
-
const generate = (ctx) =>
|
|
70
|
-
.then(
|
|
71
|
-
.then(
|
|
72
|
-
.then(
|
|
73
|
-
.then(
|
|
74
|
-
exports.generate = generate;
|
|
66
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
67
|
+
.then(writeJSON(defaultConfig, toFile('config', 'default.json')))
|
|
68
|
+
.then(writeJSON(testConfig, toFile('config', 'test.json')))
|
|
69
|
+
.then(writeJSON(customEnvironment, toFile('config', 'custom-environment-variables.json')))
|
|
70
|
+
.then(when((ctx) => ctx.schema !== false, renderSource(async (ctx) => ctx.schema === 'typebox' ? configurationTypeboxTemplate(ctx) : configurationJsonTemplate(ctx), toFile(({ lib }) => lib, 'configuration'))));
|
|
75
71
|
//# sourceMappingURL=configuration.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/configuration.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration.tpl.js","sourceRoot":"","sources":["../../../src/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ACzF,IAAI,CACH,IAAI,CACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,KAAK,EAC7B,YAAY,CACV,KAAK,EAAE,GAAG,EAAE,EAAE,CACZ,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,GAAG,CAAC,EAC/F,MAAM,CAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,CAC/D,CACF,CACF,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AppGeneratorContext } from '../index'
|
|
1
|
+
import { toFile, when, writeJSON } from '@featherscloud/pinion'
|
|
2
|
+
import { renderSource } from '../../commons.js'
|
|
3
|
+
import { AppGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
const defaultConfig = ({}: AppGeneratorContext) => ({
|
|
6
6
|
host: 'localhost',
|
|
@@ -73,7 +73,7 @@ export const configurationValidator = getValidator(configurationSchema, dataVali
|
|
|
73
73
|
`
|
|
74
74
|
|
|
75
75
|
export const generate = (ctx: AppGeneratorContext) =>
|
|
76
|
-
|
|
76
|
+
Promise.resolve(ctx)
|
|
77
77
|
.then(writeJSON(defaultConfig, toFile('config', 'default.json')))
|
|
78
78
|
.then(writeJSON(testConfig, toFile('config', 'test.json')))
|
|
79
79
|
.then(writeJSON(customEnvironment, toFile('config', 'custom-environment-variables.json')))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppGeneratorContext } from '../index';
|
|
1
|
+
import { AppGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
|