@lotics/cli 0.21.0 → 0.22.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.
- package/dist/src/starter_template.js +43 -5
- package/package.json +1 -1
|
@@ -94,11 +94,13 @@ export function buildStarterTemplate(args) {
|
|
|
94
94
|
noEmit: true,
|
|
95
95
|
jsx: "react-jsx",
|
|
96
96
|
strict: true,
|
|
97
|
-
noUnusedLocals: true,
|
|
98
|
-
noUnusedParameters: true,
|
|
99
97
|
noFallthroughCasesInSwitch: true,
|
|
100
98
|
},
|
|
99
|
+
// Restrict tsc to the project's own sources. tsgo follows
|
|
100
|
+
// transitive imports into node_modules — strict rules
|
|
101
|
+
// (noUnusedLocals etc.) would fire on @lotics/ui's source.
|
|
101
102
|
include: ["src", ".lotics"],
|
|
103
|
+
exclude: ["node_modules"],
|
|
102
104
|
}, null, 2) + "\n",
|
|
103
105
|
},
|
|
104
106
|
{
|
|
@@ -116,18 +118,35 @@ import react from "@vitejs/plugin-react";
|
|
|
116
118
|
// (View, Text, Pressable, StyleSheet, etc.) render in a pure-web environment.
|
|
117
119
|
// .web.tsx is prioritized in resolve.extensions so per-target variants
|
|
118
120
|
// (avatar.web.tsx, wave_avatar.web.tsx) win over the native .tsx file.
|
|
121
|
+
//
|
|
122
|
+
// @lotics/ui/icon.tsx imports from \`lucide-react-native/dist/esm/icons/<name>\`
|
|
123
|
+
// — deep paths that lucide-react-native's package \`exports\` map blocks under
|
|
124
|
+
// Vite's strict resolution. lucide-react has the same per-icon files with no
|
|
125
|
+
// exports map, so we alias the deep path to use it. Web rendering of <svg>
|
|
126
|
+
// is identical to RN-SVG when running under RN-Web.
|
|
119
127
|
export default defineConfig({
|
|
120
128
|
plugins: [react()],
|
|
121
129
|
resolve: {
|
|
122
|
-
alias:
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
alias: [
|
|
131
|
+
{
|
|
132
|
+
find: /^lucide-react-native\\/dist\\/esm\\/icons\\/(.+)$/,
|
|
133
|
+
replacement: "lucide-react/dist/esm/icons/$1",
|
|
134
|
+
},
|
|
135
|
+
{ find: "react-native", replacement: "react-native-web" },
|
|
136
|
+
],
|
|
125
137
|
extensions: [".web.tsx", ".web.ts", ".tsx", ".ts", ".jsx", ".js"],
|
|
126
138
|
},
|
|
127
139
|
build: {
|
|
128
140
|
outDir: "dist",
|
|
129
141
|
sourcemap: true,
|
|
130
142
|
},
|
|
143
|
+
server: {
|
|
144
|
+
// Allow the sandboxed null-origin iframe used by \`lotics app dev\` to
|
|
145
|
+
// fetch HMR client + source modules from the dev server. Production
|
|
146
|
+
// iframe loads modules from api.lotics.ai which already permits null
|
|
147
|
+
// origin via CORS.
|
|
148
|
+
cors: { origin: "*" },
|
|
149
|
+
},
|
|
131
150
|
test: {
|
|
132
151
|
environment: "jsdom",
|
|
133
152
|
},
|
|
@@ -192,6 +211,25 @@ export default function App() {
|
|
|
192
211
|
</View>
|
|
193
212
|
);
|
|
194
213
|
}
|
|
214
|
+
`,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
path: "src/lucide-react-native.d.ts",
|
|
218
|
+
content: `// Type shim for lucide-react-native's deep-icon imports
|
|
219
|
+
// (\`lucide-react-native/dist/esm/icons/<name>\`). The package ships JS-only
|
|
220
|
+
// files without per-file .d.ts. The Vite alias in vite.config.ts rewrites
|
|
221
|
+
// these to lucide-react at bundle time; this declaration covers the
|
|
222
|
+
// TypeScript compile-time gap.
|
|
223
|
+
declare module "lucide-react-native/dist/esm/icons/*" {
|
|
224
|
+
import type { ComponentType } from "react";
|
|
225
|
+
const Icon: ComponentType<{
|
|
226
|
+
size: number;
|
|
227
|
+
color: string;
|
|
228
|
+
fill?: string;
|
|
229
|
+
strokeWidth?: number;
|
|
230
|
+
}>;
|
|
231
|
+
export default Icon;
|
|
232
|
+
}
|
|
195
233
|
`,
|
|
196
234
|
},
|
|
197
235
|
{
|