@sapphirelabs/blog-cms-next 0.1.0 → 1.0.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/README.md CHANGED
@@ -12,7 +12,7 @@ npm install @sapphirelabs/blog-cms-next
12
12
  import { createAdminRoute } from '@sapphirelabs/blog-cms-next/admin';
13
13
 
14
14
  export const { GET } = createAdminRoute({
15
- scriptUrl: 'https://unpkg.com/@sapphirelabs/blog-cms@0.1.0/dist/sapphire-cms.js',
15
+ scriptUrl: 'https://unpkg.com/@sapphirelabs/blog-cms@1.0.0/dist/sapphire-cms.js',
16
16
  });
17
17
  export const dynamic = 'force-static';
18
18
  ```
package/dist/admin.d.ts CHANGED
@@ -7,9 +7,15 @@
7
7
  *
8
8
  * Without `config`, the panel reads `public/admin/config.yml`.
9
9
  */
10
- export declare const DEFAULT_SCRIPT_URL = "https://unpkg.com/@sapphirelabs/blog-cms/dist/sapphire-cms.js";
10
+ /** Panel version this package is tested with; kept equal to @sapphirelabs/blog-cms by a test. */
11
+ export declare const PANEL_VERSION = "1.0.0";
12
+ /**
13
+ * Pinned, so publishing a new panel never changes a site that did not upgrade
14
+ * this package (see SECURITY.md).
15
+ */
16
+ export declare const DEFAULT_SCRIPT_URL = "https://unpkg.com/@sapphirelabs/blog-cms@1.0.0/dist/sapphire-cms.js";
11
17
  export interface AdminOptions {
12
- /** URL of `sapphire-cms.js`. Default: the latest version on unpkg. */
18
+ /** URL of `sapphire-cms.js`. Default: the matching panel version on unpkg. */
13
19
  scriptUrl?: string;
14
20
  /** Configuration instead of `config.yml`, in the same format. */
15
21
  config?: Record<string, unknown>;
package/dist/admin.js CHANGED
@@ -7,7 +7,13 @@
7
7
  *
8
8
  * Without `config`, the panel reads `public/admin/config.yml`.
9
9
  */
10
- export const DEFAULT_SCRIPT_URL = 'https://unpkg.com/@sapphirelabs/blog-cms/dist/sapphire-cms.js';
10
+ /** Panel version this package is tested with; kept equal to @sapphirelabs/blog-cms by a test. */
11
+ export const PANEL_VERSION = '1.0.0';
12
+ /**
13
+ * Pinned, so publishing a new panel never changes a site that did not upgrade
14
+ * this package (see SECURITY.md).
15
+ */
16
+ export const DEFAULT_SCRIPT_URL = `https://unpkg.com/@sapphirelabs/blog-cms@${PANEL_VERSION}/dist/sapphire-cms.js`;
11
17
  const escapeHtml = (value) => value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
12
18
  export function adminHtml({ scriptUrl = DEFAULT_SCRIPT_URL, config, title } = {}) {
13
19
  const pageTitle = title ?? (typeof config?.site_title === 'string' ? config.site_title : 'Content Manager');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphirelabs/blog-cms-next",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "Sapphire Blog CMS for Next.js: CMS panel at /admin, post loading helpers and a component that renders the text.",
5
5
  "license": "MIT",
6
6
  "author": "Sapphire Labs (https://github.com/sapphire-labs-dev)",