|
| 1 | +import { generator, toFile, writeJSON } from '@feathershq/pinion' |
| 2 | +import { ModuleContext } from '../package' |
| 3 | + |
| 4 | +interface Context extends ModuleContext {} |
| 5 | + |
| 6 | +export const generate = (context: Context) => |
| 7 | + generator(context).then( |
| 8 | + writeJSON<Context>( |
| 9 | + ({ moduleName, description, name }) => ({ |
| 10 | + name: moduleName, |
| 11 | + description, |
| 12 | + version: '0.0.0', |
| 13 | + homepage: 'https://feathersjs.com', |
| 14 | + keywords: ['feathers'], |
| 15 | + license: 'MIT', |
| 16 | + repository: { |
| 17 | + type: 'git', |
| 18 | + url: 'git://github.com/feathersjs/feathers.git', |
| 19 | + directory: `packages/${name}` |
| 20 | + }, |
| 21 | + author: { |
| 22 | + name: 'Feathers contributor', |
| 23 | + email: 'hello@feathersjs.com', |
| 24 | + url: 'https://feathersjs.com' |
| 25 | + }, |
| 26 | + contributors: [], |
| 27 | + bugs: { |
| 28 | + url: 'https://github.com/feathersjs/feathers/issues' |
| 29 | + }, |
| 30 | + engines: { |
| 31 | + node: '>= 20' |
| 32 | + }, |
| 33 | + files: ['CHANGELOG.md', 'LICENSE', 'README.md', 'src/**', 'lib/**', 'esm/**'], |
| 34 | + // module: './esm/index.js', |
| 35 | + main: './lib/index.js', |
| 36 | + types: './src/index.ts', |
| 37 | + exports: { |
| 38 | + '.': { |
| 39 | + // import: './esm/index.js', |
| 40 | + require: './lib/index.js', |
| 41 | + types: './src/index.ts' |
| 42 | + } |
| 43 | + }, |
| 44 | + scripts: { |
| 45 | + prepublish: 'npm run compile', |
| 46 | + pack: 'npm pack --pack-destination ../generators/test/build', |
| 47 | + compile: 'shx rm -rf lib/ && tsc && npm run pack', |
| 48 | + test: 'mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts' |
| 49 | + }, |
| 50 | + publishConfig: { |
| 51 | + access: 'public' |
| 52 | + }, |
| 53 | + dependencies: {}, |
| 54 | + devDependencies: {} |
| 55 | + }), |
| 56 | + toFile('packages', context.name, 'package.json') |
| 57 | + ) |
| 58 | + ) |
0 commit comments