Skip to content

Commit

Permalink
chore(*): deps updated
Browse files Browse the repository at this point in the history
inquirer: ^9.3.4 -> ^11.0.1
ora: ^8.0.1 -> ^8.1.0
@microsoft/api-extractor: ^7.47.0 -> ^7.47.9
autoprefixer: ^10.4.19 -> ^10.4.20
cssnano: ^7.0.4 -> ^7.0.6
postcss: ^8.4.39 -> ^8.4.47
sass: ^1.77.6 -> ^1.78.0
vite: ^5.3.3 -> ^5.4.6
@types/eslint: ^8.56.10 -> ^9.6.1
@types/node: ^20.14.9 -> ^22.5.5
eslint: ^9.6.0 -> ^9.10.0
husky: ^9.0.11 -> ^9.1.6
lint-staged: ^15.2.7 -> ^15.2.10
stylelint: ^16.6.1 -> ^16.9.0
tsx: ^4.16.2 -> ^4.19.1
@stylistic/eslint-plugin: ^2.3.0 -> ^2.8.0
@typescript-eslint/eslint-plugin: ^7.15.0 -> ^8.6.0
@typescript-eslint/parser: ^7.15.0 -> ^8.6.0
eslint-plugin-import-x: ^0.5.3 -> ^4.2.1
eslint-plugin-jsdoc: ^48.5.2 -> ^50.2.3
eslint-plugin-markdown: ^5.0.0 -> ^5.1.0
globals: ^15.8.0 -> ^15.9.0
@testing-library/react: ^16.0.0 -> ^16.0.1
semver: ^7.6.2 -> ^7.6.3
@stylistic/stylelint-plugin: ^2.1.2 -> ^3.0.1
puppeteer: ^22.12.1 -> ^23.3.1
@vitest/coverage-istanbul: ^1.6.0 -> ^2.1.1
jsdom: ^24.1.0 -> ^25.0.0
vitest: ^1.6.0 -> ^2.1.1
@vitejs/plugin-vue: ^5.0.5 -> ^5.1.3
@vitejs/plugin-vue-jsx: ^4.0.0 -> ^4.0.1
vue: ^3.4.31 -> ^3.5.6
vue-tsc: ^2.0.26 -> ^2.1.6

remove inquirer-autocomplete-prompt
  • Loading branch information
deot committed Sep 19, 2024
1 parent f2d59ed commit 0f81c52
Show file tree
Hide file tree
Showing 24 changed files with 2,108 additions and 2,134 deletions.
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

node packages/commitlint/dist/index.js --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

./node_modules/.bin/lint-staged
5 changes: 2 additions & 3 deletions packages/adder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
},
"dependencies": {
"fs-extra": "^11.2.0",
"inquirer": "^9.3.4",
"inquirer-autocomplete-prompt": "^3.0.1",
"ora": "^8.0.1",
"inquirer": "^11.0.1",
"ora": "^8.1.0",
"@deot/dev-shared": "^2.8.0"
}
}
125 changes: 62 additions & 63 deletions packages/adder/src/prompt.ts
Original file line number Diff line number Diff line change
@@ -1,71 +1,75 @@
import inquirer from 'inquirer';
import autocomplete from 'inquirer-autocomplete-prompt';
import { Locals } from '@deot/dev-shared';
import { input, select, search, Separator } from '@inquirer/prompts';

const { prompt, registerPrompt, Separator } = inquirer;
import { Locals } from '@deot/dev-shared';

export const getOptions = async () => {
const { packageFolderNames } = Locals.impl();
const question = [
{
type: 'list',
name: 'mode',
message: 'Select Mode:',
choices: [
new Separator('选择添加的类型:'),
'dependent',
'package'
],
default: 'package'
},
{
type: 'autocomplete',
const mode = await select({
message: 'Select Mode:',
choices: [
new Separator('选择添加的类型:'),
{
value: 'dependent',
},
{
value: 'package',
}
],
default: 'package'
});

let packageName = '';
let packageFolderName = '';
let dependentName = '';
let args = '';
if (mode == 'dependent') {
packageFolderName = await search({
message: 'Select Package To Install:',
when: (answers: any) => answers.mode === 'dependent',
name: 'packageFolderName',
// suggestOnly: true, 开启后可以验证数据且需要使用tab选中
default: 'index',
source: (_: any, input: any) => {
input = input || '';
return new Promise((($resolve) => {
const filter = input
? packageFolderNames.filter(item => item.includes(input))
source: (term) => {
const v = typeof term === 'undefined' ? 'index' : term;
return new Promise<string[]>((($resolve) => {
const filter = v
? packageFolderNames.filter(item => item.includes(v))
: packageFolderNames;

$resolve(filter);
}));
}
},
{
type: 'input',
name: 'dependentName',
});
dependentName = await input({
message: 'Input Dependent Name',
default: '',
when: (answers: any) => answers.mode === 'dependent',
validate: (answer: any) => {
validate: (answer) => {
if (!answer) {
return '请输入需要添加的模块名';
}
return true;
}
},
{
type: 'list',
name: 'args',
when: (answers: any) => answers.mode === 'dependent',
message: 'Select Install Mode:',
});
args = await select({
message: 'Select Mode:',
choices: [
'-S',
'-D',
'-O'
]
},
{
type: 'input',
name: 'packageFolderName',
{
value: '-S',
},
{
value: '-D',
},
{
value: '-O',
}
],
default: 'package'
});

packageName = Locals.getPackageName(packageFolderName);
}

if (mode == 'package') {
packageFolderName = await input({
message: 'Input Package Name',
default: '',
when: (answers: any) => answers.mode === 'package',
validate: (answer: any) => {
validate: (answer) => {
if (!answer) {
return '请输入需要添加的包名';
}
Expand All @@ -75,20 +79,15 @@ export const getOptions = async () => {
}
return true;
}
}
];

registerPrompt('autocomplete', autocomplete);
const result = await prompt(question);

if (result.mode == 'dependent') {
result.packageName = Locals.getPackageName(result.packageFolderName);
}

if (result.mode == 'package') {
result.packageName = Locals.getPackageName(result.packageFolderName);
});
packageName = Locals.getPackageName(packageFolderName);
}

result.args = [result.args];
return result;
return {
mode,
packageName,
packageFolderName,
dependentName,
args: [args]
};
};
16 changes: 8 additions & 8 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@
"@deot/dev-react": "^2.8.0",
"@deot/dev-shared": "^2.8.0",
"@deot/dev-vue": "^2.8.0",
"@microsoft/api-extractor": "^7.47.0",
"autoprefixer": "^10.4.19",
"@microsoft/api-extractor": "^7.47.9",
"autoprefixer": "^10.4.20",
"chalk": "^5.3.0",
"cssnano": "^7.0.4",
"cssnano": "^7.0.6",
"fs-extra": "^11.2.0",
"ora": "^8.0.1",
"postcss": "^8.4.39",
"ora": "^8.1.0",
"postcss": "^8.4.47",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^16.1.0",
"postcss-url": "^10.1.3",
"sass": "^1.77.6",
"vite": "^5.3.3"
"sass": "^1.78.0",
"vite": "^5.4.6"
},
"devDependencies": {
"typescript": "^5.5.3"
"typescript": "^5.6.2"
}
}
1 change: 1 addition & 0 deletions packages/cli/__tests__/add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('add.ts', () => {
await instance.press('enter');
await instance.press('enter');
await instance.press('package');
await instance.press('enter');
await instance.stop();

const command = 'npx pnpm link ./packages/package';
Expand Down
16 changes: 8 additions & 8 deletions packages/deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"access": "public"
},
"dependencies": {
"@types/eslint": "^8.56.10",
"@types/node": "^20.14.9",
"eslint": "^9.6.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"stylelint": "^16.6.1",
"tsx": "^4.16.2",
"typescript": "^5.5.3"
"@types/eslint": "^9.6.1",
"@types/node": "^22.5.5",
"eslint": "^9.10.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"stylelint": "^16.9.0",
"tsx": "^4.19.1",
"typescript": "^5.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/dever/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@deot/dev-shared": "^2.8.0",
"@deot/dev-vue": "^2.8.0",
"ejs": "^3.1.10",
"vite": "^5.3.3"
"vite": "^5.4.6"
},
"devDependencies": {
"@deot/dev-test": "^2.8.1",
Expand Down
18 changes: 9 additions & 9 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"access": "public"
},
"dependencies": {
"@stylistic/eslint-plugin": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"eslint-plugin-import-x": "^0.5.3",
"eslint-plugin-jsdoc": "^48.5.2",
"eslint-plugin-markdown": "^5.0.0",
"globals": "^15.8.0"
"@stylistic/eslint-plugin": "^2.8.0",
"@typescript-eslint/eslint-plugin": "^8.6.0",
"@typescript-eslint/parser": "^8.6.0",
"eslint-plugin-import-x": "^4.2.1",
"eslint-plugin-jsdoc": "^50.2.3",
"eslint-plugin-markdown": "^5.1.0",
"globals": "^15.9.0"
},
"devDependencies": {
"@types/eslint": "^8.56.10",
"eslint": "^9.6.0"
"@types/eslint": "^9.6.1",
"eslint": "^9.10.0"
}
}
1 change: 0 additions & 1 deletion packages/eslint/src/configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const typescript = async (options$?: Options): Promise<FlatConfig[]> => {
...recommendedRules,
'@typescript-eslint/no-shadow': 2, // https://github.com/typescript-eslint/typescript-eslint/issues/2483
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/member-delimiter-style': 1,
// ignore duplicate rules
'no-unused-vars': 0
};
Expand Down
2 changes: 1 addition & 1 deletion packages/linker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"dependencies": {
"@deot/dev-shared": "^2.8.0",
"chalk": "^5.3.0",
"ora": "^8.0.1"
"ora": "^8.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"access": "public"
},
"dependencies": {
"@testing-library/react": "^16.0.0",
"@testing-library/react": "^16.0.1",
"@vitejs/plugin-react-swc": "^3.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
5 changes: 2 additions & 3 deletions packages/releaser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
"conventional-commits-parser": "^6.0.0",
"chalk": "^5.3.0",
"fs-extra": "^11.2.0",
"inquirer": "^9.3.4",
"inquirer-autocomplete-prompt": "^3.0.1",
"semver": "^7.6.2"
"inquirer": "^11.0.1",
"semver": "^7.6.3"
},
"devDependencies": {
"cross-env": "^7.0.3"
Expand Down
38 changes: 11 additions & 27 deletions packages/releaser/src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import fs from 'fs-extra';
import { CommitParser } from 'conventional-commits-parser';
import chalk from 'chalk';
import semver from 'semver';
import { createPromptModule } from 'inquirer';
import { input, confirm } from '@inquirer/prompts';
import { Shell, Logger, Locals } from '@deot/dev-shared';

const cwd = process.cwd();
const require$ = createRequire(cwd);
const prompt = createPromptModule();

const HASH = '-hash-';
const SUFFIX = '🐒💨🙊';
Expand Down Expand Up @@ -173,16 +172,10 @@ export class Release {
if (commits.length && skipUpdatePackage) {
let skip = false;
if (typeof skipUpdatePackage === 'boolean' && skipUpdatePackage) {
const result = await prompt([
{
type: 'confirm',
name: 'skip',
message: `Skip Update(${this.packageName}@${this.packageOptions.version}):`,
default: true
}
]);

skip = result.skip;
skip = await confirm({
message: `Skip Update(${this.packageName}@${this.packageOptions.version}):`,
default: true
});
} else if (
typeof skipUpdatePackage === 'string'
&& (
Expand All @@ -206,16 +199,10 @@ export class Release {
if (!commits.length && forceUpdatePackage) {
let force = false;
if (typeof forceUpdatePackage === 'boolean' && forceUpdatePackage) {
const result = await prompt([
{
type: 'confirm',
name: 'force',
message: `Force Update(${this.packageName}@${this.packageOptions.version}):`,
default: true
}
]);

force = result.force;
force = await confirm({
message: `Force Update(${this.packageName}@${this.packageOptions.version}):`,
default: true
});
} else if (
typeof forceUpdatePackage === 'string'
&& (
Expand Down Expand Up @@ -331,10 +318,8 @@ export class Release {
newVersion = commandOptions.customVersion;

if (!(/\d+.\d+.\d+/.test(newVersion)) || version === newVersion) {
const result = await prompt([
newVersion = await input(
{
type: 'input',
name: 'version',
message: `Custom Update Version(${this.packageName}@${version}):`,
default: '',
validate: (answer: any) => {
Expand All @@ -348,8 +333,7 @@ export class Release {
return true;
}
}
]);
newVersion = result.version;
);
}
} else {
const intersection: any[] = [
Expand Down
Loading

0 comments on commit 0f81c52

Please sign in to comment.