create-creact 0.0.0-stage → 0.1.0

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.
Files changed (49) hide show
  1. package/LICENSE +12 -0
  2. package/README.md +17 -2
  3. package/dist/create.js +257 -0
  4. package/dist/layer.js +633 -0
  5. package/dist/main.js +61 -0
  6. package/dist/options.js +262 -0
  7. package/dist/shell.js +117 -0
  8. package/dist/stacks.js +42 -0
  9. package/dist/ui.js +506 -0
  10. package/dist/version.js +7 -0
  11. package/layer/base/all/.oxfmtrc.json.layer +65 -0
  12. package/layer/base/all/AGENTS.md.layer +22 -0
  13. package/layer/base/all/CLAUDE.md.layer +1 -0
  14. package/layer/base/all/apps/web/src/styles/tokens.css.layer +15 -0
  15. package/layer/base/all/commitlint.config.ts.layer +12 -0
  16. package/layer/base/all/oxlint.config.ts.layer +556 -0
  17. package/layer/base/next/AGENTS.md.layer +4 -0
  18. package/layer/base/next/apps/web/CLAUDE.md.layer +1 -0
  19. package/layer/base/react-router/AGENTS.md.layer +3 -0
  20. package/layer/standalone/all/.husky/commit-msg.layer +2 -0
  21. package/layer/standalone/all/.husky/pre-commit.layer +2 -0
  22. package/layer/standalone/all/.lintstagedrc.json.layer +4 -0
  23. package/layer/standalone/all/AGENTS.md.layer +9 -0
  24. package/layer/standalone/all/vitest.config.ts.layer +14 -0
  25. package/layer/stylex/all/AGENTS.md.layer +4 -0
  26. package/layer/stylex/all/apps/web/src/styles/tokens.stylex.ts.layer +15 -0
  27. package/layer/stylex/all/apps/web/src/styles/tokens.test.ts.layer +32 -0
  28. package/layer/stylex/all/oxlint.styling.ts.layer +20 -0
  29. package/layer/stylex/all/vitest.styling.ts.layer +18 -0
  30. package/layer/stylex/next/apps/web/babel.config.js.layer +25 -0
  31. package/layer/stylex/next/apps/web/postcss.config.js.layer +16 -0
  32. package/layer/stylex/next/apps/web/src/app/layout.tsx.layer +20 -0
  33. package/layer/stylex/next/apps/web/src/app/page.tsx.layer +48 -0
  34. package/layer/stylex/next/apps/web/src/index.css.layer +45 -0
  35. package/layer/stylex/react-router/apps/web/src/index.css.layer +27 -0
  36. package/layer/stylex/react-router/apps/web/src/root.tsx.layer +94 -0
  37. package/layer/stylex/react-router/apps/web/src/routes/_index.tsx.layer +56 -0
  38. package/layer/stylex/react-router/apps/web/vite.config.ts.layer +22 -0
  39. package/layer/tailwind/all/AGENTS.md.layer +4 -0
  40. package/layer/tailwind/all/apps/web/src/index.css.layer +3 -0
  41. package/layer/tailwind/all/apps/web/src/styles/tokens.tailwind.css.layer +7 -0
  42. package/layer/tailwind/all/apps/web/src/styles/tokens.test.ts.layer +35 -0
  43. package/layer/tailwind/all/oxlint.styling.ts.layer +69 -0
  44. package/layer/tailwind/all/vitest.styling.ts.layer +5 -0
  45. package/layer/vite-plus/all/.vite-hooks/commit-msg.layer +2 -0
  46. package/layer/vite-plus/all/.vite-hooks/pre-commit.layer +2 -0
  47. package/layer/vite-plus/all/AGENTS.md.layer +11 -0
  48. package/layer/vite-plus/all/vite.config.ts.layer +25 -0
  49. package/package.json +37 -4
@@ -0,0 +1,18 @@
1
+ import path from "node:path";
2
+
3
+ import type { Plugin, ViteUserConfig } from "{{vitestConfig}}";
4
+ import stylex from "@stylexjs/unplugin";
5
+
6
+ const rootDir = path.join(import.meta.dirname, "apps", "web");
7
+
8
+ // Tests need the compiler only. The plugin's configureServer starts a timer
9
+ // for its HMR channel and clears it when the HTTP server closes, which
10
+ // Vitest's server never does, so the run would hang for 10 s after the tests.
11
+ const compiler = stylex.vite({
12
+ aliases: { "@/*": [path.join(rootDir, "src", "*")] },
13
+ unstable_moduleResolution: { type: "commonJS", rootDir },
14
+ }) as Plugin;
15
+
16
+ export const styling = {
17
+ plugins: [{ ...compiler, configureServer: undefined }],
18
+ } satisfies Pick<ViteUserConfig, "plugins">;
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ import path from "node:path";
3
+
4
+ export default {
5
+ presets: ["next/babel"],
6
+ // Next's babel loader (next/dist/build/babel/loader/get-config.js) puts
7
+ // babel-plugin-react-compiler ahead of these while next.config.ts sets
8
+ // reactCompiler, so it isn't listed here.
9
+ plugins: [
10
+ [
11
+ "@stylexjs/babel-plugin",
12
+ {
13
+ dev: process.env.NODE_ENV !== "production",
14
+ runtimeInjection: false,
15
+ enableInlinedConditionalMerge: true,
16
+ treeshakeCompensation: true,
17
+ aliases: { "@/*": [path.join(import.meta.dirname, "src", "*")] },
18
+ unstable_moduleResolution: {
19
+ type: "commonJS",
20
+ rootDir: import.meta.dirname,
21
+ },
22
+ },
23
+ ],
24
+ ],
25
+ };
@@ -0,0 +1,16 @@
1
+ import babelConfig from "./babel.config.js";
2
+
3
+ export default {
4
+ plugins: {
5
+ "@stylexjs/postcss-plugin": {
6
+ include: ["src/**/*.{ts,tsx}"],
7
+ babelConfig: {
8
+ babelrc: false,
9
+ configFile: false,
10
+ parserOpts: { plugins: ["typescript", "jsx"] },
11
+ plugins: babelConfig.plugins,
12
+ },
13
+ useCSSLayers: true,
14
+ },
15
+ },
16
+ };
@@ -0,0 +1,20 @@
1
+ import type { Metadata } from "next";
2
+
3
+ import "../index.css";
4
+
5
+ export const metadata: Metadata = {
6
+ title: "{{name}}",
7
+ description: "{{name}}",
8
+ };
9
+
10
+ export default function RootLayout({
11
+ children,
12
+ }: Readonly<{
13
+ children: React.ReactNode;
14
+ }>) {
15
+ return (
16
+ <html lang="en">
17
+ <body>{children}</body>
18
+ </html>
19
+ );
20
+ }
@@ -0,0 +1,48 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+
3
+ import { colors, radii, spacing } from "@/styles/tokens.stylex";
4
+
5
+ const styles = stylex.create({
6
+ page: {
7
+ display: "flex",
8
+ flexGrow: 1,
9
+ alignItems: "center",
10
+ justifyContent: "center",
11
+ padding: spacing.gutter,
12
+ },
13
+ card: {
14
+ display: "flex",
15
+ flexDirection: "column",
16
+ gap: spacing.gutter,
17
+ maxWidth: "40rem",
18
+ padding: spacing.gutter,
19
+ borderWidth: 1,
20
+ borderStyle: "solid",
21
+ borderColor: colors.accent,
22
+ borderRadius: radii.card,
23
+ },
24
+ title: { fontSize: "2rem", lineHeight: 1.25, color: colors.ink },
25
+ code: { fontFamily: "ui-monospace, monospace" },
26
+ link: { color: colors.accent, textDecoration: "underline" },
27
+ });
28
+
29
+ export default function Home() {
30
+ return (
31
+ <main {...stylex.props(styles.page)}>
32
+ <div {...stylex.props(styles.card)}>
33
+ <h1 {...stylex.props(styles.title)}>
34
+ To get started, edit the{" "}
35
+ <code {...stylex.props(styles.code)}>page.tsx</code> file.
36
+ </h1>
37
+ <a
38
+ {...stylex.props(styles.link)}
39
+ href="https://nextjs.org/docs"
40
+ target="_blank"
41
+ rel="noopener noreferrer"
42
+ >
43
+ Documentation
44
+ </a>
45
+ </div>
46
+ </main>
47
+ );
48
+ }
@@ -0,0 +1,45 @@
1
+ @layer reset;
2
+
3
+ @import "./styles/tokens.css";
4
+
5
+ @layer reset {
6
+ html {
7
+ height: 100%;
8
+ }
9
+
10
+ html,
11
+ body {
12
+ max-width: 100vw;
13
+ overflow-x: hidden;
14
+ }
15
+
16
+ body {
17
+ min-height: 100%;
18
+ display: flex;
19
+ flex-direction: column;
20
+ color: var(--color-ink);
21
+ background: var(--color-page);
22
+ font-family: Arial, Helvetica, sans-serif;
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ }
26
+
27
+ * {
28
+ box-sizing: border-box;
29
+ padding: 0;
30
+ margin: 0;
31
+ }
32
+
33
+ a {
34
+ color: inherit;
35
+ text-decoration: none;
36
+ }
37
+
38
+ @media (prefers-color-scheme: dark) {
39
+ html {
40
+ color-scheme: dark;
41
+ }
42
+ }
43
+ }
44
+
45
+ @stylex;
@@ -0,0 +1,27 @@
1
+ @layer reset;
2
+
3
+ @import "./styles/tokens.css";
4
+
5
+ @layer reset {
6
+ *,
7
+ *::before,
8
+ *::after {
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ html,
13
+ body {
14
+ margin: 0;
15
+ font-family:
16
+ "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
17
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
18
+ color: var(--color-ink);
19
+ background-color: var(--color-page);
20
+ }
21
+
22
+ @media (prefers-color-scheme: dark) {
23
+ html {
24
+ color-scheme: dark;
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,94 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ import {
3
+ isRouteErrorResponse,
4
+ Links,
5
+ Meta,
6
+ Outlet,
7
+ Scripts,
8
+ ScrollRestoration,
9
+ } from "react-router";
10
+
11
+ import { spacing } from "@/styles/tokens.stylex";
12
+
13
+ import "./index.css";
14
+ import type { Route } from "./+types/root";
15
+
16
+ export const links: Route.LinksFunction = () => [
17
+ // The StyleX plugin serves this sheet in dev but only links it from
18
+ // index.html, which React Router's server rendering never uses.
19
+ ...(import.meta.env.DEV
20
+ ? [{ rel: "stylesheet", href: "/virtual:stylex.css" }]
21
+ : []),
22
+ { rel: "preconnect", href: "https://fonts.googleapis.com" },
23
+ {
24
+ rel: "preconnect",
25
+ href: "https://fonts.gstatic.com",
26
+ crossOrigin: "anonymous",
27
+ },
28
+ {
29
+ rel: "stylesheet",
30
+ href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",
31
+ },
32
+ ];
33
+
34
+ export function Layout({ children }: { children: React.ReactNode }) {
35
+ return (
36
+ <html lang="en">
37
+ <head>
38
+ <meta charSet="utf-8" />
39
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
40
+ <Meta />
41
+ <Links />
42
+ </head>
43
+ <body>
44
+ {children}
45
+ <ScrollRestoration />
46
+ <Scripts />
47
+ </body>
48
+ </html>
49
+ );
50
+ }
51
+
52
+ export default function App() {
53
+ return <Outlet />;
54
+ }
55
+
56
+ const styles = stylex.create({
57
+ main: {
58
+ maxWidth: "80rem",
59
+ marginInline: "auto",
60
+ padding: spacing.gutter,
61
+ paddingTop: "4rem",
62
+ },
63
+ stack: { width: "100%", padding: spacing.gutter, overflowX: "auto" },
64
+ });
65
+
66
+ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
67
+ let message = "Oops!";
68
+ let details = "An unexpected error occurred.";
69
+ let stack: string | undefined;
70
+
71
+ if (isRouteErrorResponse(error)) {
72
+ message = error.status === 404 ? "404" : "Error";
73
+ if (error.status === 404) {
74
+ details = "The requested page could not be found.";
75
+ } else if (error.statusText !== "") {
76
+ details = error.statusText;
77
+ }
78
+ } else if (import.meta.env.DEV && error instanceof Error) {
79
+ details = error.message;
80
+ stack = error.stack;
81
+ }
82
+
83
+ return (
84
+ <main {...stylex.props(styles.main)}>
85
+ <h1>{message}</h1>
86
+ <p>{details}</p>
87
+ {stack !== undefined && (
88
+ <pre {...stylex.props(styles.stack)}>
89
+ <code>{stack}</code>
90
+ </pre>
91
+ )}
92
+ </main>
93
+ );
94
+ }
@@ -0,0 +1,56 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+
3
+ import { colors, radii, spacing } from "@/styles/tokens.stylex";
4
+
5
+ const resources = [
6
+ { href: "https://reactrouter.com/docs", text: "React Router Docs" },
7
+ { href: "https://rmx.as/discord", text: "Join Discord" },
8
+ ];
9
+
10
+ const styles = stylex.create({
11
+ main: {
12
+ display: "flex",
13
+ minHeight: "100vh",
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ padding: spacing.gutter,
17
+ },
18
+ card: {
19
+ padding: spacing.gutter,
20
+ borderWidth: 1,
21
+ borderStyle: "solid",
22
+ borderColor: colors.accent,
23
+ borderRadius: radii.card,
24
+ },
25
+ lead: { margin: 0, color: colors.ink },
26
+ list: { margin: 0, padding: 0, listStyleType: "none" },
27
+ link: { color: colors.accent },
28
+ });
29
+
30
+ export function meta() {
31
+ return [{ title: "{{name}}" }];
32
+ }
33
+
34
+ export default function Home() {
35
+ return (
36
+ <main {...stylex.props(styles.main)}>
37
+ <nav {...stylex.props(styles.card)}>
38
+ <p {...stylex.props(styles.lead)}>What&apos;s next?</p>
39
+ <ul {...stylex.props(styles.list)}>
40
+ {resources.map(({ href, text }) => (
41
+ <li key={href}>
42
+ <a
43
+ {...stylex.props(styles.link)}
44
+ href={href}
45
+ target="_blank"
46
+ rel="noreferrer"
47
+ >
48
+ {text}
49
+ </a>
50
+ </li>
51
+ ))}
52
+ </ul>
53
+ </nav>
54
+ </main>
55
+ );
56
+ }
@@ -0,0 +1,22 @@
1
+ import path from "node:path";
2
+
3
+ import { reactRouter } from "@react-router/dev/vite";
4
+ import stylex from "@stylexjs/unplugin";
5
+ import { varlockVitePlugin } from "@varlock/vite-integration";
6
+ import { defineConfig } from "vite";
7
+
8
+ const rootDir = import.meta.dirname;
9
+
10
+ export default defineConfig({
11
+ resolve: { tsconfigPaths: true },
12
+ optimizeDeps: { entries: ["src/**/*.{ts,tsx}"] },
13
+ plugins: [
14
+ varlockVitePlugin({ ssrInjectMode: "auto-load" }),
15
+ stylex.vite({
16
+ useCSSLayers: { before: ["reset"] },
17
+ aliases: { "@/*": [path.join(rootDir, "src", "*")] },
18
+ unstable_moduleResolution: { type: "commonJS", rootDir },
19
+ }),
20
+ reactRouter(),
21
+ ],
22
+ });
@@ -0,0 +1,4 @@
1
+ ## Styling
2
+
3
+ - Tailwind CSS v4. `apps/web/src/styles/tokens.tailwind.css` binds the tokens with `@theme inline reference`, so `bg-page` reads `var(--color-page)` and `p-gutter` reads `var(--spacing-gutter)`. `apps/web/src/index.css` imports the UI package's `globals.css` first, then both token files.
4
+ - `packages/ui` holds the shadcn/ui components on Base UI, imported as `@{{name}}/ui/components/<name>`. Add one with `pnpm ui:add <name>` rather than writing it by hand. It runs the shadcn CLI in `packages/ui`, then `pnpm lint --fix` and `pnpm format`. The fixes only clear autofixable rules, so if lint makes it exit 1, fix what's left by hand, run `pnpm format` and confirm with `pnpm lint`. Don't count on the pre-commit hook here, as it lets warnings through. Without a terminal, shadcn stops at its overwrite prompt when a file it needs already exists, and exits 0 without the component. So check `packages/ui/src/components/<name>.tsx` exists afterwards. If it doesn't, run `yes n | pnpm ui:add <name> -y`, which keeps your existing files. `--overwrite` replaces them and drops local edits. The components keep shadcn's shape, so `oxlint.styling.ts` turns a few rules off for them.
@@ -0,0 +1,3 @@
1
+ @import "@{{name}}/ui/globals.css";
2
+ @import "./styles/tokens.css";
3
+ @import "./styles/tokens.tailwind.css";
@@ -0,0 +1,7 @@
1
+ @theme inline reference {
2
+ --color-page: var(--color-page);
3
+ --color-ink: var(--color-ink);
4
+ --color-accent: var(--color-accent);
5
+ --spacing-gutter: var(--spacing-gutter);
6
+ --radius-card: var(--radius-card);
7
+ }
@@ -0,0 +1,35 @@
1
+ import { readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+
4
+ import { describe, expect, it } from "{{vitest}}";
5
+
6
+ const here = import.meta.dirname;
7
+
8
+ function declared(block: string): string[] {
9
+ return block.match(/--[a-z][\w-]*(?=:)/g) ?? [];
10
+ }
11
+
12
+ describe("tokens", () => {
13
+ const css = readFileSync(path.join(here, "tokens.css"), "utf8");
14
+ const [light = "", ...modes] = css.match(/\{[^{}]*\}/g) ?? [];
15
+ const defined = new Set(declared(light));
16
+
17
+ it("defines every token in the first block, and a later block only overrides them", () => {
18
+ expect(defined.size).toBeGreaterThan(0);
19
+ for (const mode of modes) {
20
+ expect(declared(mode).filter((name) => !defined.has(name))).toStrictEqual(
21
+ []
22
+ );
23
+ }
24
+ });
25
+
26
+ it("binds only tokens that tokens.css defines", () => {
27
+ const binding = readFileSync(
28
+ path.join(here, "tokens.tailwind.css"),
29
+ "utf8"
30
+ );
31
+ const bound = binding.match(/(?<=var\()--[\w-]+/g) ?? [];
32
+ expect(bound).not.toHaveLength(0);
33
+ expect(bound.filter((name) => !defined.has(name))).toStrictEqual([]);
34
+ });
35
+ });
@@ -0,0 +1,69 @@
1
+ import type { OxlintConfig } from "{{oxlint}}";
2
+ import betterTailwindcss from "eslint-plugin-better-tailwindcss";
3
+
4
+ type Override = NonNullable<OxlintConfig["overrides"]>[number];
5
+
6
+ const shadcnComponentsAsWritten: Override = {
7
+ files: ["packages/ui/src/components/**"],
8
+ rules: {
9
+ "better-tailwindcss/no-unknown-classes": "off",
10
+ "jsx-a11y/label-has-associated-control": "off",
11
+ "jsx-a11y/click-events-have-key-events": "off",
12
+ "jsx-a11y/no-noninteractive-element-interactions": "off",
13
+ },
14
+ };
15
+
16
+ const betterTStackTemplateAsWritten: Override = {
17
+ files: ["apps/web/src/root.tsx", "apps/web/src/routes/_index.tsx"],
18
+ rules: {
19
+ "no-empty-pattern": "off",
20
+ "typescript/strict-boolean-expressions": "off",
21
+ },
22
+ };
23
+
24
+ const registryItemsAsWritten: Override = {
25
+ files: ["apps/web/src/shared/ui/**/*.{ts,tsx}"],
26
+ rules: {
27
+ "jsdoc-js/require-param": "off",
28
+ "jsdoc-js/require-param-description": "off",
29
+ "jsdoc-js/require-returns": "off",
30
+ "jsdoc-js/require-returns-description": "off",
31
+ },
32
+ };
33
+
34
+ const registryMarkerClasses: Override = {
35
+ files: ["apps/web/src/shared/**"],
36
+ rules: {
37
+ "better-tailwindcss/no-unknown-classes": [
38
+ "warn",
39
+ { ignore: ["^cn-", "^toaster$"] },
40
+ ],
41
+ },
42
+ };
43
+
44
+ export const styling = {
45
+ settings: {
46
+ "better-tailwindcss": { cwd: "apps/web", entryPoint: "src/index.css" },
47
+ },
48
+ overrides: [
49
+ {
50
+ files: ["**/*.tsx"],
51
+ jsPlugins: ["eslint-plugin-better-tailwindcss"],
52
+ rules: {
53
+ ...betterTailwindcss.configs.recommended.rules,
54
+ "better-tailwindcss/no-conflicting-classes": "error",
55
+ "better-tailwindcss/no-duplicate-classes": "error",
56
+ "better-tailwindcss/no-deprecated-classes": "error",
57
+ "better-tailwindcss/no-unknown-classes": "warn",
58
+ "better-tailwindcss/enforce-consistent-class-order": "off",
59
+ "better-tailwindcss/enforce-consistent-line-wrapping": "off",
60
+ "better-tailwindcss/enforce-canonical-classes": "warn",
61
+ "better-tailwindcss/enforce-shorthand-classes": "warn",
62
+ },
63
+ },
64
+ shadcnComponentsAsWritten,
65
+ betterTStackTemplateAsWritten,
66
+ registryItemsAsWritten,
67
+ registryMarkerClasses,
68
+ ],
69
+ } satisfies Pick<OxlintConfig, "settings" | "overrides">;
@@ -0,0 +1,5 @@
1
+ import type { ViteUserConfig } from "{{vitestConfig}}";
2
+
3
+ export const styling = {
4
+ plugins: [],
5
+ } satisfies Pick<ViteUserConfig, "plugins">;
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ pnpm exec commitlint --edit "$1"
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ vp staged
@@ -0,0 +1,11 @@
1
+ ## Tests
2
+
3
+ - Tests are Vitest files named `*.test.ts` or `*.test.tsx` next to the code they test, under `apps/*/src` or `packages/*/src`. Import the test API from `vite-plus/test`, as Vite+ ships its own Vitest. Run them with `pnpm test`, which runs `vp test`.
4
+
5
+ ## Lint and format
6
+
7
+ - Vite+ runs the lint, format, test and hook tools from the root `vite.config.ts`. Its `lint` block is `oxlint.config.ts` and its `fmt` block is `.oxfmtrc.json`, so change the rules in those files. Vite+ ignores nested lint and format configs, so a rule for one package goes in an override in `oxlint.config.ts`.
8
+ - `pnpm lint` runs `vp lint` with type-aware rules from the root, and `pnpm lint --fix` applies its fixes. `pnpm format` runs `vp fmt`, and `pnpm format:check` checks without writing.
9
+ - `pnpm typecheck` runs each package's `check-types`, then `tsc` at the root for the config files.
10
+ - The hooks live in `.vite-hooks`, and `pnpm install` installs them through `vp config`. The pre-commit hook runs `vp staged` with the `staged` block in `vite.config.ts`, and the commit-msg hook runs commitlint.
11
+ - Run the app with `pnpm dev`, which runs the framework's own CLI rather than `vp dev`.
@@ -0,0 +1,25 @@
1
+ import type { OxfmtConfig } from "vite-plus/fmt";
2
+ import { defineConfig } from "vite-plus";
3
+
4
+ import oxfmtrc from "./.oxfmtrc.json" with { type: "json" };
5
+ import lint from "./oxlint.config.ts";
6
+ import { styling } from "./vitest.styling.ts";
7
+
8
+ export default defineConfig({
9
+ lint,
10
+ // A JSON import widens each option to string, so it needs the cast.
11
+ fmt: oxfmtrc as OxfmtConfig,
12
+ staged: {
13
+ "*.{ts,tsx}": ["vp lint --fix", "vp fmt --no-error-on-unmatched-pattern"],
14
+ "*.{js,mjs,cjs,json,css,yml,yaml}":
15
+ "vp fmt --no-error-on-unmatched-pattern",
16
+ },
17
+ plugins: styling.plugins,
18
+ resolve: { tsconfigPaths: true },
19
+ test: {
20
+ include: ["{apps,packages}/*/src/**/*.test.{ts,tsx}"],
21
+ passWithNoTests: true,
22
+ clearMocks: true,
23
+ restoreMocks: true,
24
+ },
25
+ });
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "create-creact",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Set up a React project with creact's lint, format, tsconfig, git hooks and tests",
5
+ "keywords": [
6
+ "create",
7
+ "react",
8
+ "react-router",
9
+ "nextjs",
10
+ "tailwind",
11
+ "stylex",
12
+ "monorepo",
13
+ "agents"
14
+ ],
15
+ "homepage": "https://github.com/Joshua-Booth/creact/blob/master/docs/CREATE-CREACT.md",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Joshua-Booth/creact.git",
19
+ "directory": "packages/create-creact"
20
+ },
21
+ "license": "0BSD",
22
+ "author": "Joshua Booth",
23
+ "type": "module",
24
+ "bin": {
25
+ "create-creact": "./dist/main.js"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "layer"
30
+ ],
31
+ "scripts": {
32
+ "prepack": "tsc --project tsconfig.build.json",
33
+ "test": "node --test test/options.test.ts test/cli.test.ts test/plan.test.ts test/ui.test.ts",
34
+ "test:scaffold": "node --test test/scaffold.test.ts"
35
+ },
36
+ "engines": {
37
+ "node": ">=24.22.2"
38
+ }
39
+ }