@lessonkit/cli 1.0.2 → 1.1.0

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/bin.js CHANGED
@@ -126,6 +126,7 @@ async function copyTemplate(src, dest) {
126
126
  await copyTemplate(srcPath, destPath);
127
127
  } else if (entry.isFile()) {
128
128
  await cp(srcPath, destPath);
129
+ } else {
129
130
  }
130
131
  }
131
132
  }
@@ -164,8 +165,8 @@ async function runInit(opts, logger) {
164
165
  exitCode: EXIT_INVALID_PROJECT
165
166
  });
166
167
  }
167
- const slug = slugifyId(rawName ?? "my-course");
168
- const projectName = rawName ?? slug;
168
+ const slug = slugifyId(rawName);
169
+ const projectName = rawName;
169
170
  const projectDir = opts.here ? cwd : resolve(cwd, slug);
170
171
  if (!opts.here && existsSync(projectDir)) {
171
172
  throw new CliError(
@@ -598,10 +599,10 @@ function createProgram(baseLogger = console) {
598
599
  out: opts.out,
599
600
  json: opts.json
600
601
  });
601
- if (!opts.json && result.ok) {
602
- if (result.command === "package" && result.target === "react-vite") {
602
+ if (!opts.json && result.ok && result.command === "package") {
603
+ if (result.target === "react-vite") {
603
604
  logger.log(`Built react-vite \u2192 ${result.distDir}`);
604
- } else if (result.command === "package") {
605
+ } else {
605
606
  const dest = result.outputPath ?? result.outputDir;
606
607
  logger.log(
607
608
  `Packaged ${result.target}${dest ? ` \u2192 ${dest}` : ""} (${result.fileCount} files)`
package/dist/index.js CHANGED
@@ -124,6 +124,7 @@ async function copyTemplate(src, dest) {
124
124
  await copyTemplate(srcPath, destPath);
125
125
  } else if (entry.isFile()) {
126
126
  await cp(srcPath, destPath);
127
+ } else {
127
128
  }
128
129
  }
129
130
  }
@@ -162,8 +163,8 @@ async function runInit(opts, logger) {
162
163
  exitCode: EXIT_INVALID_PROJECT
163
164
  });
164
165
  }
165
- const slug = slugifyId(rawName ?? "my-course");
166
- const projectName = rawName ?? slug;
166
+ const slug = slugifyId(rawName);
167
+ const projectName = rawName;
167
168
  const projectDir = opts.here ? cwd : resolve(cwd, slug);
168
169
  if (!opts.here && existsSync(projectDir)) {
169
170
  throw new CliError(
@@ -596,10 +597,10 @@ function createProgram(baseLogger = console) {
596
597
  out: opts.out,
597
598
  json: opts.json
598
599
  });
599
- if (!opts.json && result.ok) {
600
- if (result.command === "package" && result.target === "react-vite") {
600
+ if (!opts.json && result.ok && result.command === "package") {
601
+ if (result.target === "react-vite") {
601
602
  logger.log(`Built react-vite \u2192 ${result.distDir}`);
602
- } else if (result.command === "package") {
603
+ } else {
603
604
  const dest = result.outputPath ?? result.outputDir;
604
605
  logger.log(
605
606
  `Packaged ${result.target}${dest ? ` \u2192 ${dest}` : ""} (${result.fileCount} files)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lessonkit/cli",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "description": "LessonKit CLI — init, dev, build, and package learning experiences.",
6
6
  "license": "Apache-2.0",
@@ -42,8 +42,8 @@
42
42
  "lint": "echo \"(no lint configured yet)\""
43
43
  },
44
44
  "dependencies": {
45
- "@lessonkit/core": "1.0.2",
46
- "@lessonkit/lxpack": "1.0.2",
45
+ "@lessonkit/core": "1.1.0",
46
+ "@lessonkit/lxpack": "1.1.0",
47
47
  "commander": "^14.0.1"
48
48
  },
49
49
  "engines": {
@@ -13,16 +13,16 @@
13
13
  "test:coverage": "vitest run --coverage --passWithNoTests=false"
14
14
  },
15
15
  "dependencies": {
16
- "@lessonkit/core": "^1.0.2",
17
- "@lessonkit/react": "^1.0.2",
18
- "@lessonkit/themes": "^1.0.2",
19
- "@lessonkit/xapi": "^1.0.2",
16
+ "@lessonkit/core": "^1.1.0",
17
+ "@lessonkit/react": "^1.1.0",
18
+ "@lessonkit/themes": "^1.1.0",
19
+ "@lessonkit/xapi": "^1.1.0",
20
20
  "react": "^18.3.1",
21
21
  "react-dom": "^18.3.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@lessonkit/cli": "^1.0.2",
25
- "@lessonkit/lxpack": "^1.0.2",
24
+ "@lessonkit/cli": "^1.1.0",
25
+ "@lessonkit/lxpack": "^1.1.0",
26
26
  "@testing-library/react": "^16.3.0",
27
27
  "@types/react": "^18.3.23",
28
28
  "@types/react-dom": "^18.3.7",
@@ -8,7 +8,7 @@ export default defineConfig({
8
8
  provider: "v8",
9
9
  include: ["src/**/*.{ts,tsx}"],
10
10
  exclude: ["dist/**", "node_modules/**", "**/*.d.ts", "**/*.d.cts"],
11
- thresholds: { lines: 100 },
11
+ thresholds: { statements: 95, branches: 95, functions: 95, lines: 95 },
12
12
  },
13
13
  },
14
14
  });