create-gridland 0.2.53 → 0.2.55

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.
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # create-gridland
2
+
3
+ Scaffold a new [Gridland](https://gridland.io) project.
4
+
5
+ Gridland is a React framework for building terminal apps that also run in the browser — same source, same components, two runtime targets.
6
+
7
+ ## Usage
8
+
9
+ ```bash
10
+ bunx create-gridland my-app
11
+ ```
12
+
13
+ You'll be prompted to choose a template:
14
+
15
+ - **CLI app** — Bun-powered terminal app (`@gridland/bun`)
16
+ - **Vite** — Browser app that renders TUI components on an HTML canvas (`@gridland/web`)
17
+ - **Next.js** — Next.js site with embedded Gridland TUI components
18
+
19
+ Then:
20
+
21
+ ```bash
22
+ cd my-app
23
+ bun install
24
+ bun dev
25
+ ```
26
+
27
+ ## Documentation
28
+
29
+ Full docs at [gridland.io/docs](https://gridland.io/docs)
30
+
31
+ Source: [github.com/thoughtfulllc/gridland](https://github.com/thoughtfulllc/gridland)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gridland",
3
- "version": "0.2.53",
3
+ "version": "0.2.55",
4
4
  "description": "Create a new Gridland project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,8 @@
13
13
  "scripts": {
14
14
  "build": "tsup",
15
15
  "test": "bun test src/scaffold.test.ts src/helpers.test.ts src/cli.test.ts",
16
- "test:e2e": "bun test src/e2e.test.ts --timeout 120000"
16
+ "test:e2e": "bun test src/e2e.test.ts --timeout 120000",
17
+ "prepublishOnly": "bun ../../scripts/check-versions.mjs"
17
18
  },
18
19
  "dependencies": {
19
20
  "commander": "^13.0.0"
@@ -3,27 +3,157 @@
3
3
  // since HTML/SVG type constraints don't apply.
4
4
 
5
5
  import "react"
6
+ import "react/jsx-runtime"
7
+ import "react/jsx-dev-runtime"
6
8
  import "csstype"
7
9
 
10
+ // Strong types for Gridland-only elements (no React 19 conflict)
11
+ interface GridlandBoxProps {
12
+ id?: string
13
+ width?: number | string
14
+ height?: number | string
15
+ flexDirection?: "row" | "column" | "row-reverse" | "column-reverse"
16
+ flexGrow?: number
17
+ flexShrink?: number
18
+ flexWrap?: "no-wrap" | "wrap" | "wrap-reverse"
19
+ alignItems?: "auto" | "flex-start" | "center" | "flex-end" | "stretch" | "baseline"
20
+ justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly"
21
+ alignSelf?: "auto" | "flex-start" | "center" | "flex-end" | "stretch" | "baseline"
22
+ padding?: number | string
23
+ paddingX?: number | string
24
+ paddingY?: number | string
25
+ paddingTop?: number | string
26
+ paddingRight?: number | string
27
+ paddingBottom?: number | string
28
+ paddingLeft?: number | string
29
+ margin?: number | string
30
+ marginX?: number | string
31
+ marginY?: number | string
32
+ marginTop?: number | string
33
+ marginRight?: number | string
34
+ marginBottom?: number | string
35
+ marginLeft?: number | string
36
+ border?: boolean | string[]
37
+ borderStyle?: "single" | "double" | "rounded" | "heavy"
38
+ borderColor?: string
39
+ backgroundColor?: string
40
+ shouldFill?: boolean
41
+ title?: string
42
+ titleAlignment?: "left" | "center" | "right"
43
+ visible?: boolean
44
+ opacity?: number
45
+ gap?: number | string
46
+ rowGap?: number | string
47
+ columnGap?: number | string
48
+ position?: "relative" | "absolute"
49
+ top?: number | string
50
+ right?: number | string
51
+ bottom?: number | string
52
+ left?: number | string
53
+ minWidth?: number | string
54
+ minHeight?: number | string
55
+ maxWidth?: number | string
56
+ maxHeight?: number | string
57
+ zIndex?: number
58
+ overflow?: "visible" | "hidden" | "scroll"
59
+ style?: Record<string, any>
60
+ children?: React.ReactNode
61
+ [key: string]: any
62
+ }
63
+
64
+ // Strong types for Gridland <input> (overrides React's InputHTMLAttributes)
65
+ interface GridlandInputProps {
66
+ value?: string
67
+ placeholder?: string
68
+ maxLength?: number
69
+ focused?: boolean
70
+ onInput?: (value: string) => void
71
+ onSubmit?: (value: string) => void
72
+ onChange?: (value: string) => void
73
+ onKeyDown?: (event: any) => void
74
+ cursorColor?: string
75
+ cursorStyle?: any
76
+ placeholderColor?: string
77
+ textColor?: string
78
+ [key: string]: any
79
+ }
80
+
8
81
  declare module "react" {
9
82
  // Allow any props on all HTML elements
10
83
  interface HTMLAttributes<T> {
11
84
  [key: string]: any
12
85
  }
86
+ // Override input-specific handler types that conflict with Gridland's <input> intrinsic
87
+ interface InputHTMLAttributes<T> {
88
+ onInput?: ((value: string) => void) | undefined
89
+ onSubmit?: ((value: string) => void) | undefined
90
+ [key: string]: any
91
+ }
13
92
  // Allow any props on all SVG elements
14
93
  interface SVGAttributes<T> {
15
94
  [key: string]: any
16
95
  }
96
+ // SVGProps and SVGTextElementAttributes are more specific than SVGAttributes —
97
+ // TypeScript doesn't propagate index signatures through inheritance, so widen each directly
98
+ interface SVGProps<T> {
99
+ [key: string]: any
100
+ }
101
+ interface SVGTextElementAttributes<T> {
102
+ [key: string]: any
103
+ }
17
104
  // Allow any CSS properties (style prop accepts custom renderer props)
18
105
  interface CSSProperties {
19
106
  [key: string]: any
20
107
  }
21
108
  namespace JSX {
22
109
  interface IntrinsicElements {
23
- // Add custom elements not in React's definitions
24
- box: Record<string, any>
110
+ // Custom elements not in React's definitions — strong types for Gridland-only elements
111
+ box: GridlandBoxProps
112
+ scrollbox: Record<string, any>
113
+ "ascii-font": Record<string, any>
114
+ "tab-select": Record<string, any>
115
+ "line-number": Record<string, any>
116
+ code: Record<string, any>
117
+ diff: Record<string, any>
118
+ markdown: Record<string, any>
119
+ textarea: Record<string, any>
120
+ input: GridlandInputProps
121
+ }
122
+ }
123
+ }
124
+
125
+ // Augment jsx-runtime and jsx-dev-runtime for "jsx": "react-jsx" tsconfigs
126
+ // (React 19 resolves JSX types from these modules, not just "react")
127
+ declare module "react/jsx-runtime" {
128
+ namespace JSX {
129
+ interface IntrinsicElements {
130
+ box: GridlandBoxProps
131
+ scrollbox: Record<string, any>
132
+ "ascii-font": Record<string, any>
133
+ "tab-select": Record<string, any>
134
+ "line-number": Record<string, any>
135
+ code: Record<string, any>
136
+ diff: Record<string, any>
137
+ markdown: Record<string, any>
138
+ textarea: Record<string, any>
139
+ input: GridlandInputProps
140
+ }
141
+ }
142
+ }
143
+
144
+ declare module "react/jsx-dev-runtime" {
145
+ namespace JSX {
146
+ interface IntrinsicElements {
147
+ box: GridlandBoxProps
25
148
  scrollbox: Record<string, any>
26
149
  "ascii-font": Record<string, any>
150
+ "tab-select": Record<string, any>
151
+ "line-number": Record<string, any>
152
+ code: Record<string, any>
153
+ diff: Record<string, any>
154
+ markdown: Record<string, any>
155
+ textarea: Record<string, any>
156
+ input: GridlandInputProps
27
157
  }
28
158
  }
29
159
  }
@@ -10,7 +10,4 @@ export default defineConfig({
10
10
  "@": path.resolve(__dirname, "./src"),
11
11
  },
12
12
  },
13
- build: { target: "esnext" },
14
- esbuild: { target: "esnext" },
15
- optimizeDeps: { esbuildOptions: { target: "esnext" } },
16
13
  })