@batijs/cli 0.0.253 → 0.0.255

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ // files/$README.md.ts
2
+ import { loadReadme } from "@batijs/core";
3
+ async function getReadme(props) {
4
+ const content = await loadReadme(props);
5
+ const todo = `
6
+ ## Mantine
7
+
8
+ This is a boilerplate for Mantine based on the [Getting Started](https://mantine.dev/docs/getting-started/) guide.
9
+
10
+ The following Packages are installed:
11
+ * \`@mantine/hooks\` Hooks for state and UI management
12
+ * \`@mantine/core\` Core components library: inputs, buttons, overlays, etc.
13
+
14
+ If you add more packages, make sure to update the \`layouts/LayoutDefault.tsx\` file to include the required CSSs.
15
+
16
+ The theme is defined in \`layouts/theme.ts\`.
17
+ `;
18
+ content.addAbout(todo);
19
+ return content.finalize();
20
+ }
21
+ export {
22
+ getReadme as default
23
+ };
@@ -0,0 +1,122 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // package.json
28
+ var require_package = __commonJS({
29
+ "package.json"(exports, module) {
30
+ module.exports = {
31
+ name: "@batijs/mantine",
32
+ private: true,
33
+ version: "0.0.1",
34
+ description: "",
35
+ type: "module",
36
+ scripts: {
37
+ "check-types": "tsc --noEmit",
38
+ build: "bati-compile-boilerplate"
39
+ },
40
+ keywords: [],
41
+ author: "",
42
+ license: "MIT",
43
+ devDependencies: {
44
+ "@batijs/compile": "workspace:*",
45
+ "@batijs/react": "workspace:*",
46
+ "@mantine/core": "^7.12.1",
47
+ "@mantine/hooks": "^7.12.1",
48
+ "@types/node": "^18.19.14",
49
+ "@types/react": "^18.3.4",
50
+ "@types/react-dom": "^18.3.0",
51
+ postcss: "^8.4.41",
52
+ "postcss-preset-mantine": "^1.17.0",
53
+ "postcss-simple-vars": "^7.0.1",
54
+ react: "^18.3.1",
55
+ "react-dom": "^18.3.1",
56
+ "vike-react": "^0.5.3",
57
+ vite: "^5.4.2",
58
+ "vite-plugin-compiled-react": "^1.1.3"
59
+ },
60
+ dependencies: {
61
+ "@batijs/core": "workspace:*"
62
+ },
63
+ files: [
64
+ "dist/"
65
+ ],
66
+ bati: {
67
+ enforce: "post",
68
+ if: {
69
+ flag: {
70
+ $all: [
71
+ "mantine",
72
+ "react"
73
+ ]
74
+ }
75
+ }
76
+ },
77
+ exports: {
78
+ "./postcss.config.": {
79
+ types: "./dist/types/postcss.config.d.cts"
80
+ },
81
+ "./components/Link": {
82
+ types: "./dist/types/components/Link.d.ts"
83
+ },
84
+ "./layouts/theme": {
85
+ types: "./dist/types/layouts/theme.d.ts"
86
+ },
87
+ "./layouts/LayoutDefault": {
88
+ types: "./dist/types/layouts/LayoutDefault.d.ts"
89
+ }
90
+ },
91
+ typesVersions: {
92
+ "*": {
93
+ "postcss.config.": [
94
+ "./dist/types/postcss.config.d.cts"
95
+ ],
96
+ "components/Link": [
97
+ "./dist/types/components/Link.d.ts"
98
+ ],
99
+ "layouts/theme": [
100
+ "./dist/types/layouts/theme.d.ts"
101
+ ],
102
+ "layouts/LayoutDefault": [
103
+ "./dist/types/layouts/LayoutDefault.d.ts"
104
+ ]
105
+ }
106
+ }
107
+ };
108
+ }
109
+ });
110
+
111
+ // files/$package.json.ts
112
+ import { addDependency, loadAsJson } from "@batijs/core";
113
+ async function getPackageJson(props) {
114
+ const packageJson = await loadAsJson(props);
115
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
116
+ devDependencies: ["postcss", "postcss-preset-mantine", "postcss-simple-vars"],
117
+ dependencies: ["@mantine/core", "@mantine/hooks"]
118
+ });
119
+ }
120
+ export {
121
+ getPackageJson as default
122
+ };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { usePageContext } from "vike-react/usePageContext";
3
+ import { NavLink } from "@mantine/core";
4
+
5
+ export function Link({ href, label }: { href: string; label: string }) {
6
+ const pageContext = usePageContext();
7
+ const { urlPathname } = pageContext;
8
+ const isActive = href === "/" ? urlPathname === href : urlPathname.startsWith(href);
9
+ return <NavLink href={href} label={label} active={isActive} />;
10
+ }
@@ -0,0 +1,37 @@
1
+ import "@mantine/core/styles.css";
2
+ import React from "react";
3
+ import { AppShell, Burger, Group, Image, MantineProvider } from "@mantine/core";
4
+ import { useDisclosure } from "@mantine/hooks";
5
+ import theme from "./theme.js";
6
+
7
+ import logoUrl from "@batijs/react/assets/logo.svg";
8
+ import { Link } from "../components/Link";
9
+
10
+ export default function LayoutDefault({ children }: { children: React.ReactNode }) {
11
+ const [opened, { toggle }] = useDisclosure();
12
+ return (
13
+ <MantineProvider theme={theme}>
14
+ <AppShell
15
+ header={{ height: 60 }}
16
+ navbar={{ width: 300, breakpoint: "sm", collapsed: { mobile: !opened } }}
17
+ padding="md"
18
+ >
19
+ <AppShell.Header>
20
+ <Group h="100%" px="md">
21
+ <Burger opened={opened} onClick={toggle} hiddenFrom="sm" size="sm" />
22
+ <a href="/">
23
+ {" "}
24
+ <Image h={50} fit="contain" src={logoUrl} />{" "}
25
+ </a>
26
+ </Group>
27
+ </AppShell.Header>
28
+ <AppShell.Navbar p="md">
29
+ <Link href="/" label="Welcome" />
30
+ <Link href="/todo" label="Todo" />
31
+ <Link href="/star-wars" label="Data Fetching" />
32
+ </AppShell.Navbar>
33
+ <AppShell.Main> {children} </AppShell.Main>
34
+ </AppShell>
35
+ </MantineProvider>
36
+ );
37
+ }
@@ -0,0 +1,9 @@
1
+ import { createTheme } from "@mantine/core";
2
+ import type { MantineThemeOverride } from "@mantine/core";
3
+
4
+ const theme: MantineThemeOverride = createTheme({
5
+ /** Put your mantine theme override here */
6
+ primaryColor: "violet",
7
+ });
8
+
9
+ export default theme;
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ plugins: {
3
+ 'postcss-preset-mantine': {},
4
+ 'postcss-simple-vars': {
5
+ variables: {
6
+ 'mantine-breakpoint-xs': '36em',
7
+ 'mantine-breakpoint-sm': '48em',
8
+ 'mantine-breakpoint-md': '62em',
9
+ 'mantine-breakpoint-lg': '75em',
10
+ 'mantine-breakpoint-xl': '88em',
11
+ },
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,4 @@
1
+ export declare function Link({ href, label }: {
2
+ href: string;
3
+ label: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import "@mantine/core/styles.css";
2
+ import React from "react";
3
+ export default function LayoutDefault({ children }: {
4
+ children: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { MantineThemeOverride } from "@mantine/core";
2
+ declare const theme: MantineThemeOverride;
3
+ export default theme;
@@ -0,0 +1,12 @@
1
+ export let plugins: {
2
+ 'postcss-preset-mantine': {};
3
+ 'postcss-simple-vars': {
4
+ variables: {
5
+ 'mantine-breakpoint-xs': string;
6
+ 'mantine-breakpoint-sm': string;
7
+ 'mantine-breakpoint-md': string;
8
+ 'mantine-breakpoint-lg': string;
9
+ 'mantine-breakpoint-xl': string;
10
+ };
11
+ };
12
+ };
@@ -50,6 +50,7 @@ var require_package = __commonJS({
50
50
  "@batijs/telefunc": "workspace:^",
51
51
  "@batijs/trpc": "workspace:^",
52
52
  "@batijs/ts-rest": "workspace:*",
53
+ "@mantine/core": "^7.12.1",
53
54
  "@types/node": "^18.19.14",
54
55
  "@types/react": "^18.3.4",
55
56
  "@types/react-dom": "^18.3.0",
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import logoUrl from "../assets/logo.svg";
3
+ //# BATI.has("mantine")
4
+ import { ColorSchemeScript } from "@mantine/core";
3
5
 
4
6
  // Default <head> (can be overridden by pages)
5
7
 
@@ -10,6 +12,7 @@ export default function HeadDefault() {
10
12
  <meta name="viewport" content="width=device-width, initial-scale=1" />
11
13
  <meta name="description" content="Demo showcasing Vike" />
12
14
  <link rel="icon" href={logoUrl} />
15
+ {BATI.has("mantine") ? <ColorSchemeScript /> : null}
13
16
  {/* See https://plausible.io/docs/plausible-script */}
14
17
  {/* TODO: update data-domain */}
15
18
  <script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>
@@ -21,6 +24,7 @@ export default function HeadDefault() {
21
24
  <meta name="viewport" content="width=device-width, initial-scale=1" />
22
25
  <meta name="description" content="Demo showcasing Vike" />
23
26
  <link rel="icon" href={logoUrl} />
27
+ {BATI.has("mantine") ? <ColorSchemeScript /> : null}
24
28
  <script
25
29
  async
26
30
  src={`https://www.googletagmanager.com/gtag/js?id=${import.meta.env.PUBLIC_ENV__GOOGLE_ANALYTICS}`}
@@ -42,6 +46,7 @@ export default function HeadDefault() {
42
46
  <meta name="viewport" content="width=device-width, initial-scale=1" />
43
47
  <meta name="description" content="Demo showcasing Vike" />
44
48
  <link rel="icon" href={logoUrl} />
49
+ {BATI.has("mantine") ? <ColorSchemeScript /> : null}
45
50
  </>
46
51
  );
47
52
  }
@@ -180,6 +180,23 @@
180
180
  "files"
181
181
  ]
182
182
  },
183
+ {
184
+ "config": {
185
+ "enforce": "post",
186
+ "if": {
187
+ "flag": {
188
+ "$all": [
189
+ "mantine",
190
+ "react"
191
+ ]
192
+ }
193
+ }
194
+ },
195
+ "folder": "@batijs/mantine",
196
+ "subfolders": [
197
+ "files"
198
+ ]
199
+ },
183
200
  {
184
201
  "config": {
185
202
  "if": {
package/dist/index.js CHANGED
@@ -1676,7 +1676,7 @@ var createDefaultQueryTester = function(query, options) {
1676
1676
  // package.json
1677
1677
  var package_default = {
1678
1678
  name: "@batijs/cli",
1679
- version: "0.0.253",
1679
+ version: "0.0.255",
1680
1680
  type: "module",
1681
1681
  scripts: {
1682
1682
  "check-types": "tsc --noEmit",
@@ -1742,6 +1742,9 @@ var rulesMessages = {
1742
1742
  [RulesMessage.ERROR_COMPILED_R_REACT]: error(
1743
1743
  `${inverse(bold("React"))} is required when using ${inverse(bold("Compiled"))}`
1744
1744
  ),
1745
+ [RulesMessage.ERROR_MANTINE_R_REACT]: error(
1746
+ `${inverse(bold("React"))} is required when using ${inverse(bold("Mantine"))}`
1747
+ ),
1745
1748
  [RulesMessage.INFO_HATTIP]: info(`${inverse(bold("HatTip"))} is an experimental project`),
1746
1749
  [RulesMessage.ERROR_DRIZZLE_R_SERVER]: error(
1747
1750
  `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Drizzle"))}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.253",
3
+ "version": "0.0.255",
4
4
  "type": "module",
5
5
  "keywords": [],
6
6
  "description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
@@ -20,12 +20,12 @@
20
20
  "typescript": "^5.5.4",
21
21
  "unplugin-purge-polyfills": "^0.0.5",
22
22
  "vite": "^5.4.2",
23
- "@batijs/build": "0.0.253",
24
- "@batijs/compile": "0.0.253"
23
+ "@batijs/build": "0.0.255",
24
+ "@batijs/compile": "0.0.255"
25
25
  },
26
26
  "dependencies": {
27
- "@batijs/features": "0.0.253",
28
- "@batijs/core": "0.0.253"
27
+ "@batijs/features": "0.0.255",
28
+ "@batijs/core": "0.0.255"
29
29
  },
30
30
  "bin": "./dist/index.js",
31
31
  "exports": {