create-lacspace-app 2.13.0 → 2.13.1

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/README.md CHANGED
@@ -202,6 +202,8 @@ Every template is Next.js 15 App Router + React 19 + Tailwind v4 — dark, moder
202
202
  | `--no-install` | skip installing dependencies |
203
203
  | `--no-git` | skip git init |
204
204
  | `-y, --yes` | accept defaults (needs a project name) |
205
+ | `-h, --help` | show every flag |
206
+ | `-v, --version` | print the installed version |
205
207
 
206
208
  ### 🎨 Themes
207
209
 
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, readdirSync, mkdirSync, writeFileSync } from 'fs';
3
- import { resolve, basename, join, dirname } from 'path';
2
+ import { realpathSync, existsSync, readdirSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
3
+ import { basename, resolve, join, dirname } from 'path';
4
4
  import { createInterface } from 'readline/promises';
5
- import { argv, stdout, exit, stdin, cwd } from 'process';
5
+ import { stdout, exit, argv, stdin, cwd } from 'process';
6
6
  import { spawnSync } from 'child_process';
7
- import { pathToFileURL } from 'url';
7
+ import { pathToFileURL, fileURLToPath } from 'url';
8
8
 
9
9
  var C = {
10
10
  reset: "\x1B[0m",
@@ -8014,9 +8014,24 @@ function backendFiles(ctx) {
8014
8014
  }
8015
8015
  return files;
8016
8016
  }
8017
+ function cliVersion() {
8018
+ try {
8019
+ const here = dirname(fileURLToPath(import.meta.url));
8020
+ for (const rel of ["../package.json", "./package.json", "../../package.json"]) {
8021
+ const file = resolve(here, rel);
8022
+ if (!existsSync(file)) continue;
8023
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
8024
+ const version = parsed.version;
8025
+ const name = parsed.name;
8026
+ if (typeof version === "string" && (name === "create-lacspace-app" || rel !== "../../package.json")) return version;
8027
+ }
8028
+ } catch {
8029
+ }
8030
+ return "unknown";
8031
+ }
8017
8032
  var splitList = (s) => s.split(",").map((x) => x.trim()).filter(Boolean);
8018
8033
  function parseArgs(list) {
8019
- const a = { features: [], yes: false, install: true, git: true, pm: "npm", help: false, dryRun: false };
8034
+ const a = { features: [], yes: false, install: true, git: true, pm: "npm", help: false, version: false, dryRun: false, unknown: [] };
8020
8035
  for (let i = 0; i < list.length; i++) {
8021
8036
  const arg = list[i];
8022
8037
  const next = () => list[++i] ?? "";
@@ -8039,6 +8054,7 @@ function parseArgs(list) {
8039
8054
  } else if (arg === "--recipe") a.recipe = next();
8040
8055
  else if (arg.startsWith("--recipe=")) a.recipe = arg.slice(9);
8041
8056
  else if (arg === "-h" || arg === "--help") a.help = true;
8057
+ else if (arg === "-v" || arg === "-V" || arg === "--version") a.version = true;
8042
8058
  else if (arg.startsWith("--template=")) a.template = arg.slice(11);
8043
8059
  else if (arg.startsWith("--theme=")) a.theme = arg.slice(8);
8044
8060
  else if (arg.startsWith("--accent=")) a.theme = arg.slice(9);
@@ -8046,6 +8062,7 @@ function parseArgs(list) {
8046
8062
  else if (arg.startsWith("--with=")) a.features.push(...splitList(arg.slice(7)));
8047
8063
  else if (arg.startsWith("--features=")) a.features.push(...splitList(arg.slice(11)));
8048
8064
  else if (!arg.startsWith("-") && !a.name) a.name = arg;
8065
+ else if (arg.startsWith("-")) a.unknown.push(arg);
8049
8066
  }
8050
8067
  return a;
8051
8068
  }
@@ -8153,6 +8170,7 @@ ${c("bold", "Options")}
8153
8170
  --no-git Skip git init
8154
8171
  -y, --yes Accept defaults (needs <name>)
8155
8172
  -h, --help Show this help
8173
+ -v, --version Print the version and exit
8156
8174
 
8157
8175
  ${c("bold", "Feature add-ons")} ${c("dim", "(--with) \u2014 free & keyless, local by default")}
8158
8176
  ${FEATURES.map((f) => ` ${f.key.padEnd(11)} ${f.description}`).join("\n")}
@@ -8626,6 +8644,16 @@ async function main() {
8626
8644
  stdout.write(HELP + "\n");
8627
8645
  return;
8628
8646
  }
8647
+ if (args.version) {
8648
+ stdout.write(`create-lacspace-app ${cliVersion()}
8649
+ `);
8650
+ return;
8651
+ }
8652
+ if (args.unknown.length) {
8653
+ stdout.write(c("yellow", `
8654
+ ! Unknown option${args.unknown.length > 1 ? "s" : ""}: ${args.unknown.join(", ")} \u2014 ignoring. Run with --help to see every flag.
8655
+ `));
8656
+ }
8629
8657
  stdout.write(`
8630
8658
  ${c("bold", c("magenta", "\u25C6 create-lacspace-app"))} ${c("dim", "\u2014 a gorgeous Next.js starter, batteries wired")}
8631
8659
 
@@ -8824,8 +8852,18 @@ ${c("bold", "Your feature add-ons")} ${c("dim", "\u2014 details in LEARN.md")}
8824
8852
 
8825
8853
  `);
8826
8854
  }
8827
- var invokedAsCli = argv[1] ? import.meta.url === pathToFileURL(argv[1]).href : false;
8828
- if (invokedAsCli) {
8855
+ function isDirectRun() {
8856
+ const entry = argv[1];
8857
+ if (!entry) return false;
8858
+ const here = import.meta.url;
8859
+ if (here === pathToFileURL(entry).href) return true;
8860
+ try {
8861
+ if (here === pathToFileURL(realpathSync(entry)).href) return true;
8862
+ } catch {
8863
+ }
8864
+ return basename(entry).replace(/\.[cm]?js$/, "") === "create-lacspace-app";
8865
+ }
8866
+ if (isDirectRun()) {
8829
8867
  main().catch((err) => {
8830
8868
  stdout.write(c("red", `
8831
8869
  \u2717 ${err instanceof Error ? err.message : String(err)}
package/dist/lib.cjs CHANGED
@@ -8018,9 +8018,24 @@ function backendFiles(ctx) {
8018
8018
  }
8019
8019
  return files;
8020
8020
  }
8021
+ function cliVersion() {
8022
+ try {
8023
+ const here = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('lib.cjs', document.baseURI).href))));
8024
+ for (const rel of ["../package.json", "./package.json", "../../package.json"]) {
8025
+ const file = path.resolve(here, rel);
8026
+ if (!fs.existsSync(file)) continue;
8027
+ const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
8028
+ const version = parsed.version;
8029
+ const name = parsed.name;
8030
+ if (typeof version === "string" && (name === "create-lacspace-app" || rel !== "../../package.json")) return version;
8031
+ }
8032
+ } catch {
8033
+ }
8034
+ return "unknown";
8035
+ }
8021
8036
  var splitList = (s) => s.split(",").map((x) => x.trim()).filter(Boolean);
8022
8037
  function parseArgs(list) {
8023
- const a = { features: [], yes: false, install: true, git: true, pm: "npm", help: false, dryRun: false };
8038
+ const a = { features: [], yes: false, install: true, git: true, pm: "npm", help: false, version: false, dryRun: false, unknown: [] };
8024
8039
  for (let i = 0; i < list.length; i++) {
8025
8040
  const arg = list[i];
8026
8041
  const next = () => list[++i] ?? "";
@@ -8043,6 +8058,7 @@ function parseArgs(list) {
8043
8058
  } else if (arg === "--recipe") a.recipe = next();
8044
8059
  else if (arg.startsWith("--recipe=")) a.recipe = arg.slice(9);
8045
8060
  else if (arg === "-h" || arg === "--help") a.help = true;
8061
+ else if (arg === "-v" || arg === "-V" || arg === "--version") a.version = true;
8046
8062
  else if (arg.startsWith("--template=")) a.template = arg.slice(11);
8047
8063
  else if (arg.startsWith("--theme=")) a.theme = arg.slice(8);
8048
8064
  else if (arg.startsWith("--accent=")) a.theme = arg.slice(9);
@@ -8050,6 +8066,7 @@ function parseArgs(list) {
8050
8066
  else if (arg.startsWith("--with=")) a.features.push(...splitList(arg.slice(7)));
8051
8067
  else if (arg.startsWith("--features=")) a.features.push(...splitList(arg.slice(11)));
8052
8068
  else if (!arg.startsWith("-") && !a.name) a.name = arg;
8069
+ else if (arg.startsWith("-")) a.unknown.push(arg);
8053
8070
  }
8054
8071
  return a;
8055
8072
  }
@@ -8157,6 +8174,7 @@ ${c("bold", "Options")}
8157
8174
  --no-git Skip git init
8158
8175
  -y, --yes Accept defaults (needs <name>)
8159
8176
  -h, --help Show this help
8177
+ -v, --version Print the version and exit
8160
8178
 
8161
8179
  ${c("bold", "Feature add-ons")} ${c("dim", "(--with) \u2014 free & keyless, local by default")}
8162
8180
  ${FEATURES.map((f) => ` ${f.key.padEnd(11)} ${f.description}`).join("\n")}
@@ -8630,6 +8648,16 @@ async function main() {
8630
8648
  process$1.stdout.write(HELP + "\n");
8631
8649
  return;
8632
8650
  }
8651
+ if (args.version) {
8652
+ process$1.stdout.write(`create-lacspace-app ${cliVersion()}
8653
+ `);
8654
+ return;
8655
+ }
8656
+ if (args.unknown.length) {
8657
+ process$1.stdout.write(c("yellow", `
8658
+ ! Unknown option${args.unknown.length > 1 ? "s" : ""}: ${args.unknown.join(", ")} \u2014 ignoring. Run with --help to see every flag.
8659
+ `));
8660
+ }
8633
8661
  process$1.stdout.write(`
8634
8662
  ${c("bold", c("magenta", "\u25C6 create-lacspace-app"))} ${c("dim", "\u2014 a gorgeous Next.js starter, batteries wired")}
8635
8663
 
@@ -8828,8 +8856,18 @@ ${c("bold", "Your feature add-ons")} ${c("dim", "\u2014 details in LEARN.md")}
8828
8856
 
8829
8857
  `);
8830
8858
  }
8831
- var invokedAsCli = process$1.argv[1] ? (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('lib.cjs', document.baseURI).href)) === url.pathToFileURL(process$1.argv[1]).href : false;
8832
- if (invokedAsCli) {
8859
+ function isDirectRun() {
8860
+ const entry = process$1.argv[1];
8861
+ if (!entry) return false;
8862
+ const here = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('lib.cjs', document.baseURI).href));
8863
+ if (here === url.pathToFileURL(entry).href) return true;
8864
+ try {
8865
+ if (here === url.pathToFileURL(fs.realpathSync(entry)).href) return true;
8866
+ } catch {
8867
+ }
8868
+ return path.basename(entry).replace(/\.[cm]?js$/, "") === "create-lacspace-app";
8869
+ }
8870
+ if (isDirectRun()) {
8833
8871
  main().catch((err) => {
8834
8872
  process$1.stdout.write(c("red", `
8835
8873
  \u2717 ${err instanceof Error ? err.message : String(err)}
package/dist/lib.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { mkdir, writeFile } from 'fs/promises';
2
- import { resolve, basename, join, dirname } from 'path';
3
- import { existsSync, readdirSync, mkdirSync, writeFileSync } from 'fs';
2
+ import { basename, resolve, join, dirname } from 'path';
3
+ import { realpathSync, existsSync, readdirSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
4
4
  import { createInterface } from 'readline/promises';
5
- import { argv, stdout, exit, stdin, cwd } from 'process';
5
+ import { stdout, exit, argv, stdin, cwd } from 'process';
6
6
  import { spawnSync } from 'child_process';
7
- import { pathToFileURL } from 'url';
7
+ import { pathToFileURL, fileURLToPath } from 'url';
8
8
 
9
9
  // src/lib.ts
10
10
  var C = {
@@ -8015,9 +8015,24 @@ function backendFiles(ctx) {
8015
8015
  }
8016
8016
  return files;
8017
8017
  }
8018
+ function cliVersion() {
8019
+ try {
8020
+ const here = dirname(fileURLToPath(import.meta.url));
8021
+ for (const rel of ["../package.json", "./package.json", "../../package.json"]) {
8022
+ const file = resolve(here, rel);
8023
+ if (!existsSync(file)) continue;
8024
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
8025
+ const version = parsed.version;
8026
+ const name = parsed.name;
8027
+ if (typeof version === "string" && (name === "create-lacspace-app" || rel !== "../../package.json")) return version;
8028
+ }
8029
+ } catch {
8030
+ }
8031
+ return "unknown";
8032
+ }
8018
8033
  var splitList = (s) => s.split(",").map((x) => x.trim()).filter(Boolean);
8019
8034
  function parseArgs(list) {
8020
- const a = { features: [], yes: false, install: true, git: true, pm: "npm", help: false, dryRun: false };
8035
+ const a = { features: [], yes: false, install: true, git: true, pm: "npm", help: false, version: false, dryRun: false, unknown: [] };
8021
8036
  for (let i = 0; i < list.length; i++) {
8022
8037
  const arg = list[i];
8023
8038
  const next = () => list[++i] ?? "";
@@ -8040,6 +8055,7 @@ function parseArgs(list) {
8040
8055
  } else if (arg === "--recipe") a.recipe = next();
8041
8056
  else if (arg.startsWith("--recipe=")) a.recipe = arg.slice(9);
8042
8057
  else if (arg === "-h" || arg === "--help") a.help = true;
8058
+ else if (arg === "-v" || arg === "-V" || arg === "--version") a.version = true;
8043
8059
  else if (arg.startsWith("--template=")) a.template = arg.slice(11);
8044
8060
  else if (arg.startsWith("--theme=")) a.theme = arg.slice(8);
8045
8061
  else if (arg.startsWith("--accent=")) a.theme = arg.slice(9);
@@ -8047,6 +8063,7 @@ function parseArgs(list) {
8047
8063
  else if (arg.startsWith("--with=")) a.features.push(...splitList(arg.slice(7)));
8048
8064
  else if (arg.startsWith("--features=")) a.features.push(...splitList(arg.slice(11)));
8049
8065
  else if (!arg.startsWith("-") && !a.name) a.name = arg;
8066
+ else if (arg.startsWith("-")) a.unknown.push(arg);
8050
8067
  }
8051
8068
  return a;
8052
8069
  }
@@ -8154,6 +8171,7 @@ ${c("bold", "Options")}
8154
8171
  --no-git Skip git init
8155
8172
  -y, --yes Accept defaults (needs <name>)
8156
8173
  -h, --help Show this help
8174
+ -v, --version Print the version and exit
8157
8175
 
8158
8176
  ${c("bold", "Feature add-ons")} ${c("dim", "(--with) \u2014 free & keyless, local by default")}
8159
8177
  ${FEATURES.map((f) => ` ${f.key.padEnd(11)} ${f.description}`).join("\n")}
@@ -8627,6 +8645,16 @@ async function main() {
8627
8645
  stdout.write(HELP + "\n");
8628
8646
  return;
8629
8647
  }
8648
+ if (args.version) {
8649
+ stdout.write(`create-lacspace-app ${cliVersion()}
8650
+ `);
8651
+ return;
8652
+ }
8653
+ if (args.unknown.length) {
8654
+ stdout.write(c("yellow", `
8655
+ ! Unknown option${args.unknown.length > 1 ? "s" : ""}: ${args.unknown.join(", ")} \u2014 ignoring. Run with --help to see every flag.
8656
+ `));
8657
+ }
8630
8658
  stdout.write(`
8631
8659
  ${c("bold", c("magenta", "\u25C6 create-lacspace-app"))} ${c("dim", "\u2014 a gorgeous Next.js starter, batteries wired")}
8632
8660
 
@@ -8825,8 +8853,18 @@ ${c("bold", "Your feature add-ons")} ${c("dim", "\u2014 details in LEARN.md")}
8825
8853
 
8826
8854
  `);
8827
8855
  }
8828
- var invokedAsCli = argv[1] ? import.meta.url === pathToFileURL(argv[1]).href : false;
8829
- if (invokedAsCli) {
8856
+ function isDirectRun() {
8857
+ const entry = argv[1];
8858
+ if (!entry) return false;
8859
+ const here = import.meta.url;
8860
+ if (here === pathToFileURL(entry).href) return true;
8861
+ try {
8862
+ if (here === pathToFileURL(realpathSync(entry)).href) return true;
8863
+ } catch {
8864
+ }
8865
+ return basename(entry).replace(/\.[cm]?js$/, "") === "create-lacspace-app";
8866
+ }
8867
+ if (isDirectRun()) {
8830
8868
  main().catch((err) => {
8831
8869
  stdout.write(c("red", `
8832
8870
  \u2717 ${err instanceof Error ? err.message : String(err)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lacspace-app",
3
- "version": "2.13.0",
3
+ "version": "2.13.1",
4
4
  "description": "Scaffold a beautiful, production-ready Next.js app from a Lacspace template — portfolio, business, e-commerce, SaaS, blog, docs, dashboard, restaurant or marketplace — pre-wired with SEO, security headers, sitemap and robots. Use it as a CLI (like create-next-app, but you start gorgeous) or import it as a library to generate projects programmatically.",
5
5
  "type": "module",
6
6
  "bin": {