@feathersjs/cli 5.0.0-pre.28 → 5.0.0-pre.30
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 +28 -28
- package/bin/feathers +3 -6
- package/lib/app/index.js +34 -11
- package/lib/app/index.js.map +1 -1
- package/lib/app/index.ts +81 -53
- package/lib/app/templates/app.test.tpl.js +1 -1
- package/lib/app/templates/app.test.tpl.js.map +1 -1
- package/lib/app/templates/app.test.tpl.ts +1 -2
- package/lib/app/templates/app.tpl.js +24 -12
- package/lib/app/templates/app.tpl.js.map +1 -1
- package/lib/app/templates/app.tpl.ts +28 -14
- package/lib/app/templates/channels.tpl.js +1 -1
- package/lib/app/templates/channels.tpl.js.map +1 -1
- package/lib/app/templates/channels.tpl.ts +1 -2
- package/lib/app/templates/client.tpl.js +3 -3
- package/lib/app/templates/client.tpl.js.map +1 -1
- package/lib/app/templates/client.tpl.ts +3 -4
- package/lib/app/templates/config.tpl.js +10 -1
- package/lib/app/templates/config.tpl.js.map +1 -1
- package/lib/app/templates/config.tpl.ts +10 -0
- package/lib/app/templates/declarations.tpl.js +3 -3
- package/lib/app/templates/declarations.tpl.js.map +1 -1
- package/lib/app/templates/declarations.tpl.ts +5 -4
- package/lib/app/templates/index.html.tpl.js +12 -52
- package/lib/app/templates/index.html.tpl.js.map +1 -1
- package/lib/app/templates/index.html.tpl.ts +12 -53
- package/lib/app/templates/index.tpl.js +1 -1
- package/lib/app/templates/index.tpl.js.map +1 -1
- package/lib/app/templates/index.tpl.ts +1 -2
- package/lib/app/templates/logger.tpl.js +1 -1
- package/lib/app/templates/logger.tpl.js.map +1 -1
- package/lib/app/templates/logger.tpl.ts +2 -2
- package/lib/app/templates/package.json.tpl.js +4 -3
- package/lib/app/templates/package.json.tpl.js.map +1 -1
- package/lib/app/templates/package.json.tpl.ts +5 -3
- package/lib/app/templates/readme.md.tpl.js +11 -7
- package/lib/app/templates/readme.md.tpl.js.map +1 -1
- package/lib/app/templates/readme.md.tpl.ts +15 -8
- package/lib/app/templates/{configuration.tpl.d.ts → schemas.tpl.d.ts} +0 -0
- package/lib/app/templates/schemas.tpl.js +76 -0
- package/lib/app/templates/schemas.tpl.js.map +1 -0
- package/lib/app/templates/schemas.tpl.ts +90 -0
- package/lib/app/templates/services.tpl.js +1 -1
- package/lib/app/templates/services.tpl.js.map +1 -1
- package/lib/app/templates/services.tpl.ts +1 -2
- package/lib/authentication/index.d.ts +4 -3
- package/lib/authentication/index.js +12 -3
- package/lib/authentication/index.js.map +1 -1
- package/lib/authentication/index.ts +23 -5
- package/lib/authentication/templates/authentication.tpl.js +4 -6
- package/lib/authentication/templates/authentication.tpl.js.map +1 -1
- package/lib/authentication/templates/authentication.tpl.ts +6 -9
- package/lib/authentication/templates/config.tpl.js +10 -6
- package/lib/authentication/templates/config.tpl.js.map +1 -1
- package/lib/authentication/templates/config.tpl.ts +40 -34
- package/lib/authentication/templates/declarations.tpl.js +3 -3
- package/lib/authentication/templates/declarations.tpl.js.map +1 -1
- package/lib/authentication/templates/declarations.tpl.ts +9 -4
- package/lib/authentication/templates/knex.tpl.js +5 -4
- package/lib/authentication/templates/knex.tpl.js.map +1 -1
- package/lib/authentication/templates/knex.tpl.ts +5 -4
- package/lib/authentication/templates/{user.resolver.tpl.d.ts → schema.json.tpl.d.ts} +0 -0
- package/lib/authentication/templates/schema.json.tpl.js +92 -0
- package/lib/authentication/templates/schema.json.tpl.js.map +1 -0
- package/lib/authentication/templates/schema.json.tpl.ts +108 -0
- package/lib/authentication/templates/{user.schema.tpl.d.ts → schema.typebox.tpl.d.ts} +1 -0
- package/lib/authentication/templates/schema.typebox.tpl.js +79 -0
- package/lib/authentication/templates/schema.typebox.tpl.js.map +1 -0
- package/lib/authentication/templates/schema.typebox.tpl.ts +94 -0
- package/lib/authentication/templates/test.tpl.js +2 -2
- package/lib/authentication/templates/test.tpl.js.map +1 -1
- package/lib/authentication/templates/test.tpl.ts +6 -3
- package/lib/cli.d.ts +6 -0
- package/lib/cli.js +75 -0
- package/lib/cli.js.map +1 -0
- package/lib/cli.ts +68 -0
- package/lib/commons.d.ts +14 -1
- package/lib/commons.js +24 -4
- package/lib/commons.js.map +1 -1
- package/lib/commons.ts +29 -1
- package/lib/connection/index.d.ts +5 -3
- package/lib/connection/index.js +5 -3
- package/lib/connection/index.js.map +1 -1
- package/lib/connection/index.ts +19 -5
- package/lib/connection/templates/knex.tpl.js +2 -12
- package/lib/connection/templates/knex.tpl.js.map +1 -1
- package/lib/connection/templates/knex.tpl.ts +6 -20
- package/lib/connection/templates/mongodb.tpl.js +1 -3
- package/lib/connection/templates/mongodb.tpl.js.map +1 -1
- package/lib/connection/templates/mongodb.tpl.ts +1 -12
- package/lib/hook/index.d.ts +1 -1
- package/lib/hook/index.js +3 -0
- package/lib/hook/index.js.map +1 -1
- package/lib/hook/index.ts +3 -1
- package/lib/hook/templates/hook.tpl.js +2 -3
- package/lib/hook/templates/hook.tpl.js.map +1 -1
- package/lib/hook/templates/hook.tpl.ts +5 -3
- package/lib/index.d.ts +2 -16
- package/lib/index.js +16 -24
- package/lib/index.js.map +1 -1
- package/lib/index.ts +2 -28
- package/lib/service/index.d.ts +10 -2
- package/lib/service/index.js +79 -41
- package/lib/service/index.js.map +1 -1
- package/lib/service/index.ts +54 -6
- package/lib/service/templates/client.tpl.js +26 -6
- package/lib/service/templates/client.tpl.js.map +1 -1
- package/lib/service/templates/client.tpl.ts +41 -12
- package/lib/service/templates/{class.tpl.d.ts → schema.json.tpl.d.ts} +0 -0
- package/lib/service/templates/schema.json.tpl.js +73 -0
- package/lib/service/templates/schema.json.tpl.js.map +1 -0
- package/lib/service/templates/schema.json.tpl.ts +85 -0
- package/lib/service/templates/{resolver.tpl.d.ts → schema.typebox.tpl.d.ts} +0 -0
- package/lib/service/templates/schema.typebox.tpl.js +58 -0
- package/lib/service/templates/schema.typebox.tpl.js.map +1 -0
- package/lib/service/templates/schema.typebox.tpl.ts +70 -0
- package/lib/service/templates/service.tpl.d.ts +1 -0
- package/lib/service/templates/service.tpl.js +67 -15
- package/lib/service/templates/service.tpl.js.map +1 -1
- package/lib/service/templates/service.tpl.ts +98 -19
- package/lib/service/templates/test.tpl.js +1 -1
- package/lib/service/templates/test.tpl.js.map +1 -1
- package/lib/service/templates/test.tpl.ts +1 -2
- package/lib/service/type/custom.tpl.d.ts +1 -2
- package/lib/service/type/custom.tpl.js +32 -25
- package/lib/service/type/custom.tpl.js.map +1 -1
- package/lib/service/type/custom.tpl.ts +44 -35
- package/lib/service/type/knex.tpl.d.ts +1 -3
- package/lib/service/type/knex.tpl.js +33 -23
- package/lib/service/type/knex.tpl.js.map +1 -1
- package/lib/service/type/knex.tpl.ts +51 -29
- package/lib/service/type/mongodb.tpl.d.ts +1 -2
- package/lib/service/type/mongodb.tpl.js +30 -20
- package/lib/service/type/mongodb.tpl.js.map +1 -1
- package/lib/service/type/mongodb.tpl.ts +47 -29
- package/package.json +23 -24
- package/lib/app/templates/configuration.tpl.js +0 -39
- package/lib/app/templates/configuration.tpl.js.map +0 -1
- package/lib/app/templates/configuration.tpl.ts +0 -44
- package/lib/authentication/templates/user.resolver.tpl.js +0 -98
- package/lib/authentication/templates/user.resolver.tpl.js.map +0 -1
- package/lib/authentication/templates/user.resolver.tpl.ts +0 -111
- package/lib/authentication/templates/user.schema.tpl.js +0 -79
- package/lib/authentication/templates/user.schema.tpl.js.map +0 -1
- package/lib/authentication/templates/user.schema.tpl.ts +0 -87
- package/lib/service/templates/class.tpl.js +0 -63
- package/lib/service/templates/class.tpl.js.map +0 -1
- package/lib/service/templates/class.tpl.ts +0 -79
- package/lib/service/templates/resolver.tpl.js +0 -73
- package/lib/service/templates/resolver.tpl.js.map +0 -1
- package/lib/service/templates/resolver.tpl.ts +0 -78
- package/lib/service/templates/schema.tpl.d.ts +0 -2
- package/lib/service/templates/schema.tpl.js +0 -75
- package/lib/service/templates/schema.tpl.js.map +0 -1
- package/lib/service/templates/schema.tpl.ts +0 -80
package/lib/cli.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import chalk from 'chalk'
|
|
2
|
+
import { Command } from 'commander'
|
|
3
|
+
import { generator, runGenerator, getContext } from '@feathershq/pinion'
|
|
4
|
+
import { FeathersBaseContext, version } from './commons'
|
|
5
|
+
|
|
6
|
+
export * from 'commander'
|
|
7
|
+
export { chalk }
|
|
8
|
+
|
|
9
|
+
export const commandRunner = (name: string) => async (options: any) => {
|
|
10
|
+
const ctx = getContext<FeathersBaseContext>({
|
|
11
|
+
...options
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
await generator(ctx)
|
|
15
|
+
.then(runGenerator(__dirname, name, 'index'))
|
|
16
|
+
.catch((error) => {
|
|
17
|
+
const { logger } = ctx.pinion
|
|
18
|
+
|
|
19
|
+
logger.error(`Error: ${chalk.white(error.message)}`)
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const program = new Command()
|
|
24
|
+
|
|
25
|
+
program
|
|
26
|
+
.name('feathers')
|
|
27
|
+
.description('The Feathers command line interface 🕊️')
|
|
28
|
+
.version(version)
|
|
29
|
+
.showHelpAfterError()
|
|
30
|
+
|
|
31
|
+
const generate = program.command('generate').alias('g')
|
|
32
|
+
|
|
33
|
+
generate
|
|
34
|
+
.command('app')
|
|
35
|
+
.description('Generate a new application')
|
|
36
|
+
.option('--name <name>', 'The name of the application')
|
|
37
|
+
.action(commandRunner('app'))
|
|
38
|
+
|
|
39
|
+
generate
|
|
40
|
+
.command('service')
|
|
41
|
+
.description('Generate a new service')
|
|
42
|
+
.option('--name <name>', 'The service name')
|
|
43
|
+
.option('--path <path>', 'The path to register the service on')
|
|
44
|
+
.option('--type <type>', 'The service type (knex, mongodb, custom)')
|
|
45
|
+
.action(commandRunner('service'))
|
|
46
|
+
|
|
47
|
+
generate
|
|
48
|
+
.command('hook')
|
|
49
|
+
.description('Generate a hook')
|
|
50
|
+
.option('--name <name>', 'The name of the hook')
|
|
51
|
+
.option('--type <type>', 'The hook type (around or regular)')
|
|
52
|
+
.action(commandRunner('hook'))
|
|
53
|
+
|
|
54
|
+
generate
|
|
55
|
+
.command('connection')
|
|
56
|
+
.description('Add a new database connection')
|
|
57
|
+
.action(commandRunner('connection'))
|
|
58
|
+
|
|
59
|
+
generate
|
|
60
|
+
.command('authentication')
|
|
61
|
+
.description('Add authentication to the application')
|
|
62
|
+
.action(commandRunner('authentication'))
|
|
63
|
+
|
|
64
|
+
generate.description(
|
|
65
|
+
`Run a generator. Currently available: \n ${generate.commands
|
|
66
|
+
.map((cmd) => `${chalk.blue(cmd.name())}: ${cmd.description()} `)
|
|
67
|
+
.join('\n ')}`
|
|
68
|
+
)
|
package/lib/commons.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { PackageJson } from 'type-fest';
|
|
|
2
2
|
import { Callable, PinionContext, Location } from '@feathershq/pinion';
|
|
3
3
|
import * as ts from 'typescript';
|
|
4
4
|
import { Options as PrettierOptions } from 'prettier';
|
|
5
|
+
export declare const version: any;
|
|
5
6
|
export declare type DependencyVersions = {
|
|
6
7
|
[key: string]: string;
|
|
7
8
|
};
|
|
@@ -37,6 +38,10 @@ export declare type FeathersAppInfo = {
|
|
|
37
38
|
* The HTTP framework used
|
|
38
39
|
*/
|
|
39
40
|
framework: 'koa' | 'express';
|
|
41
|
+
/**
|
|
42
|
+
* The main schema definition format
|
|
43
|
+
*/
|
|
44
|
+
schema: 'typebox' | 'json';
|
|
40
45
|
};
|
|
41
46
|
export interface AppPackageJson extends PackageJson {
|
|
42
47
|
feathers?: FeathersAppInfo;
|
|
@@ -86,9 +91,17 @@ export declare const addVersions: (dependencies: string[], versions: DependencyV
|
|
|
86
91
|
export declare const initializeBaseContext: () => <C extends FeathersBaseContext>(ctx: C) => Promise<C & {
|
|
87
92
|
lib: string;
|
|
88
93
|
test: string;
|
|
89
|
-
language: "
|
|
94
|
+
language: "ts" | "js";
|
|
90
95
|
feathers: FeathersAppInfo;
|
|
91
96
|
}>;
|
|
97
|
+
/**
|
|
98
|
+
* Checks if the current context contains a valid generated application. This is necesary for most
|
|
99
|
+
* generators (besides the app generator).
|
|
100
|
+
*
|
|
101
|
+
* @param ctx The context to check against
|
|
102
|
+
* @returns Throws an error or returns the original context
|
|
103
|
+
*/
|
|
104
|
+
export declare const checkPreconditions: () => <T extends FeathersBaseContext>(ctx: T) => Promise<T>;
|
|
92
105
|
/**
|
|
93
106
|
* Returns the transpiled and prettified JavaScript for a TypeScript source code
|
|
94
107
|
*
|
package/lib/commons.js
CHANGED
|
@@ -26,12 +26,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.injectSource = exports.renderSource = exports.prettify = exports.PRETTIERRC = exports.getJavaScript = exports.initializeBaseContext = exports.addVersions = exports.getDatabaseAdapter = void 0;
|
|
29
|
+
exports.injectSource = exports.renderSource = exports.prettify = exports.PRETTIERRC = exports.getJavaScript = exports.checkPreconditions = exports.initializeBaseContext = exports.addVersions = exports.getDatabaseAdapter = exports.version = void 0;
|
|
30
|
+
const fs_1 = __importDefault(require("fs"));
|
|
31
|
+
const path_1 = require("path");
|
|
30
32
|
const promises_1 = require("fs/promises");
|
|
31
33
|
const pinion_1 = require("@feathershq/pinion");
|
|
32
34
|
const ts = __importStar(require("typescript"));
|
|
33
35
|
const prettier_1 = __importDefault(require("prettier"));
|
|
34
|
-
const
|
|
36
|
+
const path_2 = __importDefault(require("path"));
|
|
37
|
+
exports.version = JSON.parse(fs_1.default.readFileSync((0, path_1.join)(__dirname, '..', 'package.json')).toString()).version;
|
|
35
38
|
/**
|
|
36
39
|
* Returns the name of the Feathers database adapter for a supported database type
|
|
37
40
|
*
|
|
@@ -57,10 +60,11 @@ exports.addVersions = addVersions;
|
|
|
57
60
|
*/
|
|
58
61
|
const initializeBaseContext = () => (ctx) => Promise.resolve(ctx)
|
|
59
62
|
.then((0, pinion_1.loadJSON)((0, pinion_1.fromFile)('package.json'), (pkg) => ({ pkg }), {}))
|
|
60
|
-
.then((0, pinion_1.loadJSON)(
|
|
63
|
+
.then((0, pinion_1.loadJSON)(path_2.default.join(__dirname, '..', 'package.json'), (pkg) => ({
|
|
61
64
|
dependencyVersions: {
|
|
62
65
|
...pkg.devDependencies,
|
|
63
|
-
...ctx.dependencyVersions
|
|
66
|
+
...ctx.dependencyVersions,
|
|
67
|
+
'@feathersjs/cli': exports.version
|
|
64
68
|
}
|
|
65
69
|
})))
|
|
66
70
|
.then((ctx) => {
|
|
@@ -74,6 +78,22 @@ const initializeBaseContext = () => (ctx) => Promise.resolve(ctx)
|
|
|
74
78
|
});
|
|
75
79
|
});
|
|
76
80
|
exports.initializeBaseContext = initializeBaseContext;
|
|
81
|
+
/**
|
|
82
|
+
* Checks if the current context contains a valid generated application. This is necesary for most
|
|
83
|
+
* generators (besides the app generator).
|
|
84
|
+
*
|
|
85
|
+
* @param ctx The context to check against
|
|
86
|
+
* @returns Throws an error or returns the original context
|
|
87
|
+
*/
|
|
88
|
+
const checkPreconditions = () => async (ctx) => {
|
|
89
|
+
if (!ctx.feathers) {
|
|
90
|
+
throw new Error(`Can not run generator since the current folder does not appear to be a Feathers application.
|
|
91
|
+
Either your package.json is missing or it does not have \`feathers\` property.
|
|
92
|
+
`);
|
|
93
|
+
}
|
|
94
|
+
return ctx;
|
|
95
|
+
};
|
|
96
|
+
exports.checkPreconditions = checkPreconditions;
|
|
77
97
|
const importRegex = /from '(\..*)'/g;
|
|
78
98
|
const escapeNewLines = (code) => code.replace(/\n\n/g, '\n/* :newline: */');
|
|
79
99
|
const restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, '\n');
|
package/lib/commons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commons.js","sourceRoot":"","sources":["../src/commons.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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Y,gBAatB;AAEH;;;;;;;;GAQG;AACI,MAAM,YAAY,GACvB,CACE,QAA6B,EAC7B,QAAqB,EACrB,MAA2B,EAC3B,SAAS,GAAG,IAAI,EAChB,EAAE,CACJ,KAAK,EAAE,GAAM,EAAE,EAAE;IACf,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IACxB,MAAM,MAAM,GACV,QAAQ,KAAK,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,MAAM,IAAA,oBAAW,EAAY,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;IACxG,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/C,MAAM,QAAQ,GAAG,IAAA,eAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAEnD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAQ,EAAC,MAAM,CAAC,CAAC,CAAA;AAC7C,CAAC,CAAA;AAfU,QAAA,YAAY,gBAetB"}
|
package/lib/commons.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import { join } from 'path'
|
|
1
3
|
import { PackageJson } from 'type-fest'
|
|
2
4
|
import { readFile, writeFile } from 'fs/promises'
|
|
3
5
|
import {
|
|
@@ -14,6 +16,8 @@ import * as ts from 'typescript'
|
|
|
14
16
|
import prettier, { Options as PrettierOptions } from 'prettier'
|
|
15
17
|
import path from 'path'
|
|
16
18
|
|
|
19
|
+
export const { version } = JSON.parse(fs.readFileSync(join(__dirname, '..', 'package.json')).toString())
|
|
20
|
+
|
|
17
21
|
export type DependencyVersions = { [key: string]: string }
|
|
18
22
|
|
|
19
23
|
/**
|
|
@@ -50,6 +54,10 @@ export type FeathersAppInfo = {
|
|
|
50
54
|
* The HTTP framework used
|
|
51
55
|
*/
|
|
52
56
|
framework: 'koa' | 'express'
|
|
57
|
+
/**
|
|
58
|
+
* The main schema definition format
|
|
59
|
+
*/
|
|
60
|
+
schema: 'typebox' | 'json'
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
export interface AppPackageJson extends PackageJson {
|
|
@@ -110,7 +118,8 @@ export const initializeBaseContext =
|
|
|
110
118
|
loadJSON(path.join(__dirname, '..', 'package.json'), (pkg: PackageJson) => ({
|
|
111
119
|
dependencyVersions: {
|
|
112
120
|
...pkg.devDependencies,
|
|
113
|
-
...ctx.dependencyVersions
|
|
121
|
+
...ctx.dependencyVersions,
|
|
122
|
+
'@feathersjs/cli': version
|
|
114
123
|
}
|
|
115
124
|
}))
|
|
116
125
|
)
|
|
@@ -122,6 +131,25 @@ export const initializeBaseContext =
|
|
|
122
131
|
feathers: ctx.pkg?.feathers
|
|
123
132
|
}))
|
|
124
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Checks if the current context contains a valid generated application. This is necesary for most
|
|
136
|
+
* generators (besides the app generator).
|
|
137
|
+
*
|
|
138
|
+
* @param ctx The context to check against
|
|
139
|
+
* @returns Throws an error or returns the original context
|
|
140
|
+
*/
|
|
141
|
+
export const checkPreconditions =
|
|
142
|
+
() =>
|
|
143
|
+
async <T extends FeathersBaseContext>(ctx: T) => {
|
|
144
|
+
if (!ctx.feathers) {
|
|
145
|
+
throw new Error(`Can not run generator since the current folder does not appear to be a Feathers application.
|
|
146
|
+
Either your package.json is missing or it does not have \`feathers\` property.
|
|
147
|
+
`)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return ctx
|
|
151
|
+
}
|
|
152
|
+
|
|
125
153
|
const importRegex = /from '(\..*)'/g
|
|
126
154
|
const escapeNewLines = (code: string) => code.replace(/\n\n/g, '\n/* :newline: */')
|
|
127
155
|
const restoreNewLines = (code: string) => code.replace(/\/\* :newline: \*\//g, '\n')
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FeathersBaseContext, DatabaseType } from '../commons';
|
|
2
2
|
export interface ConnectionGeneratorContext extends FeathersBaseContext {
|
|
3
|
+
name?: string;
|
|
3
4
|
database: DatabaseType;
|
|
4
5
|
connectionString: string;
|
|
5
6
|
dependencies: string[];
|
|
6
7
|
}
|
|
7
|
-
export declare type ConnectionGeneratorArguments = FeathersBaseContext & Partial<Pick<ConnectionGeneratorContext, 'database' | 'connectionString'>>;
|
|
8
|
+
export declare type ConnectionGeneratorArguments = FeathersBaseContext & Partial<Pick<ConnectionGeneratorContext, 'database' | 'connectionString' | 'name'>>;
|
|
8
9
|
export declare const defaultConnectionString: (type: DatabaseType, name: string) => string;
|
|
9
|
-
export declare const prompts: ({ database, connectionString, pkg }: ConnectionGeneratorArguments) => ({
|
|
10
|
+
export declare const prompts: ({ database, connectionString, pkg, name }: ConnectionGeneratorArguments) => ({
|
|
10
11
|
name: string;
|
|
11
12
|
type: string;
|
|
12
13
|
when: boolean;
|
|
@@ -39,13 +40,14 @@ export declare const DATABASE_CLIENTS: {
|
|
|
39
40
|
export declare const getDatabaseClient: (database: DatabaseType) => string;
|
|
40
41
|
export declare const generate: (ctx: ConnectionGeneratorArguments) => Promise<{
|
|
41
42
|
dependencies: string[];
|
|
43
|
+
name?: string;
|
|
42
44
|
database: DatabaseType;
|
|
43
45
|
connectionString: string;
|
|
44
46
|
feathers: import("../commons").FeathersAppInfo;
|
|
45
47
|
pkg: import("../commons").AppPackageJson;
|
|
46
48
|
lib: string;
|
|
47
49
|
test: string;
|
|
48
|
-
language: "
|
|
50
|
+
language: "ts" | "js";
|
|
49
51
|
dependencyVersions?: import("../commons").DependencyVersions;
|
|
50
52
|
cwd: string;
|
|
51
53
|
_?: (string | number)[];
|
package/lib/connection/index.js
CHANGED
|
@@ -18,7 +18,7 @@ const defaultConnectionString = (type, name) => {
|
|
|
18
18
|
return connectionStrings[type];
|
|
19
19
|
};
|
|
20
20
|
exports.defaultConnectionString = defaultConnectionString;
|
|
21
|
-
const prompts = ({ database, connectionString, pkg }) => [
|
|
21
|
+
const prompts = ({ database, connectionString, pkg, name }) => [
|
|
22
22
|
{
|
|
23
23
|
name: 'database',
|
|
24
24
|
type: 'list',
|
|
@@ -38,7 +38,7 @@ const prompts = ({ database, connectionString, pkg }) => [
|
|
|
38
38
|
type: 'input',
|
|
39
39
|
when: !connectionString,
|
|
40
40
|
message: 'Enter your database connection string',
|
|
41
|
-
default: (answers) => (0, exports.defaultConnectionString)(answers.database, answers.name || pkg.name)
|
|
41
|
+
default: (answers) => (0, exports.defaultConnectionString)(answers.database, answers.name || name || pkg.name)
|
|
42
42
|
}
|
|
43
43
|
];
|
|
44
44
|
exports.prompts = prompts;
|
|
@@ -52,6 +52,8 @@ exports.DATABASE_CLIENTS = {
|
|
|
52
52
|
const getDatabaseClient = (database) => exports.DATABASE_CLIENTS[database];
|
|
53
53
|
exports.getDatabaseClient = getDatabaseClient;
|
|
54
54
|
const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
55
|
+
.then((0, commons_1.initializeBaseContext)())
|
|
56
|
+
.then((0, commons_1.checkPreconditions)())
|
|
55
57
|
.then((0, pinion_1.prompt)(exports.prompts))
|
|
56
58
|
.then((0, pinion_1.runGenerator)(__dirname, 'templates', ({ database }) => `${(0, commons_1.getDatabaseAdapter)(database)}.tpl`))
|
|
57
59
|
.then((0, pinion_1.mergeJSON)(({ connectionString, database }) => (0, commons_1.getDatabaseAdapter)(database) === 'knex'
|
|
@@ -80,7 +82,7 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
80
82
|
dependencies: [...ctx.dependencies, ...dependencies]
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
|
-
return (0, pinion_1.install)((0, commons_1.addVersions)(dependencies, ctx.dependencyVersions))(ctx);
|
|
85
|
+
return (0, pinion_1.install)((0, commons_1.addVersions)(dependencies, ctx.dependencyVersions), false, ctx.feathers.packager)(ctx);
|
|
84
86
|
});
|
|
85
87
|
exports.generate = generate;
|
|
86
88
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connection/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAgG;AAChG,kDAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connection/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAgG;AAChG,kDAAyB;AACzB,wCAOmB;AAYZ,MAAM,uBAAuB,GAAG,CAAC,IAAkB,EAAE,IAAY,EAAE,EAAE;IAC1E,MAAM,iBAAiB,GAAG;QACxB,OAAO,EAAE,6BAA6B,IAAI,EAAE;QAC5C,KAAK,EAAE,gCAAgC,IAAI,EAAE;QAC7C,UAAU,EAAE,uCAAuC,IAAI,EAAE;QACzD,MAAM,EAAE,GAAG,IAAI,SAAS;QACxB,KAAK,EAAE,wCAAwC,IAAI,EAAE;KACtD,CAAA;IAED,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC,CAAA;AAVY,QAAA,uBAAuB,2BAUnC;AAEM,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAgC,EAAE,EAAE,CAAC;IAClG;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,CAAC,QAAQ;QACf,OAAO,EAAE,uCAAuC;QAChD,MAAM,EAAE,eAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC;QAC/D,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;YACnC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;YAC3C,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE;YACzC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,eAA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AAQ,CAAC;YACnC,UAAU,EAAE,gBAAgB;YAC5B,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7D;KACF;IACH,CAAC,CAAC;QACE,CAAC,QAAQ,CAAC,EAAE,gBAAgB;KAC7B,EACP,IAAA,eAAM,EAAC,QAAQ,EAAE,cAAc,CAAC,CACjC,CACF;KACA,IAAI,CAAC,CAAC,GAA+B,EAAE,EAAE;IACxC,MAAM,YAAY,GAAa,EAAE,CAAA;IACjC,MAAM,OAAO,GAAG,IAAA,4BAAkB,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAChD,MAAM,QAAQ,GAAG,IAAA,yBAAiB,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAEhD,YAAY,CAAC,IAAI,CAAC,eAAe,OAAO,EAAE,CAAC,CAAA;IAE3C,IAAI,OAAO,KAAK,MAAM,EAAE;QACtB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KAC1B;IAED,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAE3B,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,OAAO;YACL,GAAG,GAAG;YACN,YAAY,EAAE,CAAC,GAAG,GAAG,CAAC,YAAY,EAAE,GAAG,YAAY,CAAC;SACrD,CAAA;KACF;IAED,OAAO,IAAA,gBAAO,EACZ,IAAA,qBAAW,EAAC,YAAY,EAAE,GAAG,CAAC,kBAAkB,CAAC,EACjD,KAAK,EACL,GAAG,CAAC,QAAQ,CAAC,QAAQ,CACtB,CAAC,GAAG,CAAC,CAAA;AACR,CAAC,CAAC,CAAA;AAtDO,QAAA,QAAQ,YAsDf"}
|
package/lib/connection/index.ts
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { generator, runGenerator, prompt, install, mergeJSON, toFile } from '@feathershq/pinion'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
FeathersBaseContext,
|
|
5
|
+
DatabaseType,
|
|
6
|
+
getDatabaseAdapter,
|
|
7
|
+
addVersions,
|
|
8
|
+
checkPreconditions,
|
|
9
|
+
initializeBaseContext
|
|
10
|
+
} from '../commons'
|
|
4
11
|
|
|
5
12
|
export interface ConnectionGeneratorContext extends FeathersBaseContext {
|
|
13
|
+
name?: string
|
|
6
14
|
database: DatabaseType
|
|
7
15
|
connectionString: string
|
|
8
16
|
dependencies: string[]
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
export type ConnectionGeneratorArguments = FeathersBaseContext &
|
|
12
|
-
Partial<Pick<ConnectionGeneratorContext, 'database' | 'connectionString'>>
|
|
20
|
+
Partial<Pick<ConnectionGeneratorContext, 'database' | 'connectionString' | 'name'>>
|
|
13
21
|
|
|
14
22
|
export const defaultConnectionString = (type: DatabaseType, name: string) => {
|
|
15
23
|
const connectionStrings = {
|
|
@@ -23,7 +31,7 @@ export const defaultConnectionString = (type: DatabaseType, name: string) => {
|
|
|
23
31
|
return connectionStrings[type]
|
|
24
32
|
}
|
|
25
33
|
|
|
26
|
-
export const prompts = ({ database, connectionString, pkg }: ConnectionGeneratorArguments) => [
|
|
34
|
+
export const prompts = ({ database, connectionString, pkg, name }: ConnectionGeneratorArguments) => [
|
|
27
35
|
{
|
|
28
36
|
name: 'database',
|
|
29
37
|
type: 'list',
|
|
@@ -44,7 +52,7 @@ export const prompts = ({ database, connectionString, pkg }: ConnectionGenerator
|
|
|
44
52
|
when: !connectionString,
|
|
45
53
|
message: 'Enter your database connection string',
|
|
46
54
|
default: (answers: { name?: string; database: DatabaseType }) =>
|
|
47
|
-
defaultConnectionString(answers.database, answers.name || pkg.name)
|
|
55
|
+
defaultConnectionString(answers.database, answers.name || name || pkg.name)
|
|
48
56
|
}
|
|
49
57
|
]
|
|
50
58
|
|
|
@@ -60,6 +68,8 @@ export const getDatabaseClient = (database: DatabaseType) => DATABASE_CLIENTS[da
|
|
|
60
68
|
|
|
61
69
|
export const generate = (ctx: ConnectionGeneratorArguments) =>
|
|
62
70
|
generator(ctx)
|
|
71
|
+
.then(initializeBaseContext())
|
|
72
|
+
.then(checkPreconditions())
|
|
63
73
|
.then(prompt<ConnectionGeneratorArguments, ConnectionGeneratorContext>(prompts))
|
|
64
74
|
.then(
|
|
65
75
|
runGenerator<ConnectionGeneratorContext>(
|
|
@@ -105,5 +115,9 @@ export const generate = (ctx: ConnectionGeneratorArguments) =>
|
|
|
105
115
|
}
|
|
106
116
|
}
|
|
107
117
|
|
|
108
|
-
return install<ConnectionGeneratorContext>(
|
|
118
|
+
return install<ConnectionGeneratorContext>(
|
|
119
|
+
addVersions(dependencies, ctx.dependencyVersions),
|
|
120
|
+
false,
|
|
121
|
+
ctx.feathers.packager
|
|
122
|
+
)(ctx)
|
|
109
123
|
})
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generate = void 0;
|
|
4
4
|
const pinion_1 = require("@feathershq/pinion");
|
|
5
5
|
const commons_1 = require("../../commons");
|
|
6
|
-
const template = ({ database }) => `import knex from 'knex'
|
|
6
|
+
const template = ({ database }) => /* ts */ `import knex from 'knex'
|
|
7
7
|
import type { Knex } from 'knex'
|
|
8
8
|
import type { Application } from './declarations'
|
|
9
9
|
|
|
@@ -20,25 +20,16 @@ export const ${database} = (app: Application) => {
|
|
|
20
20
|
app.set('${database}Client', db)
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
|
-
const knexfile = ({ lib, language, database }) => `
|
|
24
|
-
import { app } from './${lib}/app'
|
|
23
|
+
const knexfile = ({ lib, language, database }) => /* ts */ `import { app } from './${lib}/app'
|
|
25
24
|
|
|
26
25
|
// Load our database connection info from the app configuration
|
|
27
26
|
const config = app.get('${database}')
|
|
28
27
|
|
|
29
28
|
${language === 'js' ? 'export default config' : 'module.exports = config'}
|
|
30
29
|
`;
|
|
31
|
-
const configurationTemplate = ({ database }) => `${database}: {
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
client: { type: 'string' },
|
|
35
|
-
connection: { type: 'string' }
|
|
36
|
-
}
|
|
37
|
-
},`;
|
|
38
30
|
const importTemplate = ({ database }) => `import { ${database} } from './${database}'`;
|
|
39
31
|
const configureTemplate = ({ database }) => `app.configure(${database})`;
|
|
40
32
|
const toAppFile = (0, pinion_1.toFile)(({ lib }) => [lib, 'app']);
|
|
41
|
-
const toConfig = (0, pinion_1.toFile)(({ lib }) => [lib, 'configuration']);
|
|
42
33
|
const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
43
34
|
.then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib, database }) => [lib, database])))
|
|
44
35
|
.then((0, commons_1.renderSource)(knexfile, (0, pinion_1.toFile)('knexfile')))
|
|
@@ -49,7 +40,6 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
49
40
|
test: 'cross-env NODE_ENV=test npm run migrate && npm run mocha'
|
|
50
41
|
}
|
|
51
42
|
}, (0, pinion_1.toFile)('package.json')))
|
|
52
|
-
.then((0, commons_1.injectSource)(configurationTemplate, (0, pinion_1.before)('authentication: authenticationSettingsSchema'), toConfig, false))
|
|
53
43
|
.then((0, commons_1.injectSource)(importTemplate, (0, pinion_1.before)('import { services } from'), toAppFile))
|
|
54
44
|
.then((0, commons_1.injectSource)(configureTemplate, (0, pinion_1.before)('app.configure(services)'), toAppFile));
|
|
55
45
|
exports.generate = generate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knex.tpl.js","sourceRoot":"","sources":["../../../src/connection/templates/knex.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAyE;AAEzE,2CAA0D;AAE1D,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAA8B,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"knex.tpl.js","sourceRoot":"","sources":["../../../src/connection/templates/knex.tpl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mB;QACnC,IAAI,EAAE,0DAA0D;KACjE;CACF,EACD,IAAA,eAAM,EAAC,cAAc,CAAC,CACvB,CACF;KACA,IAAI,CAAC,IAAA,sBAAY,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAC;KACjF,IAAI,CAAC,IAAA,sBAAY,EAAC,iBAAiB,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAtB3E,QAAA,QAAQ,YAsBmE"}
|
|
@@ -2,8 +2,7 @@ import { generator, toFile, before, mergeJSON } from '@feathershq/pinion'
|
|
|
2
2
|
import { ConnectionGeneratorContext } from '../index'
|
|
3
3
|
import { injectSource, renderSource } from '../../commons'
|
|
4
4
|
|
|
5
|
-
const template = ({ database }: ConnectionGeneratorContext) =>
|
|
6
|
-
`import knex from 'knex'
|
|
5
|
+
const template = ({ database }: ConnectionGeneratorContext) => /* ts */ `import knex from 'knex'
|
|
7
6
|
import type { Knex } from 'knex'
|
|
8
7
|
import type { Application } from './declarations'
|
|
9
8
|
|
|
@@ -21,8 +20,11 @@ export const ${database} = (app: Application) => {
|
|
|
21
20
|
}
|
|
22
21
|
`
|
|
23
22
|
|
|
24
|
-
const knexfile = ({
|
|
25
|
-
|
|
23
|
+
const knexfile = ({
|
|
24
|
+
lib,
|
|
25
|
+
language,
|
|
26
|
+
database
|
|
27
|
+
}: ConnectionGeneratorContext) => /* ts */ `import { app } from './${lib}/app'
|
|
26
28
|
|
|
27
29
|
// Load our database connection info from the app configuration
|
|
28
30
|
const config = app.get('${database}')
|
|
@@ -30,19 +32,11 @@ const config = app.get('${database}')
|
|
|
30
32
|
${language === 'js' ? 'export default config' : 'module.exports = config'}
|
|
31
33
|
`
|
|
32
34
|
|
|
33
|
-
const configurationTemplate = ({ database }: ConnectionGeneratorContext) => `${database}: {
|
|
34
|
-
type: 'object',
|
|
35
|
-
properties: {
|
|
36
|
-
client: { type: 'string' },
|
|
37
|
-
connection: { type: 'string' }
|
|
38
|
-
}
|
|
39
|
-
},`
|
|
40
35
|
const importTemplate = ({ database }: ConnectionGeneratorContext) =>
|
|
41
36
|
`import { ${database} } from './${database}'`
|
|
42
37
|
const configureTemplate = ({ database }: ConnectionGeneratorContext) => `app.configure(${database})`
|
|
43
38
|
|
|
44
39
|
const toAppFile = toFile<ConnectionGeneratorContext>(({ lib }) => [lib, 'app'])
|
|
45
|
-
const toConfig = toFile<ConnectionGeneratorContext>(({ lib }) => [lib, 'configuration'])
|
|
46
40
|
|
|
47
41
|
export const generate = (ctx: ConnectionGeneratorContext) =>
|
|
48
42
|
generator(ctx)
|
|
@@ -65,13 +59,5 @@ export const generate = (ctx: ConnectionGeneratorContext) =>
|
|
|
65
59
|
toFile('package.json')
|
|
66
60
|
)
|
|
67
61
|
)
|
|
68
|
-
.then(
|
|
69
|
-
injectSource(
|
|
70
|
-
configurationTemplate,
|
|
71
|
-
before('authentication: authenticationSettingsSchema'),
|
|
72
|
-
toConfig,
|
|
73
|
-
false
|
|
74
|
-
)
|
|
75
|
-
)
|
|
76
62
|
.then(injectSource(importTemplate, before('import { services } from'), toAppFile))
|
|
77
63
|
.then(injectSource(configureTemplate, before('app.configure(services)'), toAppFile))
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generate = void 0;
|
|
4
4
|
const pinion_1 = require("@feathershq/pinion");
|
|
5
5
|
const commons_1 = require("../../commons");
|
|
6
|
-
const template = ({}) => `import { MongoClient } from 'mongodb'
|
|
6
|
+
const template = ({}) => /* ts */ `import { MongoClient } from 'mongodb'
|
|
7
7
|
import type { Db } from 'mongodb'
|
|
8
8
|
import type { Application } from './declarations'
|
|
9
9
|
|
|
@@ -22,13 +22,11 @@ export const mongodb = (app: Application) => {
|
|
|
22
22
|
app.set('mongodbClient', mongoClient)
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
|
-
const configurationTemplate = ({ database }) => ` ${database}: { type: 'string' },`;
|
|
26
25
|
const importTemplate = "import { mongodb } from './mongodb'";
|
|
27
26
|
const configureTemplate = 'app.configure(mongodb)';
|
|
28
27
|
const toAppFile = (0, pinion_1.toFile)(({ lib }) => [lib, 'app']);
|
|
29
28
|
const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
30
29
|
.then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'mongodb')))
|
|
31
|
-
.then((0, commons_1.injectSource)(configurationTemplate, (0, pinion_1.before)('authentication: authenticationSettingsSchema'), (0, pinion_1.toFile)(({ lib }) => [lib, 'configuration']), false))
|
|
32
30
|
.then((0, commons_1.injectSource)(importTemplate, (0, pinion_1.before)('import { services } from'), toAppFile))
|
|
33
31
|
.then((0, commons_1.injectSource)(configureTemplate, (0, pinion_1.before)('app.configure(services)'), toAppFile));
|
|
34
32
|
exports.generate = generate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongodb.tpl.js","sourceRoot":"","sources":["../../../src/connection/templates/mongodb.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAE9D,2CAA0D;AAE1D,MAAM,QAAQ,GAAG,CAAC,EAA8B,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"mongodb.tpl.js","sourceRoot":"","sources":["../../../src/connection/templates/mongodb.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAE9D,2CAA0D;AAE1D,MAAM,QAAQ,GAAG,CAAC,EAA8B,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;CAkB7D,CAAA;AAED,MAAM,cAAc,GAAG,qCAAqC,CAAA;AAC5D,MAAM,iBAAiB,GAAG,wBAAwB,CAAA;AAClD,MAAM,SAAS,GAAG,IAAA,eAAM,EAA6B,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAExE,MAAM,QAAQ,GAAG,CAAC,GAA+B,EAAE,EAAE,CAC1D,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAA6B,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,CAChE,CACF;KACA,IAAI,CAAC,IAAA,sBAAY,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAC;KACjF,IAAI,CAAC,IAAA,sBAAY,EAAC,iBAAiB,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAT3E,QAAA,QAAQ,YASmE"}
|
|
@@ -2,8 +2,7 @@ import { generator, toFile, before } from '@feathershq/pinion'
|
|
|
2
2
|
import { ConnectionGeneratorContext } from '../index'
|
|
3
3
|
import { injectSource, renderSource } from '../../commons'
|
|
4
4
|
|
|
5
|
-
const template = ({}: ConnectionGeneratorContext) =>
|
|
6
|
-
`import { MongoClient } from 'mongodb'
|
|
5
|
+
const template = ({}: ConnectionGeneratorContext) => /* ts */ `import { MongoClient } from 'mongodb'
|
|
7
6
|
import type { Db } from 'mongodb'
|
|
8
7
|
import type { Application } from './declarations'
|
|
9
8
|
|
|
@@ -23,8 +22,6 @@ export const mongodb = (app: Application) => {
|
|
|
23
22
|
}
|
|
24
23
|
`
|
|
25
24
|
|
|
26
|
-
const configurationTemplate = ({ database }: ConnectionGeneratorContext) =>
|
|
27
|
-
` ${database}: { type: 'string' },`
|
|
28
25
|
const importTemplate = "import { mongodb } from './mongodb'"
|
|
29
26
|
const configureTemplate = 'app.configure(mongodb)'
|
|
30
27
|
const toAppFile = toFile<ConnectionGeneratorContext>(({ lib }) => [lib, 'app'])
|
|
@@ -37,13 +34,5 @@ export const generate = (ctx: ConnectionGeneratorContext) =>
|
|
|
37
34
|
toFile<ConnectionGeneratorContext>(({ lib }) => lib, 'mongodb')
|
|
38
35
|
)
|
|
39
36
|
)
|
|
40
|
-
.then(
|
|
41
|
-
injectSource(
|
|
42
|
-
configurationTemplate,
|
|
43
|
-
before('authentication: authenticationSettingsSchema'),
|
|
44
|
-
toFile<ConnectionGeneratorContext>(({ lib }) => [lib, 'configuration']),
|
|
45
|
-
false
|
|
46
|
-
)
|
|
47
|
-
)
|
|
48
37
|
.then(injectSource(importTemplate, before('import { services } from'), toAppFile))
|
|
49
38
|
.then(injectSource(configureTemplate, before('app.configure(services)'), toAppFile))
|
package/lib/hook/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const generate: (ctx: HookGeneratorContext) => Promise<{
|
|
|
14
14
|
pkg: import("../commons").AppPackageJson;
|
|
15
15
|
lib: string;
|
|
16
16
|
test: string;
|
|
17
|
-
language: "
|
|
17
|
+
language: "ts" | "js";
|
|
18
18
|
dependencyVersions?: import("../commons").DependencyVersions;
|
|
19
19
|
cwd: string;
|
|
20
20
|
_?: (string | number)[];
|
package/lib/hook/index.js
CHANGED
|
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.generate = void 0;
|
|
7
7
|
const pinion_1 = require("@feathershq/pinion");
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const commons_1 = require("../commons");
|
|
9
10
|
const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
11
|
+
.then((0, commons_1.initializeBaseContext)())
|
|
12
|
+
.then((0, commons_1.checkPreconditions)())
|
|
10
13
|
.then((0, pinion_1.prompt)(({ type, name }) => [
|
|
11
14
|
{
|
|
12
15
|
type: 'input',
|
package/lib/hook/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hook/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAqE;AACrE,oDAAsB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hook/index.ts"],"names":[],"mappings":";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odash'
|
|
3
|
-
import { FeathersBaseContext } from '../commons'
|
|
3
|
+
import { checkPreconditions, FeathersBaseContext, initializeBaseContext } from '../commons'
|
|
4
4
|
|
|
5
5
|
export interface HookGeneratorContext extends FeathersBaseContext {
|
|
6
6
|
name: string
|
|
@@ -11,6 +11,8 @@ export interface HookGeneratorContext extends FeathersBaseContext {
|
|
|
11
11
|
|
|
12
12
|
export const generate = (ctx: HookGeneratorContext) =>
|
|
13
13
|
generator(ctx)
|
|
14
|
+
.then(initializeBaseContext())
|
|
15
|
+
.then(checkPreconditions())
|
|
14
16
|
.then(
|
|
15
17
|
prompt<HookGeneratorContext>(({ type, name }) => [
|
|
16
18
|
{
|
|
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generate = void 0;
|
|
4
4
|
const pinion_1 = require("@feathershq/pinion");
|
|
5
5
|
const commons_1 = require("../../commons");
|
|
6
|
-
const aroundTemplate = ({ camelName, name }) => `
|
|
7
|
-
import type { HookContext, NextFunction } from '../declarations'
|
|
6
|
+
const aroundTemplate = ({ camelName, name }) => /* ts */ `import type { HookContext, NextFunction } from '../declarations'
|
|
8
7
|
|
|
9
8
|
export const ${camelName} = async (context: HookContext, next: NextFunction) => {
|
|
10
9
|
console.log(\`Running hook ${name} on \${context.path}\.\${context.method}\`)
|
|
11
10
|
await next()
|
|
12
11
|
}
|
|
13
12
|
`;
|
|
14
|
-
const regularTemplate = ({ camelName, name }) => `import type { HookContext } from '../declarations'
|
|
13
|
+
const regularTemplate = ({ camelName, name }) => /* ts */ `import type { HookContext } from '../declarations'
|
|
15
14
|
|
|
16
15
|
export const ${camelName} = async (context: HookContext) => {
|
|
17
16
|
console.log(\`Running hook ${name} on \${context.path}\.\${context.method}\`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.tpl.js","sourceRoot":"","sources":["../../../src/hook/templates/hook.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAEtD,2CAA4C;AAE5C,MAAM,cAAc,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"hook.tpl.js","sourceRoot":"","sources":["../../../src/hook/templates/hook.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAEtD,2CAA4C;AAE5C,MAAM,cAAc,GAAG,CAAC,EACtB,SAAS,EACT,IAAI,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;;eAEtB,SAAS;+BACO,IAAI;;;CAGlC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,EACvB,SAAS,EACT,IAAI,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;;eAEtB,SAAS;+BACO,IAAI;EACjC,CAAA;AAEK,MAAM,QAAQ,GAAG,CAAC,GAAyB,EAAE,EAAE,CACpD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAC7E,IAAA,eAAM,EAAuB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAChF,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
|