Skip to content

Commit

Permalink
fix decap cms
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jul 11, 2024
1 parent 1360611 commit 41f8f52
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Go to the `v1` branch to see the changelog of Lume 1.
## [2.2.4] - Unreleased
### Fixed
- Vento components must be sync.
- Updated dependencies: `std`, `terser`, `sass`, `xml`, `liquid`, `highlight.js`, `unocss`, `decap_cms`.
- Use a pinned version of `npm:decap-server` package for stability.
- DecapCMS script: switch from `unpkg` to `jsDelivr` for performance.


## [2.2.3] - 2024-07-05
### Added
Expand Down
2 changes: 1 addition & 1 deletion cms.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { yellow } from "./deps/colors.ts";
const specifier = "https://cdn.jsdelivr.net/gh/lumeland/[email protected].4/";
const specifier = "https://cdn.jsdelivr.net/gh/lumeland/[email protected].5/";

throw new Error(`
This module is not longer available.
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"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].4/"
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/[email protected].5/"
}
}
2 changes: 1 addition & 1 deletion deps/assert.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "jsr:@std/assert@0.226.0";
export * from "jsr:@std/assert@1.0.0";
2 changes: 1 addition & 1 deletion deps/base64.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "jsr:@std/[email protected].0/base64";
export * from "jsr:@std/[email protected].1/base64";
2 changes: 1 addition & 1 deletion deps/colors.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "jsr:@std/[email protected].5/colors";
export * from "jsr:@std/[email protected].6/colors";
2 changes: 1 addition & 1 deletion deps/crypto.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "jsr:@std/[email protected].0";
export * from "jsr:@std/[email protected].1";
3 changes: 3 additions & 0 deletions deps/decap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const decapUrl =
"https://cdn.jsdelivr.net/npm/[email protected]/dist/decap-cms.js";
export const serverUrl = "npm:[email protected]";
2 changes: 1 addition & 1 deletion deps/hex.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "jsr:@std/[email protected].0/hex";
export * from "jsr:@std/[email protected].1/hex";
6 changes: 3 additions & 3 deletions deps/highlight.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import hljs from "npm:highlight.js@11.9.0";
export * from "npm:highlight.js@11.9.0";
import hljs from "npm:highlight.js@11.10.0";
export * from "npm:highlight.js@11.10.0";
export default hljs;

export const themesPath =
"https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/styles/";
"https://cdn.jsdelivr.net/npm/highlight.js@11.10.0/styles/";
6 changes: 3 additions & 3 deletions deps/liquid.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from "npm:liquidjs@10.14.0";
export * from "npm:liquidjs@10.15.0";

export type { LiquidOptions, Template } from "npm:liquidjs@10.14.0";
export type { LiquidOptions, Template } from "npm:liquidjs@10.15.0";
export type {
TagClass,
TagImplOptions,
} from "npm:liquidjs@10.14.0/dist/template";
} from "npm:liquidjs@10.15.0/dist/template";
2 changes: 1 addition & 1 deletion deps/sass.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "npm:[email protected].6";
export * from "npm:[email protected].7";
4 changes: 2 additions & 2 deletions deps/terser.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { minify } from "npm:[email protected].1";
export type { MinifyOptions } from "npm:[email protected].1";
export { minify } from "npm:[email protected].2";
export type { MinifyOptions } from "npm:[email protected].2";
10 changes: 5 additions & 5 deletions deps/unocss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ export {
type SourceCodeTransformer,
type UnocssPluginContext,
type UserConfig,
} from "npm:@unocss/[email protected].2";
export { presetUno } from "npm:@unocss/[email protected].2";
export { default as transformerVariantGroup } from "npm:@unocss/[email protected].2";
export { default as transformerDirectives } from "npm:@unocss/[email protected].2";
} from "npm:@unocss/[email protected].3";
export { presetUno } from "npm:@unocss/[email protected].3";
export { default as transformerVariantGroup } from "npm:@unocss/[email protected].3";
export { default as transformerDirectives } from "npm:@unocss/[email protected].3";
export { default as MagicString } from "npm:[email protected]";

export const resetUrl = "https://unpkg.com/@unocss/[email protected].2";
export const resetUrl = "https://unpkg.com/@unocss/[email protected].3";
2 changes: 1 addition & 1 deletion deps/xml.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/x/[email protected].9/mod.ts";
export * from "https://deno.land/x/[email protected].10/mod.ts";
5 changes: 3 additions & 2 deletions plugins/decap_cms.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { decapUrl, serverUrl } from "../deps/decap.ts";
import { Page } from "../core/file.ts";
import { merge } from "../core/utils/object.ts";
import { posix } from "../deps/path.ts";
Expand Down Expand Up @@ -34,7 +35,7 @@ export const defaults: Options = {
configKey: "decap_cms",
extraHTML: "",
proxyCommand:
"deno run --allow-read --allow-net=0.0.0.0 --allow-write --allow-env npm:decap-server",
`deno run --allow-read --allow-net=0.0.0.0 --allow-write --allow-env ${serverUrl}`,
};

/** A plugin to use Decap CMS in Lume easily */
Expand Down Expand Up @@ -85,7 +86,7 @@ export default function (userOptions?: Options) {
}" type="text/yaml" rel="cms-config-url">`,
);
code.push(
`<script src="https://unpkg.com/[email protected]/dist/decap-cms.js"></script>`,
`<script src="${decapUrl}"></script>`,
);

if (options.identity === "netlify") {
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/decap_cms.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ local_backend: false
<title>Admin</title>
</head>
<body>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://unpkg.com/decap-cms@3.0.12/dist/decap-cms.js"></script><script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://cdn.jsdelivr.net/npm/decap-cms@3.1.11/dist/decap-cms.js"></script><script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</body>
</html>
',
Expand All @@ -173,7 +173,7 @@ local_backend: false
<title>Admin</title>
</head>
<body>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://unpkg.com/decap-cms@3.0.12/dist/decap-cms.js"></script><script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://cdn.jsdelivr.net/npm/decap-cms@3.1.11/dist/decap-cms.js"></script><script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</body>
</html>
',
Expand Down

0 comments on commit 41f8f52

Please sign in to comment.