create-feathers 6.0.0-pre.1 → 6.0.0-pre.11

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +1 -1
  3. package/bin/create-feathers.js +25 -15
  4. package/lib/commons.d.ts +78 -0
  5. package/lib/commons.js +40 -0
  6. package/lib/commons.js.map +1 -0
  7. package/lib/index.d.ts +3 -0
  8. package/lib/index.js +77 -0
  9. package/lib/index.js.map +1 -0
  10. package/lib/templates/app.tpl.d.ts +2 -0
  11. package/lib/templates/app.tpl.js +47 -0
  12. package/lib/templates/app.tpl.js.map +1 -0
  13. package/lib/templates/authenticate.tpl.d.ts +2 -0
  14. package/lib/templates/authenticate.tpl.js +26 -0
  15. package/lib/templates/authenticate.tpl.js.map +1 -0
  16. package/lib/templates/gitignore.tpl.d.ts +2 -0
  17. package/lib/templates/gitignore.tpl.js +125 -0
  18. package/lib/templates/gitignore.tpl.js.map +1 -0
  19. package/lib/templates/index.tpl.d.ts +2 -0
  20. package/lib/templates/index.tpl.js +51 -0
  21. package/lib/templates/index.tpl.js.map +1 -0
  22. package/lib/templates/package.json.tpl.d.ts +2 -0
  23. package/lib/templates/package.json.tpl.js +27 -0
  24. package/lib/templates/package.json.tpl.js.map +1 -0
  25. package/lib/templates/prettierrc.tpl.d.ts +2 -0
  26. package/lib/templates/prettierrc.tpl.js +11 -0
  27. package/lib/templates/prettierrc.tpl.js.map +1 -0
  28. package/lib/templates/readme.md.tpl.d.ts +2 -0
  29. package/lib/templates/readme.md.tpl.js +15 -0
  30. package/lib/templates/readme.md.tpl.js.map +1 -0
  31. package/lib/templates/services/messages.tpl.d.ts +2 -0
  32. package/lib/templates/services/messages.tpl.js +49 -0
  33. package/lib/templates/services/messages.tpl.js.map +1 -0
  34. package/lib/templates/services/sse.tpl.d.ts +2 -0
  35. package/lib/templates/services/sse.tpl.js +15 -0
  36. package/lib/templates/services/sse.tpl.js.map +1 -0
  37. package/package.json +14 -6
package/CHANGELOG.md CHANGED
@@ -3,6 +3,48 @@
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.11](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.10...v6.0.0-pre.11) (2026-03-19)
7
+
8
+ ### Features
9
+
10
+ - npm create feathers for v6 ([#3654](https://github.com/feathersjs/feathers/issues/3654)) ([358c50e](https://github.com/feathersjs/feathers/commit/358c50e780ad055b9feab007124e883d83fd6c44))
11
+
12
+ # [6.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.9...v6.0.0-pre.10) (2026-02-19)
13
+
14
+ **Note:** Version bump only for package create-feathers
15
+
16
+ # [6.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.8...v6.0.0-pre.9) (2026-02-19)
17
+
18
+ **Note:** Version bump only for package create-feathers
19
+
20
+ # [6.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.7...v6.0.0-pre.8) (2026-02-19)
21
+
22
+ **Note:** Version bump only for package create-feathers
23
+
24
+ # [6.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.6...v6.0.0-pre.7) (2026-01-29)
25
+
26
+ **Note:** Version bump only for package create-feathers
27
+
28
+ # [6.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.5...v6.0.0-pre.6) (2026-01-29)
29
+
30
+ **Note:** Version bump only for package create-feathers
31
+
32
+ # [6.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.4...v6.0.0-pre.5) (2025-12-20)
33
+
34
+ **Note:** Version bump only for package create-feathers
35
+
36
+ # [6.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.3...v6.0.0-pre.4) (2025-12-20)
37
+
38
+ **Note:** Version bump only for package create-feathers
39
+
40
+ # [6.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.2...v6.0.0-pre.3) (2025-10-10)
41
+
42
+ **Note:** Version bump only for package create-feathers
43
+
44
+ # [6.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.1...v6.0.0-pre.2) (2025-09-04)
45
+
46
+ **Note:** Version bump only for package create-feathers
47
+
6
48
  # [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
49
 
8
50
  **Note:** Version bump only for package create-feathers
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2025 Feathers Contributors
3
+ Copyright (c) 2026 Feathers Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,20 +1,28 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ 'use strict'
3
3
 
4
- import path from 'path'
5
- import { existsSync } from 'fs'
6
- import { mkdir } from 'fs/promises'
7
- import { Command, commandRunner, chalk } from '@feathersjs/cli'
4
+ import path from 'node:path'
5
+ import { existsSync } from 'node:fs'
6
+ import { mkdir } from 'node:fs/promises'
7
+ import { Command } from 'commander'
8
+ import { generate, getContext } from '../lib/index.js'
9
+
10
+ const color = {
11
+ green: (text) => `\x1b[32m${text}\x1b[0m`,
12
+ red: (text) => `\x1b[31m${text}\x1b[0m`,
13
+ grey: (text) => `\x1b[90m${text}\x1b[0m`
14
+ }
8
15
 
9
16
  const program = new Command()
10
- const generateApp = commandRunner('app')
11
17
 
12
18
  program
13
- .name('npm init feathers')
14
- .description(`Create a new Feathers application 🕊️
19
+ .name('npm create feathers')
20
+ .description(
21
+ `Create a new Feathers application 🕊️
15
22
 
16
- ${chalk.grey('npm init feathers myapp')}
17
- `)
23
+ ${color.grey('npm create feathers myapp')}
24
+ `
25
+ )
18
26
  .argument('<name>', 'The name of your new application')
19
27
  // .version(version)
20
28
  .showHelpAfterError()
@@ -28,21 +36,23 @@ ${chalk.grey('npm init feathers myapp')}
28
36
 
29
37
  await mkdir(cwd)
30
38
 
31
- await generateApp({
39
+ const ctx = getContext({
32
40
  name,
33
41
  cwd,
34
42
  ...options
35
43
  })
36
44
 
45
+ await generate(ctx)
46
+
37
47
  console.log(`
38
48
 
39
- ${chalk.green('Hooray')}! Your Feathers app is ready to go! 🚀
40
- Go to the ${chalk.grey(name)} folder to get started.
49
+ ${color.green('Hooray')}! Your Feathers app is ready to go! 🚀
50
+ Go to the ${color.grey(name)} folder to get started.
41
51
 
42
- To learn more visit ${chalk.grey('https://feathersjs.com/guides')}
52
+ To learn more visit ${color.grey('https://feathersjs.com')}
43
53
  `)
44
54
  } catch (error) {
45
- console.error(`${chalk.red('Error')}: ${error.message}`)
55
+ console.error(`${color.red('Error')}: ${error.message}`)
46
56
  process.exit(1)
47
57
  }
48
58
  })
@@ -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
@@ -0,0 +1,3 @@
1
+ import type { AppGeneratorArguments } from './commons.js';
2
+ export { getContext } from '@featherscloud/pinion';
3
+ export declare const generate: (ctx: AppGeneratorArguments) => Promise<import("@featherscloud/pinion").PinionContext>;
package/lib/index.js ADDED
@@ -0,0 +1,77 @@
1
+ import { sep, dirname } from 'path';
2
+ import { prompt, runGenerators, when } 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 events?',
62
+ default: true
63
+ }
64
+ ]))
65
+ .then(runGenerators(__dirname, 'templates'))
66
+ .then(initializeBaseContext())
67
+ .then(install((ctx) => [ctx.platform === 'deno' ? 'npm:feathers@pre' : '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
+ .then(when((ctx) => ctx.platform === 'node', install(['tsx'], true, (ctx) => ctx.packager)));
77
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import type { AppGeneratorContext } from '../commons.js';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons.js").FeathersBaseContext & import("../commons.js").AppGeneratorData>;
@@ -0,0 +1,47 @@
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
+ ${sse
29
+ ? `// On a real-time connection, add the connection to the appropriate channel
30
+ app.on('connection', (connection) => {
31
+ if (connection.user) {
32
+ app.channel('authenticated').join(connection)
33
+ } else {
34
+ app.channel('anonymous').join(connection)
35
+ }
36
+ })
37
+
38
+ // Only publish events to authenticated users
39
+ app.publish(() => app.channel('authenticated'))`
40
+ : ''}
41
+
42
+ export { app }
43
+ `;
44
+ export const generate = (ctx) => Promise.resolve(ctx)
45
+ .then(renderTemplate(template, toFile('src', 'app.ts')))
46
+ .then(runGenerators(__dirname, 'services'));
47
+ //# 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;;;EAI7C,GAAG;IACD,CAAC,CAAC;;;;;;;;;;gDAU0C;IAC5C,CAAC,CAAC,EACN;;;CAGC,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,2 @@
1
+ import { AppGeneratorContext } from '../commons';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons").FeathersBaseContext & import("../commons").AppGeneratorData>;
@@ -0,0 +1,26 @@
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 apiKey = context.params?.request.headers['x-api-key']
9
+
10
+ if (apiKey !== 'supersecret') {
11
+ throw new NotAuthenticated('Invalid API key')
12
+ }
13
+
14
+ context.params = {
15
+ ...context.params,
16
+ user: {
17
+ apiKey: true
18
+ }
19
+ }
20
+ }
21
+
22
+ await next()
23
+ }
24
+ `;
25
+ export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('src', 'hooks', 'authenticate.ts')));
26
+ //# 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;;;;;;;;;;;;;;;;;;;;;;CAsBvC,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,2 @@
1
+ import type { AppGeneratorContext } from '../commons.js';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons.js").FeathersBaseContext & import("../commons.js").AppGeneratorData>;
@@ -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,2 @@
1
+ import type { AppGeneratorContext } from '../commons.js';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons.js").FeathersBaseContext & import("../commons.js").AppGeneratorData>;
@@ -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,2 @@
1
+ import type { AppGeneratorContext } from '../commons.js';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons.js").FeathersBaseContext & import("../commons.js").AppGeneratorData>;
@@ -0,0 +1,27 @@
1
+ import { toFile, writeJSON } from '@featherscloud/pinion';
2
+ const startCommands = {
3
+ node: 'tsx src/index.ts',
4
+ deno: 'deno run --unstable-sloppy-imports --allow-net src/index.ts',
5
+ bun: 'bun src/index.ts'
6
+ };
7
+ const packageJson = ({ name, description, packager, platform }) => ({
8
+ name,
9
+ description,
10
+ version: '0.0.0',
11
+ homepage: '',
12
+ private: true,
13
+ keywords: ['feathers'],
14
+ author: {},
15
+ contributors: [],
16
+ bugs: {},
17
+ type: 'module',
18
+ scripts: {
19
+ start: startCommands[platform] || 'echo "No start command available for this platform"'
20
+ },
21
+ feathers: {
22
+ packager,
23
+ platform
24
+ }
25
+ });
26
+ export const generate = (ctx) => Promise.resolve(ctx).then(writeJSON(packageJson, toFile('package.json')));
27
+ //# 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,aAAa,GAAG;IACpB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,6DAA6D;IACnE,GAAG,EAAE,kBAAkB;CACxB,CAAA;AAED,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,OAAO,EAAE;QACP,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,IAAI,qDAAqD;KACxF;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,2 @@
1
+ import type { AppGeneratorContext } from '../commons.js';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons.js").FeathersBaseContext & import("../commons.js").AppGeneratorData>;
@@ -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,2 @@
1
+ import type { AppGeneratorContext } from '../commons.js';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../commons.js").FeathersBaseContext & import("../commons.js").AppGeneratorData>;
@@ -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,2 @@
1
+ import { AppGeneratorContext } from '../../commons';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../../commons").FeathersBaseContext & import("../../commons").AppGeneratorData>;
@@ -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,2 @@
1
+ import { AppGeneratorContext } from '../../commons';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<import("../../commons").FeathersBaseContext & import("../../commons").AppGeneratorData>;
@@ -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.1",
4
+ "version": "6.0.0-pre.11",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "bin": {
7
7
  "create-feathers": "./bin/create-feathers.js"
@@ -42,16 +42,24 @@
42
42
  "*.js"
43
43
  ],
44
44
  "scripts": {
45
- "test": "bin/create-feathers.js --help"
45
+ "test": "vitest run",
46
+ "prepublish": "npm run compile",
47
+ "compile": "shx rm -rf lib/ && tsc"
46
48
  },
47
49
  "publishConfig": {
48
50
  "access": "public"
49
51
  },
50
- "dependencies": {
51
- "@feathersjs/cli": "^5.0.34"
52
- },
53
- "gitHead": "6abf7c734ec841115518d09b33eacdc0e5917f86",
52
+ "gitHead": "dab4af19a2ea20fd9507346042b33bb1114765f7",
54
53
  "devDependencies": {
54
+ "@types/node": "^24.1.0",
55
+ "@vitest/coverage-v8": "^3.2.4",
56
+ "shx": "^0.4.0",
57
+ "typescript": "^5.8.0",
55
58
  "vitest": "^3.2.4"
59
+ },
60
+ "dependencies": {
61
+ "@featherscloud/pinion": "^0.5.5",
62
+ "commander": "^12.1.0",
63
+ "type-fest": "^0.21.3"
56
64
  }
57
65
  }