newcandies 0.1.6 → 0.1.7
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/index.js +73 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -157,6 +157,7 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
157
157
|
if (withQuery) {
|
|
158
158
|
baseDeps["@tanstack/react-query"] = "latest";
|
|
159
159
|
}
|
|
160
|
+
baseDeps["tailwind-merge"] = "latest";
|
|
160
161
|
const pkg = {
|
|
161
162
|
name,
|
|
162
163
|
version: "0.0.0",
|
|
@@ -170,7 +171,8 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
170
171
|
dependencies: baseDeps,
|
|
171
172
|
devDependencies: {
|
|
172
173
|
"@types/react": "~19.1.0",
|
|
173
|
-
typescript: "~5.9.2"
|
|
174
|
+
typescript: "~5.9.2",
|
|
175
|
+
"babel-plugin-module-resolver": "latest"
|
|
174
176
|
}
|
|
175
177
|
};
|
|
176
178
|
await fs.writeJSON(path.join(dest, "package.json"), pkg, { spaces: 2 });
|
|
@@ -210,7 +212,7 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
210
212
|
output: "static",
|
|
211
213
|
favicon: "./assets/images/favicon.png"
|
|
212
214
|
},
|
|
213
|
-
plugins: ["expo-router"],
|
|
215
|
+
plugins: [["expo-router", { appRoot: "./src/app" }]],
|
|
214
216
|
experiments: {
|
|
215
217
|
typedRoutes: true
|
|
216
218
|
}
|
|
@@ -222,6 +224,7 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
222
224
|
return {
|
|
223
225
|
presets: ['babel-preset-expo'],
|
|
224
226
|
plugins: [
|
|
227
|
+
['module-resolver', { alias: { '~': './' } }],
|
|
225
228
|
'react-native-reanimated/plugin'
|
|
226
229
|
]
|
|
227
230
|
};
|
|
@@ -240,22 +243,79 @@ module.exports = withUniwindConfig(config, {
|
|
|
240
243
|
`;
|
|
241
244
|
await fs.writeFile(path.join(dest, "metro.config.js"), metro);
|
|
242
245
|
const tsconfig = {
|
|
246
|
+
extends: "expo/tsconfig.base",
|
|
243
247
|
compilerOptions: {
|
|
244
248
|
strict: true,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
types: ["react", "react-native"]
|
|
249
|
+
paths: {
|
|
250
|
+
"~/*": ["./*"]
|
|
251
|
+
}
|
|
249
252
|
},
|
|
250
|
-
include: [
|
|
253
|
+
include: [
|
|
254
|
+
"**/*.ts",
|
|
255
|
+
"**/*.tsx",
|
|
256
|
+
".expo/types/**/*.ts",
|
|
257
|
+
"expo-env.d.ts",
|
|
258
|
+
"./uniwind-types.d.ts"
|
|
259
|
+
]
|
|
251
260
|
};
|
|
252
261
|
await fs.writeJSON(path.join(dest, "tsconfig.json"), tsconfig, { spaces: 2 });
|
|
253
262
|
const expoEnv = `/// <reference types="expo" />
|
|
254
263
|
/// <reference types="expo-router" />
|
|
255
264
|
`;
|
|
256
265
|
await fs.writeFile(path.join(dest, "expo-env.d.ts"), expoEnv);
|
|
257
|
-
const
|
|
266
|
+
const srcDir = path.join(dest, "src");
|
|
267
|
+
const appDir = path.join(srcDir, "app");
|
|
258
268
|
await fs.ensureDir(appDir);
|
|
269
|
+
await fs.ensureDir(path.join(srcDir, "core"));
|
|
270
|
+
await fs.ensureDir(path.join(srcDir, "api"));
|
|
271
|
+
await fs.ensureDir(path.join(srcDir, "lib"));
|
|
272
|
+
await fs.ensureDir(path.join(srcDir, "types"));
|
|
273
|
+
await fs.ensureDir(path.join(srcDir, "components", "screens", "home"));
|
|
274
|
+
await fs.ensureDir(path.join(srcDir, "components", "screens", "profile"));
|
|
275
|
+
await fs.ensureDir(path.join(srcDir, "components", "core"));
|
|
276
|
+
const textCore = `import { Text as RNText, TextProps } from 'react-native';
|
|
277
|
+
import { twMerge } from 'tailwind-merge';
|
|
278
|
+
|
|
279
|
+
type TypographyVariant =
|
|
280
|
+
| 'title'
|
|
281
|
+
| 'subtitle'
|
|
282
|
+
| 'body'
|
|
283
|
+
| 'caption'
|
|
284
|
+
| 'button'
|
|
285
|
+
| 'display'
|
|
286
|
+
| 'caption-primary'
|
|
287
|
+
| 'body-primary'
|
|
288
|
+
| 'subtitle-primary';
|
|
289
|
+
|
|
290
|
+
interface TextComponentProps extends TextProps {
|
|
291
|
+
className?: string;
|
|
292
|
+
variant?: TypographyVariant;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const variantStyles: Record<TypographyVariant, string> = {
|
|
296
|
+
title: 'text-2xl font-bold',
|
|
297
|
+
subtitle: 'text-xl font-semibold',
|
|
298
|
+
'subtitle-primary': 'text-xl font-semibold text-primary',
|
|
299
|
+
body: 'text-base',
|
|
300
|
+
'body-primary': 'text-base text-primary',
|
|
301
|
+
caption: 'text-sm font-medium',
|
|
302
|
+
'caption-primary': 'text-sm text-primary font-medium',
|
|
303
|
+
button: 'text-xl text-primary font-semibold text-white text-center',
|
|
304
|
+
display: 'text-3x font-bold',
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const Text = ({ variant = 'body', children, className, ...props }: TextComponentProps) => {
|
|
308
|
+
const textStyle = twMerge('text-black', variantStyles[variant], className);
|
|
309
|
+
return (
|
|
310
|
+
<RNText className={textStyle} {...props}>
|
|
311
|
+
{children}
|
|
312
|
+
</RNText>
|
|
313
|
+
);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
export default Text;
|
|
317
|
+
`;
|
|
318
|
+
await fs.writeFile(path.join(srcDir, "components", "core", "text.tsx"), textCore);
|
|
259
319
|
const easJson = {
|
|
260
320
|
cli: { version: ">= 7.0.0" },
|
|
261
321
|
build: {
|
|
@@ -292,7 +352,7 @@ import { Stack } from "expo-router";
|
|
|
292
352
|
import * as SplashScreen from "expo-splash-screen";
|
|
293
353
|
import { useEffect } from "react";
|
|
294
354
|
import "react-native-reanimated";
|
|
295
|
-
import "
|
|
355
|
+
import "../../global.css";
|
|
296
356
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
297
357
|
|
|
298
358
|
export { ErrorBoundary } from "expo-router";
|
|
@@ -307,7 +367,7 @@ const queryClient = new QueryClient();
|
|
|
307
367
|
|
|
308
368
|
export default function RootLayout() {
|
|
309
369
|
const [loaded, error] = useFonts({
|
|
310
|
-
SpaceMono: require("
|
|
370
|
+
SpaceMono: require("../../assets/fonts/SpaceMono-Regular.ttf"),
|
|
311
371
|
...FontAwesome.font,
|
|
312
372
|
});
|
|
313
373
|
|
|
@@ -346,7 +406,7 @@ import { Stack } from "expo-router";
|
|
|
346
406
|
import * as SplashScreen from "expo-splash-screen";
|
|
347
407
|
import { useEffect } from "react";
|
|
348
408
|
import "react-native-reanimated";
|
|
349
|
-
import "
|
|
409
|
+
import "../../global.css";
|
|
350
410
|
|
|
351
411
|
export { ErrorBoundary } from "expo-router";
|
|
352
412
|
|
|
@@ -358,7 +418,7 @@ SplashScreen.preventAutoHideAsync();
|
|
|
358
418
|
|
|
359
419
|
export default function RootLayout() {
|
|
360
420
|
const [loaded, error] = useFonts({
|
|
361
|
-
SpaceMono: require("
|
|
421
|
+
SpaceMono: require("../../assets/fonts/SpaceMono-Regular.ttf"),
|
|
362
422
|
...FontAwesome.font,
|
|
363
423
|
});
|
|
364
424
|
|
|
@@ -395,6 +455,7 @@ function RootLayoutNav() {
|
|
|
395
455
|
import FontAwesome from '@expo/vector-icons/FontAwesome';
|
|
396
456
|
import { Link, Tabs } from 'expo-router';
|
|
397
457
|
import { Pressable } from 'react-native';
|
|
458
|
+
import '../../global.css';
|
|
398
459
|
|
|
399
460
|
function TabBarIcon(props: { name: React.ComponentProps<typeof FontAwesome>['name']; color: string; }) {
|
|
400
461
|
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />;
|