create-lunar-kit 0.1.18 → 0.1.19

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -335,7 +335,7 @@ function closeInitProject(packageManager, name) {
335
335
  // package.json
336
336
  var package_default = {
337
337
  name: "create-lunar-kit",
338
- version: "0.1.18",
338
+ version: "0.1.19",
339
339
  description: "Create a new React Native app with Lunar Kit and NativeWind pre-configured",
340
340
  author: "Your Name",
341
341
  license: "MIT",
@@ -360,7 +360,7 @@ var package_default = {
360
360
  ],
361
361
  dependencies: {
362
362
  "@clack/prompts": "^1.1.0",
363
- "@lunar-kit/core": "0.1.18",
363
+ "@lunar-kit/core": "0.1.19",
364
364
  chalk: "^5.4.1",
365
365
  commander: "^12.1.0",
366
366
  execa: "^9.6.1",
@@ -378,10 +378,30 @@ var package_default = {
378
378
 
379
379
  // src/index.ts
380
380
  var __filename3 = fileURLToPath2(import.meta.url);
381
+ async function getLatestVersion() {
382
+ try {
383
+ const controller = new AbortController();
384
+ const timeout = setTimeout(() => controller.abort(), 2e3);
385
+ const response = await fetch("https://registry.npmjs.org/create-lunar-kit/latest", {
386
+ signal: controller.signal
387
+ });
388
+ clearTimeout(timeout);
389
+ if (!response.ok) return package_default.version;
390
+ const data = await response.json();
391
+ return data.version || package_default.version;
392
+ } catch {
393
+ return package_default.version;
394
+ }
395
+ }
381
396
  var program = new Command();
382
397
  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) => {
383
398
  renderLogo();
399
+ const latestVersion = await getLatestVersion();
384
400
  intro(chalk3.bold.cyan(`\u{1F319} Create Lunar Kit App (v${package_default.version})`));
401
+ if (latestVersion !== package_default.version && process.env.NODE_ENV !== "development") {
402
+ console.log(chalk3.dim(`New version available: ${latestVersion} (you have ${package_default.version})`));
403
+ console.log(chalk3.dim("Please update to the latest version for the best experience.\n"));
404
+ }
385
405
  const name = projectName || await text({
386
406
  message: "What is your project named?",
387
407
  placeholder: "my-lunar-app",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lunar-kit",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
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",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@clack/prompts": "^1.1.0",
28
- "@lunar-kit/core": "0.1.18",
28
+ "@lunar-kit/core": "0.1.19",
29
29
  "chalk": "^5.4.1",
30
30
  "commander": "^12.1.0",
31
31
  "execa": "^9.6.1",