Skip to content

Commit a2d8077

Browse files
committed
feat: update dependencies
1 parent 56f7391 commit a2d8077

File tree

6 files changed

+1239
-1236
lines changed

6 files changed

+1239
-1236
lines changed

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,38 @@
4141
"*.{js,jsx,ts,tsx}": "yarn eslint src --cache --fix"
4242
},
4343
"devDependencies": {
44-
"@commitlint/cli": "^19.8.0",
45-
"@commitlint/config-conventional": "^19.8.0",
44+
"@commitlint/cli": "^20.1.0",
45+
"@commitlint/config-conventional": "^20.0.0",
4646
"@openapi-typescript-infra/coconfig": "^4.7.1",
47-
"@semantic-release/github": "^11.0.1",
47+
"@semantic-release/github": "^11.0.6",
4848
"@types/configstore": "^6.0.2",
4949
"@types/handlebars-helpers": "^0.5.6",
5050
"@types/minimist": "^1.2.5",
51-
"@types/node": "^22.14.1",
51+
"@types/node": "^22.18.10",
5252
"@types/parse-git-config": "^3.0.4",
5353
"@types/pascalcase": "^1.0.3",
5454
"@typescript-eslint/eslint-plugin": "^6.21.0",
5555
"@typescript-eslint/parser": "^6.21.0",
5656
"coconfig": "^2.0.0",
5757
"eslint": "^8.57.1",
58-
"eslint-config-prettier": "^9.1.0",
59-
"eslint-import-resolver-typescript": "^4.3.2",
60-
"eslint-plugin-import": "^2.31.0",
58+
"eslint-config-prettier": "^9.1.2",
59+
"eslint-import-resolver-typescript": "^4.4.4",
60+
"eslint-plugin-import": "^2.32.0",
6161
"pinst": "^3.0.0",
62-
"prettier": "^3.5.3",
63-
"typescript": "^5.8.3"
62+
"prettier": "^3.6.2",
63+
"typescript": "^5.9.3"
6464
},
6565
"packageManager": "[email protected]",
6666
"dependencies": {
6767
"@readme/openapi-parser": "^2.7.0",
6868
"boxen": "^8.0.1",
69-
"configstore": "^7.0.0",
69+
"configstore": "^7.1.0",
7070
"handlebars-helpers": "^0.10.0",
7171
"minimist": "^1.2.8",
7272
"mkdirp": "^3.0.1",
7373
"openapi-types": "^12.1.3",
7474
"parse-git-config": "^3.0.0",
75-
"plop": "^4.0.1",
75+
"plop": "^4.0.4",
7676
"plop-pack-git-init": "^0.3.1"
7777
}
7878
}

src/apiProject.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ export default function (plop: NodePlopAPI) {
4040
description: 'Generate an API service',
4141
prompts: [
4242
process.env.NO_DIR_WARNING ? undefined : Prompts.dirWarning,
43-
Prompts.email, Prompts.fullname, Prompts.org,
44-
Prompts.name, Prompts.desc,
43+
Prompts.email,
44+
Prompts.fullname,
45+
Prompts.org,
46+
Prompts.name,
47+
Prompts.desc,
4548
Prompts.features,
4649
Prompts.dbName,
4750
].filter((p) => !!p) as PromptQuestion[],
@@ -54,9 +57,7 @@ export default function (plop: NodePlopAPI) {
5457
stripExtensions: ['hbs'],
5558
globOptions: { dot: true },
5659
force: true,
57-
templateFiles: [
58-
path.resolve(__dirname, '../templates/all/**'),
59-
],
60+
templateFiles: [path.resolve(__dirname, '../templates/all/**')],
6061
data: {
6162
dependencies: dependencies(data as OtiAnswers),
6263
devDependencies: devDependencies(data as OtiAnswers),
@@ -75,9 +76,7 @@ export default function (plop: NodePlopAPI) {
7576
stripExtensions: ['hbs'],
7677
globOptions: { dot: true },
7778
force: true,
78-
templateFiles: [
79-
path.resolve(__dirname, '../templates/db/**'),
80-
],
79+
templateFiles: [path.resolve(__dirname, '../templates/db/**')],
8180
},
8281
cli('yarn set version berry'),
8382
cli('yarn config set nodeLinker node-modules'),
@@ -95,14 +94,18 @@ export default function (plop: NodePlopAPI) {
9594
Your project is ready to roll! We ran yarn for you, so your next steps are:
9695
* Go into the api directory and edit your API specification.
9796
You could use https://editor.swagger.io/ and then paste the yaml back in.
98-
${data?.features.includes('db') ? `* Go into migrations/sql and add your initial database up/down migration to the existing files
99-
* Run "make db-ci" to create the database and run the migrations.` : ''}
97+
${
98+
data?.features.includes('db')
99+
? `* Go into migrations/sql and add your initial database up/down migration to the existing files
100+
* Run "make db-ci" to create the database and run the migrations.`
101+
: ''
102+
}
100103
* Run "yarn test" to just make sure the environment is all sorted out.
101104
* Run "yarn build" to build the database interface, service types and TS code.
102105
* Start implementing your API by adding appropriate handler methods.
103106
104107
Happy hacking!`,
105-
].filter(a => typeof a === 'object' || typeof a === 'string');
108+
].filter((a) => typeof a === 'object' || typeof a === 'string');
106109
},
107110
});
108111
}

src/dependencies.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
function sortByKey(deps: Record<string, string>) {
22
return Object.keys(deps)
33
.sort()
4-
.reduce((obj, key) => {
5-
obj.push({ name: key, spec: deps[key] });
6-
return obj;
7-
}, [] as { name: string; spec: string }[]);
4+
.reduce(
5+
(obj, key) => {
6+
obj.push({ name: key, spec: deps[key] });
7+
return obj;
8+
},
9+
[] as { name: string; spec: string }[],
10+
);
811
}
912

1013
export function dependencies({ features }: { features: string[] }) {

src/handlers.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import { useCliAction } from './actions.js';
1313

1414
async function writeMissing(
1515
api: string,
16-
methods: Record<string, Record<string, { operationId: string; }>>,
17-
apiName: string) {
16+
methods: Record<string, Record<string, { operationId: string }>>,
17+
apiName: string,
18+
) {
1819
const handlerPath = path.join('src', 'handlers', `${api}.ts`);
1920
const exists = fs.existsSync(handlerPath);
2021
if (!exists) {
@@ -33,7 +34,8 @@ ${Object.keys(methods)
3334
res.sendStatus(501);
3435
};
3536
`,
36-
).join('\n')}`,
37+
)
38+
.join('\n')}`,
3739
);
3840
}
3941
}

src/prompts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export const Prompts: Record<string, PromptQuestion> = {
3737
dirWarning: {
3838
type: 'confirm',
3939
name: 'dirWarning',
40-
message: `This will create files in the current directory (${process.cwd()}). Continue?`
40+
message: `This will create files in the current directory (${process.cwd()}). Continue?`,
4141
},
4242
handlerWarning: {
4343
type: 'confirm',
4444
name: 'handlerWarning',
45-
message: `This will create missing handlers for the project in (${process.cwd()}). Continue?`
45+
message: `This will create missing handlers for the project in (${process.cwd()}). Continue?`,
4646
},
4747
email: {
4848
type: 'input',

0 commit comments

Comments
 (0)