Skip to content

Commit

Permalink
Merge pull request #390 from vikejs/no-empty-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
magne4000 committed Sep 20, 2024
2 parents 3644be3 + 68eea68 commit d6e9203
Show file tree
Hide file tree
Showing 26 changed files with 219 additions and 699 deletions.
1 change: 1 addition & 0 deletions boilerplates/eslint/files/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default tseslint.config(
{
languageOptions: {
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
sourceType: "module",
ecmaVersion: "latest",
},
Expand Down
9 changes: 0 additions & 9 deletions boilerplates/plain-sentry/files/$package.json.ts

This file was deleted.

19 changes: 0 additions & 19 deletions boilerplates/plain-sentry/files/pages/sentry/+Page.js

This file was deleted.

37 changes: 0 additions & 37 deletions boilerplates/plain-sentry/files/pages/sentry/+client.js

This file was deleted.

25 changes: 0 additions & 25 deletions boilerplates/plain-sentry/files/sentry.browser.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion boilerplates/plain-sentry/files/vite-env.d.ts

This file was deleted.

73 changes: 0 additions & 73 deletions boilerplates/plain-sentry/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions boilerplates/plain-sentry/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions boilerplates/shared-plain/files/pages/index/+Page.ts

This file was deleted.

12 changes: 0 additions & 12 deletions boilerplates/shared-plain/files/renderer/+config.ts

This file was deleted.

39 changes: 0 additions & 39 deletions boilerplates/shared-plain/files/renderer/+onRenderHtml.ts

This file was deleted.

66 changes: 0 additions & 66 deletions boilerplates/shared-plain/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions boilerplates/shared-plain/tsconfig.json

This file was deleted.

16 changes: 16 additions & 0 deletions packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,21 @@ async function checkArguments(args: ParsedArgs<Args>) {
}
}

function checkFlagsIncludesUiFramework(flags: string[]) {
const uiFlags: string[] = features.filter((fs) => fs.category === "UI Framework").map((fs) => fs.flag);
const uiFlagFound = flags.some((f) => uiFlags.includes(f));

if (!uiFlagFound) {
const lf = new Intl.ListFormat("en", {
type: "disjunction",
});
console.error(
`${red("⚠")} A ${yellow("UI Framework")} is required when using Bati. Choose one of ${lf.format(uiFlags.map((f) => bold(`--${f}`)))}`,
);
process.exit(5);
}
}

function checkFlagsExist(flags: string[]) {
const inValidOptions = flags.reduce((acc: string[], flag: string) => {
if (!Object.prototype.hasOwnProperty.call(defaultDef, flag) && !features.some((f) => f.flag === flag)) {
Expand Down Expand Up @@ -361,6 +376,7 @@ async function run() {
];

checkFlagsExist(flags);
checkFlagsIncludesUiFramework(flags);
checkRules(flags);

// `enforce: "pre"` boilerplates first, then `enforce: undefined`, then `enforce: "post"`
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@batijs/hono#build",
"@batijs/lucia-auth#build",
"@batijs/mantine#build",
"@batijs/plain-sentry#build",
"@batijs/prettier#build",
"@batijs/prisma#build",
"@batijs/react#build",
Expand All @@ -37,7 +36,6 @@
"@batijs/shared#build",
"@batijs/shared-db#build",
"@batijs/shared-no-db#build",
"@batijs/shared-plain#build",
"@batijs/shared-server#build",
"@batijs/shared-todo#build",
"@batijs/solid#build",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/parse/linters/linter-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export default function tsLinterConfig(meta: VikeMeta) {
},
languageOptions: {
parser: tsParseForESLint,
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
},
},
rules: {
"batiTs/ts": "error",
Expand Down
2 changes: 2 additions & 0 deletions packages/features/src/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ export const categories = [
label: "Frontend Framework",
group: categoriesGroups.Frontend,
description: `Flexible, robust, community-driven, and fast Vite-based frontend framework.`,
required: true,
},
{
label: "UI Framework",
group: categoriesGroups.Frontend,
description: `It’s recommended to choose a frontend lib to kickstart a new Vike project,
as they each come with a wide range of integrations. You can at any time eject and take control over integration code
so that it doesn’t get in your way.`,
required: true,
},
{
label: "CSS",
Expand Down
Loading

0 comments on commit d6e9203

Please sign in to comment.