Skip to content

Commit e55a500

Browse files
committed
feat: upgrade to oclif 4.*
1 parent 4398dce commit e55a500

14 files changed

+95
-5922
lines changed

.eslintrc

-6
This file was deleted.

.mocharc.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
2-
"require": [
3-
"test/helpers/init.js",
4-
"ts-node/register"
5-
],
6-
"watch-extensions": [
7-
"ts"
8-
],
9-
"recursive": true,
10-
"reporter": "spec",
11-
"timeout": 60000
12-
}
2+
"require": [
3+
"ts-node/register"
4+
],
5+
"watch-extensions": [
6+
"ts"
7+
],
8+
"recursive": true,
9+
"reporter": "spec",
10+
"timeout": 60000
11+
}

.prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@oclif/prettier-config"

bin/dev

-17
This file was deleted.

bin/dev.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
22

3-
node "%~dp0\dev" %*
3+
node "%~dp0\dev" %*

bin/dev.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env node_modules/.bin/ts-node
2+
3+
// eslint-disable-next-line unicorn/prefer-top-level-await
4+
;(async () => {
5+
const oclif = await import('@oclif/core')
6+
await oclif.execute({development: true, dir: __dirname})
7+
})()

bin/run

-5
This file was deleted.

bin/run.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env node
2+
3+
// eslint-disable-next-line unicorn/prefer-top-level-await
4+
(async () => {
5+
const oclif = await import('@oclif/core')
6+
await oclif.execute({dir: __dirname})
7+
})()

eslint.config.mjs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {includeIgnoreFile} from '@eslint/compat'
2+
import oclif from 'eslint-config-oclif'
3+
import prettier from 'eslint-config-prettier'
4+
import path from 'node:path'
5+
import {fileURLToPath} from 'node:url'
6+
7+
const gitignorePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore')
8+
9+
export default [
10+
includeIgnoreFile(gitignorePath),
11+
...oclif,
12+
prettier,
13+
{
14+
rules: {
15+
// Turn off to support Node 18. You can remove this rule if you don't need to support Node 18.
16+
'unicorn/prefer-module': 'off',
17+
}
18+
}
19+
]

package.json

+32-34
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,70 @@
44
"description": "The Formidable Framework Installer",
55
"author": "Donald Pakkies @donaldp",
66
"bin": {
7-
"create-formidable": "./bin/run"
7+
"create-formidable": "./bin/run.js"
88
},
99
"homepage": "https://github.com/formidablejs/create-formidable",
1010
"license": "MIT",
1111
"main": "dist/index.js",
1212
"repository": "formidablejs/create-formidable",
1313
"files": [
14-
"/bin",
15-
"/dist",
16-
"/npm-shrinkwrap.json",
17-
"/oclif.manifest.json"
14+
"./bin",
15+
"./dist",
16+
"./oclif.manifest.json"
1817
],
1918
"dependencies": {
2019
"@formidablejs/installer": "^0.9.12",
21-
"@inquirer/prompts": "^1.2.1",
22-
"@oclif/core": "^2",
23-
"@oclif/plugin-help": "^5",
24-
"@oclif/plugin-plugins": "^2.4.7",
25-
"@oclif/plugin-warn-if-update-available": "^2.0.37"
20+
"@inquirer/prompts": "^7.4.1",
21+
"@oclif/core": "^4",
22+
"@oclif/plugin-help": "^6",
23+
"@oclif/plugin-plugins": "^5"
2624
},
2725
"devDependencies": {
28-
"@oclif/test": "^2.3.20",
26+
"@eslint/compat": "^1",
27+
"@oclif/prettier-config": "^0.2.1",
28+
"@oclif/test": "^4",
2929
"@types/chai": "^4",
30-
"@types/mocha": "^9.0.0",
31-
"@types/mute-stream": "^0.0.1",
32-
"@types/node": "^16.18.31",
30+
"@types/mocha": "^10",
31+
"@types/node": "^18",
3332
"chai": "^4",
34-
"eslint": "^7.32.0",
35-
"eslint-config-oclif": "^4",
36-
"eslint-config-oclif-typescript": "^1.0.3",
37-
"mocha": "^9",
38-
"oclif": "^3",
33+
"eslint": "^9",
34+
"eslint-config-oclif": "^6",
35+
"eslint-config-prettier": "^10",
36+
"mocha": "^10",
37+
"oclif": "^4",
3938
"shx": "^0.3.3",
40-
"ts-node": "^10.9.1",
41-
"tslib": "^2.5.2",
42-
"typescript": "^4.9.5"
39+
"ts-node": "^10",
40+
"typescript": "^5"
4341
},
4442
"oclif": {
4543
"bin": "create-formidable",
4644
"dirname": "create-formidable",
47-
"default": ".",
48-
"commands": "./dist/commands",
45+
"commands": {
46+
"strategy": "single",
47+
"target": "./dist/index.js"
48+
},
4949
"plugins": [
5050
"@oclif/plugin-help",
51-
"@oclif/plugin-warn-if-update-available"
51+
"@oclif/plugin-plugins"
5252
],
53-
"warn-if-update-available": {
54-
"timeoutInDays": 1,
55-
"message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>."
56-
}
53+
"topicSeparator": " "
5754
},
5855
"scripts": {
5956
"build": "shx rm -rf dist && tsc -b",
60-
"lint": "eslint . --ext .ts --config .eslintrc",
57+
"lint": "eslint",
6158
"postpack": "shx rm -f oclif.manifest.json",
62-
"posttest": "yarn lint",
63-
"prepack": "yarn build && oclif manifest && oclif readme",
59+
"posttest": "npm run lint",
60+
"prepack": "oclif manifest && oclif readme",
6461
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
6562
"version": "oclif readme && git add README.md"
6663
},
6764
"engines": {
68-
"node": ">=12.0.0"
65+
"node": ">=20.0.0"
6966
},
7067
"bugs": "https://github.com/formidablejs/create-formidable/issues",
7168
"keywords": [
72-
"oclif"
69+
"formidable",
70+
"full-stack"
7371
],
7472
"types": "dist/index.d.ts"
7573
}

src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export {run} from '@oclif/core'
1+
import Create from './commands/index'
2+
3+
export default Create

tsconfig.json

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
2-
"compilerOptions": {
3-
"declaration": true,
4-
"importHelpers": true,
5-
"module": "commonjs",
6-
"outDir": "dist",
7-
"rootDir": "src",
8-
"strict": true,
9-
"target": "es2019",
10-
"esModuleInterop": true
11-
},
12-
"include": [
13-
"src/**/*"
14-
]
2+
"compilerOptions": {
3+
"declaration": true,
4+
"module": "commonjs",
5+
"outDir": "dist",
6+
"rootDir": "src",
7+
"strict": true,
8+
"target": "es2022",
9+
"esModuleInterop": true,
10+
"allowSyntheticDefaultImports": true,
11+
"skipLibCheck": true
12+
},
13+
"include": [
14+
"src/**/*"
15+
]
1516
}

tsconfig.tsbuildinfo

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"root":["./src/index.ts","./src/commands/index.ts"],"version":"5.8.3"}

0 commit comments

Comments
 (0)