create-lunar-kit 0.1.14 → 0.1.16
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 +66 -6
- 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,30 @@ 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 PACKAGES_DIR = path.resolve(__dirname2, "../../..");
|
|
66
|
+
var CORE_ROOT = path.join(PACKAGES_DIR, "core", "src");
|
|
67
|
+
var CORE_TEMPLATES_PATH = path.join(CORE_ROOT, "templates");
|
|
68
|
+
var CORE_SOURCE_PATH = CORE_ROOT;
|
|
62
69
|
function copyTemplate(templatePath, destPath) {
|
|
63
|
-
const
|
|
70
|
+
const fullPath = path.join(CORE_TEMPLATES_PATH, templatePath);
|
|
71
|
+
if (!fs.existsSync(fullPath)) {
|
|
72
|
+
throw new Error(`Template not found: ${fullPath}`);
|
|
73
|
+
}
|
|
74
|
+
const content = fs.readFileSync(fullPath);
|
|
64
75
|
fs.writeFileSync(destPath, content);
|
|
65
76
|
}
|
|
66
77
|
function copySource(sourcePath, destPath) {
|
|
67
|
-
const
|
|
78
|
+
const fullPath = path.join(CORE_SOURCE_PATH, sourcePath);
|
|
79
|
+
if (!fs.existsSync(fullPath)) {
|
|
80
|
+
throw new Error(`Source not found: ${fullPath}`);
|
|
81
|
+
}
|
|
82
|
+
const content = fs.readFileSync(fullPath);
|
|
68
83
|
fs.writeFileSync(destPath, content);
|
|
69
84
|
}
|
|
70
85
|
async function createSrcStructure(projectPath, navigation) {
|
|
@@ -317,12 +332,57 @@ function closeInitProject(packageManager, name) {
|
|
|
317
332
|
console.log(chalk2.dim("\nHappy coding! \u{1F319}\n"));
|
|
318
333
|
}
|
|
319
334
|
|
|
335
|
+
// package.json
|
|
336
|
+
var package_default = {
|
|
337
|
+
name: "create-lunar-kit",
|
|
338
|
+
version: "0.1.16",
|
|
339
|
+
description: "Create a new React Native app with Lunar Kit and NativeWind pre-configured",
|
|
340
|
+
author: "Your Name",
|
|
341
|
+
license: "MIT",
|
|
342
|
+
bin: {
|
|
343
|
+
"create-lunar-kit": "./dist/index.js"
|
|
344
|
+
},
|
|
345
|
+
type: "module",
|
|
346
|
+
files: [
|
|
347
|
+
"dist"
|
|
348
|
+
],
|
|
349
|
+
scripts: {
|
|
350
|
+
build: "tsup",
|
|
351
|
+
dev: "tsup --watch",
|
|
352
|
+
prepublishOnly: "bun run build"
|
|
353
|
+
},
|
|
354
|
+
keywords: [
|
|
355
|
+
"react-native",
|
|
356
|
+
"expo",
|
|
357
|
+
"nativewind",
|
|
358
|
+
"create-app",
|
|
359
|
+
"starter"
|
|
360
|
+
],
|
|
361
|
+
dependencies: {
|
|
362
|
+
"@lunar-kit/core": "0.1.16",
|
|
363
|
+
chalk: "^5.4.1",
|
|
364
|
+
commander: "^12.1.0",
|
|
365
|
+
execa: "^9.6.1",
|
|
366
|
+
"fs-extra": "^11.2.0",
|
|
367
|
+
ora: "^8.1.1",
|
|
368
|
+
prompts: "^2.4.2"
|
|
369
|
+
},
|
|
370
|
+
devDependencies: {
|
|
371
|
+
"@types/fs-extra": "^11.0.4",
|
|
372
|
+
"@types/prompts": "^2.4.9",
|
|
373
|
+
tsup: "^8.3.5",
|
|
374
|
+
typescript: "^5.7.3"
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
|
|
320
378
|
// src/index.ts
|
|
321
|
-
var
|
|
379
|
+
var __filename3 = fileURLToPath2(import.meta.url);
|
|
322
380
|
var program = new Command();
|
|
323
381
|
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
382
|
renderLogo();
|
|
325
|
-
console.log(chalk3.bold.cyan(
|
|
383
|
+
console.log(chalk3.bold.cyan(`
|
|
384
|
+
\u{1F319} Create Lunar Kit App (v${package_default.version})
|
|
385
|
+
`));
|
|
326
386
|
const response = await prompts([
|
|
327
387
|
{
|
|
328
388
|
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.16",
|
|
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.16",
|
|
28
28
|
"chalk": "^5.4.1",
|
|
29
29
|
"commander": "^12.1.0",
|
|
30
30
|
"execa": "^9.6.1",
|