create-lunar-kit 0.1.13 → 0.1.15
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 +59 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import ora from "ora";
|
|
|
8
8
|
import { execa } from "execa";
|
|
9
9
|
import fs2 from "fs-extra";
|
|
10
10
|
import path2 from "path";
|
|
11
|
-
import { fileURLToPath } from "url";
|
|
11
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
12
12
|
|
|
13
13
|
// src/assets/logo.ts
|
|
14
14
|
import chalk from "chalk";
|
|
@@ -56,15 +56,22 @@ var renderLogo = () => {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
// src/commands/init.ts
|
|
59
|
+
import { LOCAL_COMPONENTS_PATH } from "@lunar-kit/core";
|
|
59
60
|
import fs from "fs-extra";
|
|
60
61
|
import path from "path";
|
|
61
|
-
import {
|
|
62
|
+
import { fileURLToPath } from "url";
|
|
63
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
64
|
+
var __dirname2 = path.dirname(__filename2);
|
|
65
|
+
var CORE_TEMPLATES_PATH = path.join(__dirname2, "../../node_modules/@lunar-kit/core/src/templates");
|
|
66
|
+
var CORE_SOURCE_PATH = path.join(__dirname2, "../../node_modules/@lunar-kit/core/src");
|
|
62
67
|
function copyTemplate(templatePath, destPath) {
|
|
63
|
-
const
|
|
68
|
+
const fullPath = path.join(CORE_TEMPLATES_PATH, templatePath);
|
|
69
|
+
const content = fs.readFileSync(fullPath);
|
|
64
70
|
fs.writeFileSync(destPath, content);
|
|
65
71
|
}
|
|
66
72
|
function copySource(sourcePath, destPath) {
|
|
67
|
-
const
|
|
73
|
+
const fullPath = path.join(CORE_SOURCE_PATH, sourcePath);
|
|
74
|
+
const content = fs.readFileSync(fullPath);
|
|
68
75
|
fs.writeFileSync(destPath, content);
|
|
69
76
|
}
|
|
70
77
|
async function createSrcStructure(projectPath, navigation) {
|
|
@@ -194,7 +201,7 @@ async function updatePackageJson(projectPath, navigation, features) {
|
|
|
194
201
|
"react-native-reanimated": "~4.1.1",
|
|
195
202
|
"react-native-safe-area-context": "^5.6.2",
|
|
196
203
|
"react-native-screens": "~4.16.0",
|
|
197
|
-
|
|
204
|
+
// 'react-native-worklets': '0.5.1',
|
|
198
205
|
"zustand": "^5.0.3"
|
|
199
206
|
};
|
|
200
207
|
if (navigation === "expo-router") {
|
|
@@ -317,12 +324,57 @@ function closeInitProject(packageManager, name) {
|
|
|
317
324
|
console.log(chalk2.dim("\nHappy coding! \u{1F319}\n"));
|
|
318
325
|
}
|
|
319
326
|
|
|
327
|
+
// package.json
|
|
328
|
+
var package_default = {
|
|
329
|
+
name: "create-lunar-kit",
|
|
330
|
+
version: "0.1.15",
|
|
331
|
+
description: "Create a new React Native app with Lunar Kit and NativeWind pre-configured",
|
|
332
|
+
author: "Your Name",
|
|
333
|
+
license: "MIT",
|
|
334
|
+
bin: {
|
|
335
|
+
"create-lunar-kit": "./dist/index.js"
|
|
336
|
+
},
|
|
337
|
+
type: "module",
|
|
338
|
+
files: [
|
|
339
|
+
"dist"
|
|
340
|
+
],
|
|
341
|
+
scripts: {
|
|
342
|
+
build: "tsup",
|
|
343
|
+
dev: "tsup --watch",
|
|
344
|
+
prepublishOnly: "bun run build"
|
|
345
|
+
},
|
|
346
|
+
keywords: [
|
|
347
|
+
"react-native",
|
|
348
|
+
"expo",
|
|
349
|
+
"nativewind",
|
|
350
|
+
"create-app",
|
|
351
|
+
"starter"
|
|
352
|
+
],
|
|
353
|
+
dependencies: {
|
|
354
|
+
"@lunar-kit/core": "0.1.15",
|
|
355
|
+
chalk: "^5.4.1",
|
|
356
|
+
commander: "^12.1.0",
|
|
357
|
+
execa: "^9.6.1",
|
|
358
|
+
"fs-extra": "^11.2.0",
|
|
359
|
+
ora: "^8.1.1",
|
|
360
|
+
prompts: "^2.4.2"
|
|
361
|
+
},
|
|
362
|
+
devDependencies: {
|
|
363
|
+
"@types/fs-extra": "^11.0.4",
|
|
364
|
+
"@types/prompts": "^2.4.9",
|
|
365
|
+
tsup: "^8.3.5",
|
|
366
|
+
typescript: "^5.7.3"
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
320
370
|
// src/index.ts
|
|
321
|
-
var
|
|
371
|
+
var __filename3 = fileURLToPath2(import.meta.url);
|
|
322
372
|
var program = new Command();
|
|
323
373
|
program.name("create-lunar-kit").description("Create a new React Native app with Lunar Kit").argument("[project-name]", "Name of your project").action(async (projectName) => {
|
|
324
374
|
renderLogo();
|
|
325
|
-
console.log(chalk3.bold.cyan(
|
|
375
|
+
console.log(chalk3.bold.cyan(`
|
|
376
|
+
\u{1F319} Create Lunar Kit App (v${package_default.version})
|
|
377
|
+
`));
|
|
326
378
|
const response = await prompts([
|
|
327
379
|
{
|
|
328
380
|
type: projectName ? null : "text",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-lunar-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Create a new React Native app with Lunar Kit and NativeWind pre-configured",
|
|
5
5
|
"author": "Your Name",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"starter"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lunar-kit/core": "0.1.
|
|
27
|
+
"@lunar-kit/core": "0.1.15",
|
|
28
28
|
"chalk": "^5.4.1",
|
|
29
29
|
"commander": "^12.1.0",
|
|
30
30
|
"execa": "^9.6.1",
|