Skip to content

Commit

Permalink
removed lume/cms.ts module
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed May 11, 2024
1 parent 92bc392 commit 9b2325e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
- New `afterLoad` event, triggered just after all files are (re)loaded.

### Changed
- BREAKING: Removed `lume/cms.ts` module. Use import maps instead.
- The minimum Deno version supported is `1.43`.
- For better predictability, the `_cache` folder is generated in the root folder, instead of `src` folder.
- Simplified Esbuild plugin.
Expand Down
2 changes: 1 addition & 1 deletion cli/cms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { toFileUrl } from "../deps/path.ts";
import { getConfigFile } from "../core/utils/lume_config.ts";
import { setEnv } from "../core/utils/env.ts";
import { createSite } from "./run.ts";
import { adapter } from "../cms.ts";

export async function runCms(
config: string | undefined,
Expand All @@ -25,6 +24,7 @@ export async function runCms(
// Enable drafts in the CMS
setEnv("LUME_DRAFTS", "true");

const { default: adapter } = await import("lume/cms/adapters/lume.ts");
const cms = mod.default;
const app = await adapter({ site, cms });
const { port } = site.options.server;
Expand Down
18 changes: 13 additions & 5 deletions cms.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
export { default as adapter } from "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/adapters/lume.ts";
export { default } from "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/mod.ts";
export { default as Kv } from "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/storage/kv.ts";
export { default as Fs } from "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/storage/fs.ts";
export { default as GitHub } from "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/storage/github.ts";
import { yellow } from "./deps/colors.ts";
const specifier = "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/";

throw new Error(`
This module is not longer available.
Please, add this import to your import map:
${yellow(`"lume/cms/": "${specifier}"`)}
And then, replace the import statement in your code:
${yellow(`import lumeCMS from "lume/cms/mod.ts";`)}
`);
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"test:update": "deno task test -- --update",
"changelog": "deno run --allow-read --allow-write https://deno.land/x/[email protected]/bin.ts",
"update-deps": "deno run -A --quiet 'https://deno.land/x/[email protected]/cli.ts' update deps/*.ts cms.ts deno.json"
},
"imports": {
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/[email protected]/"
}
}

0 comments on commit 9b2325e

Please sign in to comment.