coursekit-lms 0.1.1 → 0.1.2
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/CHANGELOG.md +6 -1
- package/README.md +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/types/server/seed/demo.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
- **`seedDemo()` without a password no longer locks you out.** On a site with no administrator, `lms.seedDemo()` creates `admin@coursekit.test` with a random password; it now returns that password instead of `null`. The CLI was not affected: `coursekit seed --demo` uses `coursekit` unless you pass `--password`.
|
|
6
|
+
- Docs: with `skipLibCheck` off, the type definitions need TypeScript 5.7 or newer. The 0.1.1 notes now say which tabs reload themselves after an upgrade.
|
|
7
|
+
|
|
3
8
|
## 0.1.1
|
|
4
9
|
|
|
5
10
|
Fixes found while verifying the first release from the npm registry.
|
|
6
11
|
|
|
7
|
-
- **Stale tabs after an upgrade.** Requests for files that don't exist (such as page files from an older build) now get a 404 instead of the app page, and a tab
|
|
12
|
+
- **Stale tabs after an upgrade.** Requests for files that don't exist (such as page files from an older build) now get a 404 instead of the app page, and a tab running 0.1.1 or later reloads to pick up a newer build after an upgrade instead of failing to open pages. It reloads at most once per build within five minutes, and three times in five minutes in all, so a file that is really missing shows the error screen (with a Reload button) rather than reloading over and over. Tabs opened on 0.1.0 don't have this code: after upgrading from 0.1.0, an open tab shows the error screen the first time it opens a page it hasn't loaded yet, and its Reload button fixes it.
|
|
8
13
|
- **CommonJS.** `require('coursekit-lms')` now works on every supported Node version, 22.13+ (the package `exports` map has a `default` condition). It returns the same module as `import`.
|
|
9
14
|
- **TypeScript.** The published declarations now reference Node's types themselves, so they work even when `node` isn't listed in `"types"` (TypeScript 7's default is `[]`). Optional options accept an explicit `undefined`, so code like `databaseUrl: process.env.DATABASE_URL` compiles under `exactOptionalPropertyTypes`. The types the programmatic API uses are exported too: `CreateUserInput`, `SeedDemoOptions`, `SeedDemoResult`, `AppEnv`, `AppDeps`, `DB` and `DatabaseKind`. The declarations no longer import `kysely/migration`, which TypeScript's older `node10` module resolution (the default for `"module": "commonjs"` in TypeScript 5) can't find.
|
|
10
15
|
- **`createUser()` no longer returns the password hash.** The programmatic `lms.createUser()` now returns the public user (the same shape the API uses). The HTTP API never exposed it.
|
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ Migrations run automatically on start (or explicitly with `coursekit migrate`).
|
|
|
123
123
|
|
|
124
124
|
## Use it as a library
|
|
125
125
|
|
|
126
|
-
Coursekit exports a programmatic API, so you can run it inside your own server, react to events or seed data from scripts. It is an ES module, and CommonJS code can `require('coursekit-lms')` too. Type definitions are included; TypeScript projects also need `@types/node`, which most Node projects already have. With TypeScript 5, `"module": "commonjs"` and `skipLibCheck` off, also set `esModuleInterop` (for zod's type definitions, which Coursekit's types use) and a `target` of ES2022 or newer (for kysely's).
|
|
126
|
+
Coursekit exports a programmatic API, so you can run it inside your own server, react to events or seed data from scripts. It is an ES module, and CommonJS code can `require('coursekit-lms')` too. Type definitions are included; TypeScript projects also need `@types/node`, which most Node projects already have. With `skipLibCheck` off, the type definitions need TypeScript 5.7 or newer (Hono's use 5.7 features). With TypeScript 5, `"module": "commonjs"` and `skipLibCheck` off, also set `esModuleInterop` (for zod's type definitions, which Coursekit's types use) and a `target` of ES2022 or newer (for kysely's).
|
|
127
127
|
|
|
128
128
|
```ts
|
|
129
129
|
import { createCoursekit } from 'coursekit-lms';
|
package/dist/cli/index.js
CHANGED
|
@@ -3320,7 +3320,7 @@ Tasks persist in localStorage and everything works with the keyboard (Enter to a
|
|
|
3320
3320
|
await insertChunks(db, "announcements", announcements);
|
|
3321
3321
|
await insertChunks(db, "calendarEvents", events);
|
|
3322
3322
|
await insertChunks(db, "notifications", notifications);
|
|
3323
|
-
return { created: true, password
|
|
3323
|
+
return { created: true, password, users, courses: courses.length };
|
|
3324
3324
|
}
|
|
3325
3325
|
|
|
3326
3326
|
// src/server/routes/auth.ts
|