newcandies 0.1.2 → 0.1.4
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 +94 -11
- package/package.json +16 -6
- package/templates/default/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/templates/default/assets/images/adaptive-icon.png +0 -0
- package/templates/default/assets/images/favicon.png +0 -0
- package/templates/default/assets/images/icon.png +0 -0
- package/templates/default/assets/images/splash-icon.png +0 -0
package/dist/index.js
CHANGED
|
@@ -128,6 +128,34 @@ function TEMPLATESafe(type) {
|
|
|
128
128
|
return [{ value: "default", label: "Default (Expo Router + Uniwind)" }];
|
|
129
129
|
}
|
|
130
130
|
async function writeBaseline({ dest, name, withQuery }) {
|
|
131
|
+
const baseDeps = {
|
|
132
|
+
// Expo core + platform libs
|
|
133
|
+
expo: "latest",
|
|
134
|
+
"expo-constants": "~18.0.10",
|
|
135
|
+
"expo-font": "~14.0.9",
|
|
136
|
+
"expo-linking": "~8.0.8",
|
|
137
|
+
"expo-router": "~6.0.14",
|
|
138
|
+
"expo-splash-screen": "~31.0.10",
|
|
139
|
+
"expo-status-bar": "~3.0.8",
|
|
140
|
+
"expo-web-browser": "~15.0.9",
|
|
141
|
+
// React ecosystem
|
|
142
|
+
react: "19.1.0",
|
|
143
|
+
"react-dom": "19.1.0",
|
|
144
|
+
"react-native": "0.81.5",
|
|
145
|
+
"react-native-web": "~0.21.0",
|
|
146
|
+
// RN libs
|
|
147
|
+
"react-native-reanimated": "~4.1.1",
|
|
148
|
+
"react-native-gesture-handler": "latest",
|
|
149
|
+
"react-native-safe-area-context": "~5.6.0",
|
|
150
|
+
"react-native-screens": "~4.16.0",
|
|
151
|
+
"react-native-worklets": "0.5.1",
|
|
152
|
+
// Styling
|
|
153
|
+
tailwindcss: "^4.1.16",
|
|
154
|
+
uniwind: "^1.0.0"
|
|
155
|
+
};
|
|
156
|
+
if (withQuery) {
|
|
157
|
+
baseDeps["@tanstack/react-query"] = "latest";
|
|
158
|
+
}
|
|
131
159
|
const pkg = {
|
|
132
160
|
name,
|
|
133
161
|
version: "0.0.0",
|
|
@@ -137,16 +165,54 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
137
165
|
start: "expo start",
|
|
138
166
|
android: "expo run:android",
|
|
139
167
|
ios: "expo run:ios"
|
|
168
|
+
},
|
|
169
|
+
dependencies: baseDeps,
|
|
170
|
+
devDependencies: {
|
|
171
|
+
"@types/react": "~19.1.0",
|
|
172
|
+
typescript: "~5.9.2"
|
|
140
173
|
}
|
|
141
174
|
};
|
|
142
175
|
await fs.writeJSON(path.join(dest, "package.json"), pkg, { spaces: 2 });
|
|
176
|
+
const slug = String(name).toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
|
|
177
|
+
const pkgNameSegment = slug.replace(/-/g, "") || "app";
|
|
178
|
+
const bundleId = `com.example.${pkgNameSegment}`;
|
|
143
179
|
const appJson = {
|
|
144
180
|
expo: {
|
|
145
181
|
name,
|
|
146
|
-
slug
|
|
147
|
-
|
|
182
|
+
slug,
|
|
183
|
+
version: "1.0.0",
|
|
184
|
+
orientation: "portrait",
|
|
185
|
+
icon: "./assets/images/icon.png",
|
|
186
|
+
scheme: slug,
|
|
187
|
+
userInterfaceStyle: "automatic",
|
|
188
|
+
newArchEnabled: true,
|
|
189
|
+
splash: {
|
|
190
|
+
image: "./assets/images/splash-icon.png",
|
|
191
|
+
resizeMode: "contain",
|
|
192
|
+
backgroundColor: "#ffffff"
|
|
193
|
+
},
|
|
194
|
+
ios: {
|
|
195
|
+
supportsTablet: true,
|
|
196
|
+
bundleIdentifier: bundleId
|
|
197
|
+
},
|
|
198
|
+
android: {
|
|
199
|
+
adaptiveIcon: {
|
|
200
|
+
foregroundImage: "./assets/images/adaptive-icon.png",
|
|
201
|
+
backgroundColor: "#ffffff"
|
|
202
|
+
},
|
|
203
|
+
edgeToEdgeEnabled: true,
|
|
204
|
+
predictiveBackGestureEnabled: false,
|
|
205
|
+
package: bundleId
|
|
206
|
+
},
|
|
207
|
+
web: {
|
|
208
|
+
bundler: "metro",
|
|
209
|
+
output: "static",
|
|
210
|
+
favicon: "./assets/images/favicon.png"
|
|
211
|
+
},
|
|
148
212
|
plugins: ["expo-router"],
|
|
149
|
-
experiments: {
|
|
213
|
+
experiments: {
|
|
214
|
+
typedRoutes: true
|
|
215
|
+
}
|
|
150
216
|
}
|
|
151
217
|
};
|
|
152
218
|
await fs.writeJSON(path.join(dest, "app.json"), appJson, { spaces: 2 });
|
|
@@ -155,7 +221,6 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
155
221
|
return {
|
|
156
222
|
presets: ['babel-preset-expo'],
|
|
157
223
|
plugins: [
|
|
158
|
-
'expo-router/babel',
|
|
159
224
|
'react-native-reanimated/plugin'
|
|
160
225
|
]
|
|
161
226
|
};
|
|
@@ -168,8 +233,8 @@ const { withUniwindConfig } = require('uniwind/metro');
|
|
|
168
233
|
const config = getDefaultConfig(__dirname);
|
|
169
234
|
|
|
170
235
|
module.exports = withUniwindConfig(config, {
|
|
171
|
-
cssEntryFile: './
|
|
172
|
-
dtsFile: './
|
|
236
|
+
cssEntryFile: './global.css',
|
|
237
|
+
dtsFile: './uniwind-types.d.ts',
|
|
173
238
|
});
|
|
174
239
|
`;
|
|
175
240
|
await fs.writeFile(path.join(dest, "metro.config.js"), metro);
|
|
@@ -179,13 +244,27 @@ module.exports = withUniwindConfig(config, {
|
|
|
179
244
|
jsx: "react-native",
|
|
180
245
|
target: "ES2020",
|
|
181
246
|
moduleResolution: "node",
|
|
182
|
-
types: ["react", "react-native"
|
|
247
|
+
types: ["react", "react-native"]
|
|
183
248
|
},
|
|
184
|
-
include: ["app", "./
|
|
249
|
+
include: ["app", "./uniwind-types.d.ts", "./expo-env.d.ts"]
|
|
185
250
|
};
|
|
186
251
|
await fs.writeJSON(path.join(dest, "tsconfig.json"), tsconfig, { spaces: 2 });
|
|
252
|
+
const expoEnv = `/// <reference types="expo" />
|
|
253
|
+
/// <reference types="expo-router" />
|
|
254
|
+
`;
|
|
255
|
+
await fs.writeFile(path.join(dest, "expo-env.d.ts"), expoEnv);
|
|
187
256
|
const appDir = path.join(dest, "app");
|
|
188
257
|
await fs.ensureDir(appDir);
|
|
258
|
+
const easJson = {
|
|
259
|
+
cli: { version: ">= 7.0.0" },
|
|
260
|
+
build: {
|
|
261
|
+
development: { android: { buildType: "apk" }, developmentClient: true, distribution: "internal" },
|
|
262
|
+
preview: { distribution: "internal" },
|
|
263
|
+
production: {}
|
|
264
|
+
},
|
|
265
|
+
submit: { production: {} }
|
|
266
|
+
};
|
|
267
|
+
await fs.writeJSON(path.join(dest, "eas.json"), easJson, { spaces: 2 });
|
|
189
268
|
const globalCss = `@import 'tailwindcss';
|
|
190
269
|
@import 'uniwind';
|
|
191
270
|
|
|
@@ -204,10 +283,10 @@ module.exports = withUniwindConfig(config, {
|
|
|
204
283
|
}
|
|
205
284
|
}
|
|
206
285
|
`;
|
|
207
|
-
await fs.writeFile(path.join(
|
|
286
|
+
await fs.writeFile(path.join(dest, "global.css"), globalCss);
|
|
208
287
|
{
|
|
209
288
|
const rootLayout = withQuery ? `import 'react-native-gesture-handler';
|
|
210
|
-
import '
|
|
289
|
+
import '../global.css';
|
|
211
290
|
import { Slot } from 'expo-router';
|
|
212
291
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
213
292
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
@@ -229,7 +308,7 @@ const RootLayout = () => {
|
|
|
229
308
|
|
|
230
309
|
export default RootLayout;
|
|
231
310
|
` : `import 'react-native-gesture-handler';
|
|
232
|
-
import '
|
|
311
|
+
import '../global.css';
|
|
233
312
|
import { Slot } from 'expo-router';
|
|
234
313
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
235
314
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
@@ -284,6 +363,10 @@ export default Settings;
|
|
|
284
363
|
}
|
|
285
364
|
async function applyTemplateOverlay({ dest, type, template, category, variant }) {
|
|
286
365
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
366
|
+
const defaultSrc = path.join(__dirname, "..", "templates", "default");
|
|
367
|
+
if (await fs.pathExists(defaultSrc)) {
|
|
368
|
+
await fs.copy(defaultSrc, dest, { overwrite: false, errorOnExist: false });
|
|
369
|
+
}
|
|
287
370
|
let src = null;
|
|
288
371
|
if (type === "app-brief" || type === "mini-app-brief") {
|
|
289
372
|
if (category && variant) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newcandies",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Scaffold Expo Router + Uniwind React Native apps with layered templates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,16 +12,26 @@
|
|
|
12
12
|
"README.md",
|
|
13
13
|
"LICENSE"
|
|
14
14
|
],
|
|
15
|
-
"keywords": [
|
|
15
|
+
"keywords": [
|
|
16
|
+
"expo",
|
|
17
|
+
"react-native",
|
|
18
|
+
"expo-router",
|
|
19
|
+
"tailwind",
|
|
20
|
+
"uniwind",
|
|
21
|
+
"cli",
|
|
22
|
+
"scaffold"
|
|
23
|
+
],
|
|
16
24
|
"license": "MIT",
|
|
17
|
-
"engines": {
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
18
28
|
"scripts": {
|
|
19
|
-
"build": "tsup src/index.ts --format esm --clean",
|
|
20
|
-
"dev": "tsup src/index.ts --format esm --watch --clean=false",
|
|
29
|
+
"build": "tsup src/index.ts --format esm --clean",
|
|
30
|
+
"dev": "tsup src/index.ts --format esm --watch --clean=false",
|
|
21
31
|
"start": "node dist/index.js",
|
|
22
32
|
"prepublishOnly": "npm run build"
|
|
23
33
|
},
|
|
24
|
-
"dependencies": {
|
|
34
|
+
"dependencies": {
|
|
25
35
|
"@clack/prompts": "1.0.0-alpha.6",
|
|
26
36
|
"commander": "14.0.2",
|
|
27
37
|
"execa": "9.6.0",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|