Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 24 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/commitlint-config/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defineConfig } from "@pplancq/eslint-config";
import eslintConfigPrettier from "eslint-config-prettier/flat";

export default defineConfig({
enablePrettier: "on",
extendConfig: [
eslintConfigPrettier,
{
files: ["**/*.config.{js,cjs,mjs,ts,cts,mts}"],
rules: {
Expand Down
8 changes: 4 additions & 4 deletions packages/commitlint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"scripts": {
"lint:eslint": "eslint \"**/*.{js,mjs}\"",
"lint:eslint:fix": "eslint \"**/*.{js,mjs}\" --fix",
"lint:prettier": "prettier \"**/*.!(js|mjs)\" --check --ignore-unknown",
"lint:prettier:fix": "prettier \"**/*.!(js|mjs)\" --write --ignore-unknown"
"lint:prettier": "prettier . --check --ignore-unknown",
"lint:prettier:fix": "prettier . --write --ignore-unknown"
},
"files": [
"bin",
Expand Down Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"eslint": "^9.39.5",
"eslint-plugin-prettier": "^5.5.6",
"eslint-config-prettier": "^10.1.8",
"lint-staged": "^17.2.0",
"prettier": "^3.9.6"
},
Expand All @@ -51,6 +51,6 @@
"prettier": "@pplancq/prettier-config",
"lint-staged": {
"*.(js|mjs)": "eslint --fix",
"*.!(js|mjs)": "prettier --write --ignore-unknown"
"*": "prettier --write --ignore-unknown"
}
}
3 changes: 2 additions & 1 deletion packages/create-react-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineConfig } from "@pplancq/eslint-config";
import eslintConfigPrettier from "eslint-config-prettier/flat";

export default defineConfig({
enablePrettier: "on",
enableVitest: true,
extendConfig: [
eslintConfigPrettier,
{
ignores: ["dist"],
},
Expand Down
8 changes: 4 additions & 4 deletions packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"test:watch": "vitest",
"lint:eslint": "eslint \"**/*.{js,mjs,ts}\"",
"lint:eslint:fix": "eslint \"**/*.{js,mjs,ts}\" --fix",
"lint:prettier": "prettier \"**/*.!(js|mjs|ts)\" --check --ignore-unknown",
"lint:prettier:fix": "prettier \"**/*.!(js|mjs|ts)\" --write --ignore-unknown",
"lint:prettier": "prettier . --check --ignore-unknown",
"lint:prettier:fix": "prettier . --write --ignore-unknown",
"lint:tsc": "tsc --noEmit",
"prepublishOnly": "npm run build"
},
Expand All @@ -47,7 +47,7 @@
"@vitest/coverage-v8": "^4.1.10",
"commander": "^15.0.0",
"eslint": "^9.39.5",
"eslint-plugin-prettier": "^5.5.6",
"eslint-config-prettier": "^10.1.8",
"lint-staged": "^17.2.0",
"picocolors": "^1.1.1",
"prettier": "^3.9.6",
Expand All @@ -63,6 +63,6 @@
"lint-staged": {
"*.(js|mjs|ts)": "eslint --fix",
"*.ts": "tsc-files --noEmit",
"*.!(js|mjs|ts)": "prettier --write --ignore-unknown"
"*": "prettier --write --ignore-unknown"
}
}
100 changes: 49 additions & 51 deletions packages/create-react-app/src/steps/getInteractiveArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,58 +22,56 @@ export const getInteractiveArgs = async ({
skipDepInstall,
skipGitInit,
template,
}: InteractiveArgs): Promise<InteractiveArgsResult> => {
return {
projectName:
projectName ||
}: InteractiveArgs): Promise<InteractiveArgsResult> => ({
projectName:
projectName ||
checkCancel(
await text({
message: "What is the name of your project?",
placeholder: "my-project",
validate: validateProjectName,
}),
).toString(),
skipDepInstall:
skipDepInstall ||
Boolean(
checkCancel(
await text({
message: "What is the name of your project?",
placeholder: "my-project",
validate: validateProjectName,
}),
).toString(),
skipDepInstall:
skipDepInstall ||
Boolean(
checkCancel(
await confirm({ message: "Do you want to skip installing dependencies (npm install)?", initialValue: false }),
),
await confirm({ message: "Do you want to skip installing dependencies (npm install)?", initialValue: false }),
),
skipGitInit:
skipGitInit ||
Boolean(
checkCancel(
await confirm({ message: "Do you want to skip initializing a git repository?", initialValue: false }),
),
),
template:
template ||
),
skipGitInit:
skipGitInit ||
Boolean(
checkCancel(
(
await group<{ useCustomTemplate: boolean; template: string }>({
useCustomTemplate: async () =>
Boolean(
await confirm({
message: "Do you want to use a custom template?",
initialValue: false,
}),
),
template: async ({ results }) => {
if (!results.useCustomTemplate) {
return "@pplancq/react-template";
}

return (
await text({
message: "Enter the custom template name (e.g., @pplancq/react-template):",
placeholder: "@pplancq/react-template",
validate: validateTemplateName,
})
).toString();
},
})
).template,
await confirm({ message: "Do you want to skip initializing a git repository?", initialValue: false }),
),
};
};
),
template:
template ||
checkCancel(
(
await group<{ useCustomTemplate: boolean; template: string }>({
useCustomTemplate: async () =>
Boolean(
await confirm({
message: "Do you want to use a custom template?",
initialValue: false,
}),
),
template: async ({ results }) => {
if (!results.useCustomTemplate) {
return "@pplancq/react-template";
}

return (
await text({
message: "Enter the custom template name (e.g., @pplancq/react-template):",
placeholder: "@pplancq/react-template",
validate: validateTemplateName,
})
).toString();
},
})
).template,
),
});
Loading