create-feathers 6.0.0-pre.1 → 6.0.0-pre.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/CHANGELOG.md +36 -0
- package/lib/commons.d.ts +78 -0
- package/lib/commons.js +40 -0
- package/lib/commons.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +76 -0
- package/lib/index.js.map +1 -0
- package/lib/templates/app.tpl.d.ts +2 -0
- package/lib/templates/app.tpl.js +33 -0
- package/lib/templates/app.tpl.js.map +1 -0
- package/lib/templates/authenticate.tpl.d.ts +2 -0
- package/lib/templates/authenticate.tpl.js +19 -0
- package/lib/templates/authenticate.tpl.js.map +1 -0
- package/lib/templates/gitignore.tpl.d.ts +2 -0
- package/lib/templates/gitignore.tpl.js +125 -0
- package/lib/templates/gitignore.tpl.js.map +1 -0
- package/lib/templates/index.tpl.d.ts +2 -0
- package/lib/templates/index.tpl.js +51 -0
- package/lib/templates/index.tpl.js.map +1 -0
- package/lib/templates/package.json.tpl.d.ts +2 -0
- package/lib/templates/package.json.tpl.js +19 -0
- package/lib/templates/package.json.tpl.js.map +1 -0
- package/lib/templates/prettierrc.tpl.d.ts +2 -0
- package/lib/templates/prettierrc.tpl.js +11 -0
- package/lib/templates/prettierrc.tpl.js.map +1 -0
- package/lib/templates/readme.md.tpl.d.ts +2 -0
- package/lib/templates/readme.md.tpl.js +15 -0
- package/lib/templates/readme.md.tpl.js.map +1 -0
- package/lib/templates/services/messages.tpl.d.ts +2 -0
- package/lib/templates/services/messages.tpl.js +49 -0
- package/lib/templates/services/messages.tpl.js.map +1 -0
- package/lib/templates/services/sse.tpl.d.ts +2 -0
- package/lib/templates/services/sse.tpl.js +15 -0
- package/lib/templates/services/sse.tpl.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
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
|
+
# [6.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.9...v6.0.0-pre.10) (2026-02-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package create-feathers
|
|
9
|
+
|
|
10
|
+
# [6.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.8...v6.0.0-pre.9) (2026-02-19)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package create-feathers
|
|
13
|
+
|
|
14
|
+
# [6.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.7...v6.0.0-pre.8) (2026-02-19)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package create-feathers
|
|
17
|
+
|
|
18
|
+
# [6.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.6...v6.0.0-pre.7) (2026-01-29)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package create-feathers
|
|
21
|
+
|
|
22
|
+
# [6.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.5...v6.0.0-pre.6) (2026-01-29)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package create-feathers
|
|
25
|
+
|
|
26
|
+
# [6.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.4...v6.0.0-pre.5) (2025-12-20)
|
|
27
|
+
|
|
28
|
+
**Note:** Version bump only for package create-feathers
|
|
29
|
+
|
|
30
|
+
# [6.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.3...v6.0.0-pre.4) (2025-12-20)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package create-feathers
|
|
33
|
+
|
|
34
|
+
# [6.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.2...v6.0.0-pre.3) (2025-10-10)
|
|
35
|
+
|
|
36
|
+
**Note:** Version bump only for package create-feathers
|
|
37
|
+
|
|
38
|
+
# [6.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.1...v6.0.0-pre.2) (2025-09-04)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package create-feathers
|
|
41
|
+
|
|
6
42
|
# [6.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.0...v6.0.0-pre.1) (2025-09-03)
|
|
7
43
|
|
|
8
44
|
**Note:** Version bump only for package create-feathers
|
package/lib/commons.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { PackageJson } from 'type-fest';
|
|
2
|
+
import { Callable, PinionContext } from '@featherscloud/pinion';
|
|
3
|
+
export declare const version: any;
|
|
4
|
+
export type DependencyVersions = {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export type FeathersAppInfo = {
|
|
8
|
+
packager: 'yarn' | 'npm' | 'pnpm';
|
|
9
|
+
platform: 'node' | 'deno' | 'bun';
|
|
10
|
+
sse: boolean;
|
|
11
|
+
};
|
|
12
|
+
export interface AppPackageJson extends PackageJson {
|
|
13
|
+
feathers?: FeathersAppInfo;
|
|
14
|
+
}
|
|
15
|
+
export interface FeathersBaseContext extends PinionContext {
|
|
16
|
+
/**
|
|
17
|
+
* Information about the Feathers application (like chosen language, database etc.)
|
|
18
|
+
* usually taken from `package.json`
|
|
19
|
+
*/
|
|
20
|
+
feathers: FeathersAppInfo;
|
|
21
|
+
/**
|
|
22
|
+
* The package.json file
|
|
23
|
+
*/
|
|
24
|
+
pkg: AppPackageJson;
|
|
25
|
+
/**
|
|
26
|
+
* The folder where source files are put
|
|
27
|
+
*/
|
|
28
|
+
lib: string;
|
|
29
|
+
/**
|
|
30
|
+
* The folder where test files are put
|
|
31
|
+
*/
|
|
32
|
+
test: string;
|
|
33
|
+
/**
|
|
34
|
+
* A list dependencies that should be installed with a certain version.
|
|
35
|
+
* Used for installing development dependencies during testing.
|
|
36
|
+
*/
|
|
37
|
+
dependencyVersions?: DependencyVersions;
|
|
38
|
+
}
|
|
39
|
+
export interface AppGeneratorData extends FeathersAppInfo {
|
|
40
|
+
/**
|
|
41
|
+
* The application name
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* A short description of the app
|
|
46
|
+
*/
|
|
47
|
+
description: string;
|
|
48
|
+
}
|
|
49
|
+
export type AppGeneratorContext = FeathersBaseContext & AppGeneratorData;
|
|
50
|
+
export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorData>;
|
|
51
|
+
/**
|
|
52
|
+
* Loads the application package.json and populates information like the library and test directory
|
|
53
|
+
* and Feathers app specific information.
|
|
54
|
+
*
|
|
55
|
+
* @returns The updated context
|
|
56
|
+
*/
|
|
57
|
+
export declare const initializeBaseContext: () => <C extends FeathersBaseContext>(ctx: C) => Promise<Awaited<C> & {
|
|
58
|
+
pkg: import("@featherscloud/pinion").JSONData;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* A special error that can be thrown by generators. It contains additional
|
|
62
|
+
* information about the error that can be used to display a more helpful
|
|
63
|
+
* error message to the user.
|
|
64
|
+
*/
|
|
65
|
+
export declare class FeathersGeneratorError extends Error {
|
|
66
|
+
/**
|
|
67
|
+
* Additional information about the error. This can include things like
|
|
68
|
+
* the reason for the error and suggested actions to take.
|
|
69
|
+
*/
|
|
70
|
+
context?: Record<string, unknown>;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a new FeathersGeneratorError
|
|
73
|
+
* @param message The error message
|
|
74
|
+
* @param context Additional information about the error
|
|
75
|
+
*/
|
|
76
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
77
|
+
}
|
|
78
|
+
export declare const install: <C extends PinionContext>(dependencies: Callable<string[], C>, dev: Callable<boolean, C>, packager: Callable<string, C>) => (ctx: C) => Promise<PinionContext>;
|
package/lib/commons.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { loadJSON, fromFile, getCallable, exec } from '@featherscloud/pinion';
|
|
5
|
+
// Set __dirname in es module
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
export const { version } = JSON.parse(fs.readFileSync(join(__dirname, '..', 'package.json')).toString());
|
|
8
|
+
/**
|
|
9
|
+
* Loads the application package.json and populates information like the library and test directory
|
|
10
|
+
* and Feathers app specific information.
|
|
11
|
+
*
|
|
12
|
+
* @returns The updated context
|
|
13
|
+
*/
|
|
14
|
+
export const initializeBaseContext = () => (ctx) => Promise.resolve(ctx).then(loadJSON(fromFile('package.json'), (pkg) => ({ pkg }), {}));
|
|
15
|
+
/**
|
|
16
|
+
* A special error that can be thrown by generators. It contains additional
|
|
17
|
+
* information about the error that can be used to display a more helpful
|
|
18
|
+
* error message to the user.
|
|
19
|
+
*/
|
|
20
|
+
export class FeathersGeneratorError extends Error {
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new FeathersGeneratorError
|
|
23
|
+
* @param message The error message
|
|
24
|
+
* @param context Additional information about the error
|
|
25
|
+
*/
|
|
26
|
+
constructor(message, context) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = 'FeathersGeneratorError';
|
|
29
|
+
this.context = context;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export const install = (dependencies, dev, packager) => async (ctx) => {
|
|
33
|
+
const dependencyList = await getCallable(dependencies, ctx);
|
|
34
|
+
const packageManager = await getCallable(packager, ctx);
|
|
35
|
+
const isDev = await getCallable(dev, ctx);
|
|
36
|
+
const flag = isDev ? (packageManager === 'yarn' ? ' --dev' : ' --save-dev') : '';
|
|
37
|
+
const command = packageManager === 'yarn' ? 'add' : 'install';
|
|
38
|
+
return exec(`${packageManager} ${command} ${dependencyList.join(' ')}${flag}`, [])(ctx);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=commons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commons.js","sourceRoot":"","sources":["../src/commons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAA2B,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAEtG,6BAA6B;AAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AAwDxG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,GAAG,EAAE,CACL,CAAgC,GAAM,EAAE,EAAE,CACxC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAEzF;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAO/C;;;;OAIG;IACH,YAAY,OAAe,EAAE,OAAiC;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,OAAO,GAClB,CACE,YAAmC,EACnC,GAAyB,EACzB,QAA6B,EAC7B,EAAE,CACJ,KAAK,EAAE,GAAM,EAAE,EAAE;IACf,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;IAC3D,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;IACvD,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACzC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAChF,MAAM,OAAO,GAAG,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IAE7D,OAAO,IAAI,CAAC,GAAG,cAAc,IAAI,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;AACzF,CAAC,CAAA"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { sep, dirname } from 'path';
|
|
2
|
+
import { prompt, runGenerators } from '@featherscloud/pinion';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { initializeBaseContext, install } from './commons.js';
|
|
5
|
+
export { getContext } from '@featherscloud/pinion';
|
|
6
|
+
// Set __dirname in es module
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
9
|
+
.then(initializeBaseContext())
|
|
10
|
+
.then((ctx) => ({
|
|
11
|
+
...ctx,
|
|
12
|
+
dependencies: [],
|
|
13
|
+
devDependencies: []
|
|
14
|
+
}))
|
|
15
|
+
.then(prompt((ctx) => [
|
|
16
|
+
{
|
|
17
|
+
name: 'name',
|
|
18
|
+
type: 'input',
|
|
19
|
+
when: !ctx.name,
|
|
20
|
+
message: 'What is the name of your application?',
|
|
21
|
+
default: ctx.cwd.split(sep).pop(),
|
|
22
|
+
validate: (input) => {
|
|
23
|
+
if (ctx.dependencyVersions[input]) {
|
|
24
|
+
return `Application can not have the same name as a dependency`;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'description',
|
|
31
|
+
type: 'input',
|
|
32
|
+
when: !ctx.description,
|
|
33
|
+
message: 'Write a short description'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'platform',
|
|
37
|
+
type: 'list',
|
|
38
|
+
when: !ctx.platform,
|
|
39
|
+
message: 'Which platform do you want to use?',
|
|
40
|
+
choices: [
|
|
41
|
+
{ value: 'node', name: 'Node' },
|
|
42
|
+
{ value: 'deno', name: 'Deno' },
|
|
43
|
+
{ value: 'bun', name: 'Bun' }
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'packager',
|
|
48
|
+
type: 'list',
|
|
49
|
+
when: ({ platform }) => platform === 'node' && !ctx.packager,
|
|
50
|
+
message: 'Which package manager are you using?',
|
|
51
|
+
choices: [
|
|
52
|
+
{ value: 'npm', name: 'npm' },
|
|
53
|
+
{ value: 'yarn', name: 'Yarn' },
|
|
54
|
+
{ value: 'pnpm', name: 'pnpm' }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'sse',
|
|
59
|
+
type: 'confirm',
|
|
60
|
+
when: ctx.sse === undefined,
|
|
61
|
+
message: 'Enable real-time with Server-Sent Events (SSE)',
|
|
62
|
+
default: true
|
|
63
|
+
}
|
|
64
|
+
]))
|
|
65
|
+
.then(runGenerators(__dirname, 'templates'))
|
|
66
|
+
.then(initializeBaseContext())
|
|
67
|
+
.then(install(['feathers@pre'], false, (ctx) => {
|
|
68
|
+
if (ctx.packager) {
|
|
69
|
+
return ctx.packager;
|
|
70
|
+
}
|
|
71
|
+
if (ctx.platform === 'deno' || ctx.platform === 'bun') {
|
|
72
|
+
return ctx.platform;
|
|
73
|
+
}
|
|
74
|
+
return 'npm';
|
|
75
|
+
}));
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { renderTemplate, runGenerators, toFile } from '@featherscloud/pinion';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
// Set __dirname in es module
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const template = ({ sse }) => /* ts */ `import { feathers } from 'feathers'
|
|
7
|
+
import type { HookContext as FeathersHookContext, Application as FeathersApplication } from 'feathers'
|
|
8
|
+
import { MessageService } from './services/messages.js'
|
|
9
|
+
${sse ? `import { SseService } from './services/sse.js'` : ''}
|
|
10
|
+
|
|
11
|
+
export type Services = {
|
|
12
|
+
messages: MessageService
|
|
13
|
+
${sse ? `sse: SseService` : ''}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type Configuration = {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type Application = FeathersApplication<Services, Configuration>
|
|
20
|
+
|
|
21
|
+
export type HookContext = FeathersHookContext<Application>
|
|
22
|
+
|
|
23
|
+
const app: Application = feathers<Services, Configuration>()
|
|
24
|
+
|
|
25
|
+
${sse ? `app.use('sse', new SseService())` : ''}
|
|
26
|
+
app.use('messages', new MessageService())
|
|
27
|
+
|
|
28
|
+
export { app }
|
|
29
|
+
`;
|
|
30
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
31
|
+
.then(renderTemplate(template, toFile('src', 'app.ts')))
|
|
32
|
+
.then(runGenerators(__dirname, 'services'));
|
|
33
|
+
//# sourceMappingURL=app.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.tpl.js","sourceRoot":"","sources":["../../src/templates/app.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,6BAA6B;AAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAM,QAAQ,GAAG,CAAC,EAAE,GAAG,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;EAG1D,GAAG,CAAC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC,EAAE;;;;IAIzD,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;EAY9B,GAAG,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,EAAE;;;;CAI9C,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;KACvD,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const template = ({}) => /* ts */ `import type { HookContext, NextFunction } from 'feathers'
|
|
3
|
+
import { NotAuthenticated } from 'feathers/errors'
|
|
4
|
+
|
|
5
|
+
// A hook for simple API key authentication. Extend with the functionality needed for your application.
|
|
6
|
+
export async function authenticate(context: HookContext, next: NextFunction) {
|
|
7
|
+
if (context.params?.request) {
|
|
8
|
+
const { authorization } = context.params?.request.headers['x-api-key']
|
|
9
|
+
|
|
10
|
+
if (authorization !== 'supersecret') {
|
|
11
|
+
throw new NotAuthenticated('Invalid API key')
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
await next()
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('src', 'hooks', 'authenticate.ts')));
|
|
19
|
+
//# sourceMappingURL=authenticate.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.tpl.js","sourceRoot":"","sources":["../../src/templates/authenticate.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,QAAQ,GACZ,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;CAevC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const template = `# Logs
|
|
3
|
+
logs
|
|
4
|
+
*.log
|
|
5
|
+
npm-debug.log*
|
|
6
|
+
yarn-debug.log*
|
|
7
|
+
yarn-error.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
.pnpm-debug.log*
|
|
10
|
+
|
|
11
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
12
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
13
|
+
|
|
14
|
+
# Runtime data
|
|
15
|
+
pids
|
|
16
|
+
*.pid
|
|
17
|
+
*.seed
|
|
18
|
+
*.pid.lock
|
|
19
|
+
|
|
20
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
21
|
+
lib-cov
|
|
22
|
+
|
|
23
|
+
# Coverage directory used by tools like istanbul
|
|
24
|
+
coverage
|
|
25
|
+
*.lcov
|
|
26
|
+
|
|
27
|
+
# nyc test coverage
|
|
28
|
+
.nyc_output
|
|
29
|
+
|
|
30
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
31
|
+
.grunt
|
|
32
|
+
|
|
33
|
+
# Bower dependency directory (https://bower.io/)
|
|
34
|
+
bower_components
|
|
35
|
+
|
|
36
|
+
# node-waf configuration
|
|
37
|
+
.lock-wscript
|
|
38
|
+
|
|
39
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
40
|
+
build/Release
|
|
41
|
+
|
|
42
|
+
# Dependency directories
|
|
43
|
+
node_modules/
|
|
44
|
+
jspm_packages/
|
|
45
|
+
|
|
46
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
47
|
+
web_modules/
|
|
48
|
+
|
|
49
|
+
# TypeScript cache
|
|
50
|
+
*.tsbuildinfo
|
|
51
|
+
|
|
52
|
+
# Optional npm cache directory
|
|
53
|
+
.npm
|
|
54
|
+
|
|
55
|
+
# Optional eslint cache
|
|
56
|
+
.eslintcache
|
|
57
|
+
|
|
58
|
+
# Microbundle cache
|
|
59
|
+
.rpt2_cache/
|
|
60
|
+
.rts2_cache_cjs/
|
|
61
|
+
.rts2_cache_es/
|
|
62
|
+
.rts2_cache_umd/
|
|
63
|
+
|
|
64
|
+
# Optional REPL history
|
|
65
|
+
.node_repl_history
|
|
66
|
+
|
|
67
|
+
# Output of 'npm pack'
|
|
68
|
+
*.tgz
|
|
69
|
+
|
|
70
|
+
# Yarn Integrity file
|
|
71
|
+
.yarn-integrity
|
|
72
|
+
|
|
73
|
+
# dotenv environment variables file
|
|
74
|
+
.env
|
|
75
|
+
.env.test
|
|
76
|
+
.env.production
|
|
77
|
+
|
|
78
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
79
|
+
.cache
|
|
80
|
+
.parcel-cache
|
|
81
|
+
|
|
82
|
+
# Next.js build output
|
|
83
|
+
.next
|
|
84
|
+
out
|
|
85
|
+
|
|
86
|
+
# Nuxt.js build / generate output
|
|
87
|
+
.nuxt
|
|
88
|
+
dist
|
|
89
|
+
|
|
90
|
+
# Gatsby files
|
|
91
|
+
.cache/
|
|
92
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
93
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
94
|
+
# public
|
|
95
|
+
|
|
96
|
+
# vuepress build output
|
|
97
|
+
.vuepress/dist
|
|
98
|
+
|
|
99
|
+
# Serverless directories
|
|
100
|
+
.serverless/
|
|
101
|
+
|
|
102
|
+
# FuseBox cache
|
|
103
|
+
.fusebox/
|
|
104
|
+
|
|
105
|
+
# DynamoDB Local files
|
|
106
|
+
.dynamodb/
|
|
107
|
+
|
|
108
|
+
# TernJS port file
|
|
109
|
+
.tern-port
|
|
110
|
+
|
|
111
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
112
|
+
.vscode-test
|
|
113
|
+
|
|
114
|
+
# yarn v2
|
|
115
|
+
.yarn/cache
|
|
116
|
+
.yarn/unplugged
|
|
117
|
+
.yarn/build-state.yml
|
|
118
|
+
.yarn/install-state.gz
|
|
119
|
+
.pnp.*
|
|
120
|
+
.sqlite
|
|
121
|
+
|
|
122
|
+
lib/
|
|
123
|
+
`;
|
|
124
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('.gitignore')));
|
|
125
|
+
//# sourceMappingURL=gitignore.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.tpl.js","sourceRoot":"","sources":["../../src/templates/gitignore.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHhB,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const nodeTemplate = ({}) => /* ts */ `import { createServer } from 'node:http'
|
|
3
|
+
import { createHandler } from 'feathers/http'
|
|
4
|
+
import { toNodeHandler } from 'feathers/http/node'
|
|
5
|
+
import { app } from './app.js'
|
|
6
|
+
|
|
7
|
+
const PORT = process.env.PORT || 3030
|
|
8
|
+
const handler = createHandler(app)
|
|
9
|
+
const server = createServer(toNodeHandler(handler))
|
|
10
|
+
|
|
11
|
+
server.listen(PORT, () => {
|
|
12
|
+
console.log(\`Server running on http://localhost:\${PORT}\`)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
// Call app.setup to initialize all services
|
|
16
|
+
await app.setup(server)
|
|
17
|
+
`;
|
|
18
|
+
const denoTemplate = ({}) => /* ts */ `import { createHandler } from 'feathers/http'
|
|
19
|
+
import { app } from './app.js'
|
|
20
|
+
|
|
21
|
+
const port = Deno.env.get('PORT') || 3030
|
|
22
|
+
|
|
23
|
+
const handler = createHandler(app)
|
|
24
|
+
|
|
25
|
+
Deno.serve({ port }, handler)
|
|
26
|
+
`;
|
|
27
|
+
const bunTemplate = ({}) => /* ts */ `import { createHandler } from 'feathers/http'
|
|
28
|
+
import { app } from './app.js'
|
|
29
|
+
|
|
30
|
+
const port = Bun.env.PORT || 3030
|
|
31
|
+
const handler = createHandler(app)
|
|
32
|
+
|
|
33
|
+
Bun.serve({
|
|
34
|
+
port,
|
|
35
|
+
fetch: handler
|
|
36
|
+
})
|
|
37
|
+
`;
|
|
38
|
+
const template = (ctx) => {
|
|
39
|
+
switch (ctx.platform) {
|
|
40
|
+
case 'deno':
|
|
41
|
+
return denoTemplate(ctx);
|
|
42
|
+
case 'bun':
|
|
43
|
+
return bunTemplate(ctx);
|
|
44
|
+
case 'node':
|
|
45
|
+
return nodeTemplate(ctx);
|
|
46
|
+
default:
|
|
47
|
+
throw new Error('Unsupported platform');
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('src', 'index.ts')));
|
|
51
|
+
//# sourceMappingURL=index.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.tpl.js","sourceRoot":"","sources":["../../src/templates/index.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,YAAY,GAAG,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;CAe1D,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;CAQ1D,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;CAUzD,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE;IAC5C,QAAQ,GAAG,CAAC,QAAQ,EAAE,CAAC;QACrB,KAAK,MAAM;YACT,OAAO,YAAY,CAAC,GAAG,CAAC,CAAA;QAC1B,KAAK,KAAK;YACR,OAAO,WAAW,CAAC,GAAG,CAAC,CAAA;QACzB,KAAK,MAAM;YACT,OAAO,YAAY,CAAC,GAAG,CAAC,CAAA;QAC1B;YACE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;IAC3C,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { toFile, writeJSON } from '@featherscloud/pinion';
|
|
2
|
+
const packageJson = ({ name, description, packager, platform }) => ({
|
|
3
|
+
name,
|
|
4
|
+
description,
|
|
5
|
+
version: '0.0.0',
|
|
6
|
+
homepage: '',
|
|
7
|
+
private: true,
|
|
8
|
+
keywords: ['feathers'],
|
|
9
|
+
author: {},
|
|
10
|
+
contributors: [],
|
|
11
|
+
bugs: {},
|
|
12
|
+
type: 'module',
|
|
13
|
+
feathers: {
|
|
14
|
+
packager,
|
|
15
|
+
platform
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(writeJSON(packageJson, toFile('package.json')));
|
|
19
|
+
//# sourceMappingURL=package.json.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.tpl.js","sourceRoot":"","sources":["../../src/templates/package.json.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAGzD,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAuB,EAAE,EAAE,CAAC,CAAC;IACvF,IAAI;IACJ,WAAW;IACX,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,MAAM,EAAE,EAAE;IACV,YAAY,EAAE,EAAc;IAC5B,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,QAAQ;QACR,QAAQ;KACT;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const template = `{
|
|
3
|
+
"tabWidth": 2,
|
|
4
|
+
"useTabs": false,
|
|
5
|
+
"printWidth": 110,
|
|
6
|
+
"semi": false,
|
|
7
|
+
"trailingComma": "none",
|
|
8
|
+
"singleQuote": true
|
|
9
|
+
}`;
|
|
10
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('.prettierrc')));
|
|
11
|
+
//# sourceMappingURL=prettierrc.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettierrc.tpl.js","sourceRoot":"","sources":["../../src/templates/prettierrc.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,QAAQ,GAAG;;;;;;;EAOf,CAAA;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const template = ({ name, description }) => /* md */ `# ${name}
|
|
3
|
+
|
|
4
|
+
> ${description}
|
|
5
|
+
|
|
6
|
+
## About
|
|
7
|
+
|
|
8
|
+
This project uses [Feathers](http://feathersjs.com). The universal web framework.
|
|
9
|
+
|
|
10
|
+
## Help
|
|
11
|
+
|
|
12
|
+
For more information on all the things you can do with Feathers visit [feathersjs.com](https://feathersjs.com).
|
|
13
|
+
`;
|
|
14
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('readme.md')));
|
|
15
|
+
//# sourceMappingURL=readme.md.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme.md.tpl.js","sourceRoot":"","sources":["../../src/templates/readme.md.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,IAAI;;IAE/E,WAAW;;;;;;;;;CASd,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const template = ({}) => /* ts */ `import type { Params } from 'feathers'
|
|
3
|
+
import { hooks } from 'feathers/hooks'
|
|
4
|
+
|
|
5
|
+
import { authenticate } from '../hooks/authenticate.js'
|
|
6
|
+
|
|
7
|
+
export type Message = {
|
|
8
|
+
text: string
|
|
9
|
+
completed: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// An example messages Feathers service
|
|
13
|
+
@hooks([
|
|
14
|
+
authenticate
|
|
15
|
+
])
|
|
16
|
+
export class MessageService {
|
|
17
|
+
async find(params: Params) {
|
|
18
|
+
return [{
|
|
19
|
+
text: 'Create Feathers app',
|
|
20
|
+
completed: true
|
|
21
|
+
}, {
|
|
22
|
+
text: 'Implement service methods',
|
|
23
|
+
completed: false
|
|
24
|
+
}]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async get(id: string, params: Params) {
|
|
28
|
+
throw new Error('.get not implemented')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async create(data: Message, params: Params) {
|
|
32
|
+
throw new Error('.create not implemented')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async update(id: string, data: Message, params: Params) {
|
|
36
|
+
throw new Error('.update not implemented')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async patch(id: string, data: Message, params: Params) {
|
|
40
|
+
throw new Error('.patch not implemented')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async remove(id: string, params: Params) {
|
|
44
|
+
throw new Error('.remove not implemented')
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('src', 'services', 'messages.ts')));
|
|
49
|
+
//# sourceMappingURL=messages.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.tpl.js","sourceRoot":"","sources":["../../../src/templates/services/messages.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CtD,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { renderTemplate, toFile, when } from '@featherscloud/pinion';
|
|
2
|
+
const template = ({}) => /* ts */ `import { SseService as FeathersSseService } from 'feathers/http'
|
|
3
|
+
import { hooks } from 'feathers/hooks'
|
|
4
|
+
|
|
5
|
+
import { authenticate } from '../hooks/authenticate.js'
|
|
6
|
+
|
|
7
|
+
// Extends the Feathers service for server sent events (SSE) to add authentication and other hooks
|
|
8
|
+
@hooks([
|
|
9
|
+
authenticate
|
|
10
|
+
])
|
|
11
|
+
export class SseService extends FeathersSseService {
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(when((ctx) => ctx.sse, renderTemplate(template, toFile('src', 'services', 'sse.ts'))));
|
|
15
|
+
//# sourceMappingURL=sse.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse.tpl.js","sourceRoot":"","sources":["../../../src/templates/services/sse.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAGpE,MAAM,QAAQ,GACZ,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;CAWvC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CACtF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-feathers",
|
|
3
3
|
"description": "Create a new Feathers application",
|
|
4
|
-
"version": "6.0.0-pre.
|
|
4
|
+
"version": "6.0.0-pre.10",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-feathers": "./bin/create-feathers.js"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@feathersjs/cli": "^5.0.34"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "78e365a86f66e34e17d89ef23d38933419a7ce41",
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"vitest": "^3.2.4"
|
|
56
56
|
}
|