studiocms 0.4.0 → 0.4.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/dist/consts.js CHANGED
@@ -100,6 +100,14 @@ const AstroConfigViteSettings = {
100
100
  // Users will need to install these peer dependencies themselves
101
101
  external: ["@libsql/client", "kysely-turso", "pg", "mysql2"]
102
102
  }
103
+ },
104
+ optimizeDeps: {
105
+ include: ["effect", "@effect/platform", "@effect/platform-node"]
106
+ },
107
+ ssr: {
108
+ optimizeDeps: {
109
+ include: ["effect", "@effect/platform", "@effect/platform-node"]
110
+ }
103
111
  }
104
112
  };
105
113
  const StudioCMSDefaultRobotsConfig = ({
@@ -1,4 +1,4 @@
1
- import type { APICoreDefinition, AuthorizationType, ContextDriverDefinition, StorageApiBuilderDefinition, UrlMappingServiceDefinition } from '../definitions';
1
+ import type { APICoreDefinition, AuthorizationType, ContextDriverDefinition, StorageApiBuilderDefinition, UrlMappingServiceDefinition } from '../definitions.js';
2
2
  /**
3
3
  * API Core implementation.
4
4
  *
@@ -20,6 +20,6 @@ export default class APICore<C, R> implements APICoreDefinition<C, R> {
20
20
  getDriver(): ContextDriverDefinition<C, R>;
21
21
  getUrlMappingService(): UrlMappingServiceDefinition;
22
22
  getStorageDriver(): StorageApiBuilderDefinition<C, R>;
23
- getPOST(type?: AuthorizationType): import("../definitions").StorageAPIEndpointFn<C, R>;
24
- getPUT(type?: AuthorizationType): import("../definitions").StorageAPIEndpointFn<C, R>;
23
+ getPOST(type?: AuthorizationType): import("../definitions.js").StorageAPIEndpointFn<C, R>;
24
+ getPUT(type?: AuthorizationType): import("../definitions.js").StorageAPIEndpointFn<C, R>;
25
25
  }
@@ -1,5 +1,5 @@
1
1
  import type { APIContext } from 'astro';
2
- import type { ContextDriverDefinition, ContextHandler, ContextHandlerFn, ParsedContext } from '../definitions';
2
+ import type { ContextDriverDefinition, ContextHandler, ContextHandlerFn, ParsedContext } from '../definitions.js';
3
3
  /**
4
4
  * Astro Context Driver implementation.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { UrlMapping, UrlMappingDatabaseDefinition } from '../definitions';
1
+ import type { UrlMapping, UrlMappingDatabaseDefinition } from '../definitions.js';
2
2
  /**
3
3
  * Database implementation for managing URL mappings in the storage system.
4
4
  *
@@ -2,7 +2,7 @@ import { HttpServerResponse } from '@effect/platform';
2
2
  import type { HttpBodyError } from '@effect/platform/HttpBody';
3
3
  import type { APIContext } from 'astro';
4
4
  import type { Effect } from 'effect';
5
- import type { ContextDriverDefinition, ContextHandler, ContextHandlerFn, ParsedContext } from '../definitions';
5
+ import type { ContextDriverDefinition, ContextHandler, ContextHandlerFn, ParsedContext } from '../definitions.js';
6
6
  /**
7
7
  * Astro Context Driver implementation.
8
8
  *
@@ -1,4 +1,4 @@
1
- import type { UrlMapping, UrlMappingDatabaseDefinition, UrlMappingServiceDefinition, UrlMetadata } from '../definitions';
1
+ import type { UrlMapping, UrlMappingDatabaseDefinition, UrlMappingServiceDefinition, UrlMetadata } from '../definitions.js';
2
2
  /**
3
3
  * URL Mapping Service implementation.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import type { AstroIntegration } from 'astro';
2
- import type { DbDialectType } from '../../db/index';
2
+ import type { DbDialectType } from '../../db/index.js';
3
3
  /**
4
4
  * StudioCMS Analytics Plugin to collect Web Vitals metrics and store them in the database.
5
5
  *
@@ -1,9 +1,9 @@
1
1
  import { runEffect } from "@withstudiocms/effect";
2
2
  import createPathResolver from "@withstudiocms/internal_helpers/pathResolver";
3
3
  import { addVirtualImports } from "astro-integration-kit";
4
- import { KyselyTableManager } from "../../db/plugins";
5
- import { buildTranslations, loadJsTranslations } from "../../plugins";
6
- import { definePlugin } from "../../schemas";
4
+ import { KyselyTableManager } from "../../db/plugins.js";
5
+ import { buildTranslations, loadJsTranslations } from "../../plugins.js";
6
+ import { definePlugin } from "../../schemas/index.js";
7
7
  import { WEB_VITALS_ENDPOINT_PATH } from "./consts.js";
8
8
  import { getAnalyticsDbClient } from "./db-client.js";
9
9
  import { StudioCMSMetricTableDefinition } from "./table.js";
@@ -4,12 +4,25 @@ import { StudioCMSSDKApiSpec } from '@withstudiocms/api-spec';
4
4
  import { SDKAPIError } from '@withstudiocms/api-spec/sdk';
5
5
  import { experimental_AstroContainer as AstroContainer } from 'astro/container';
6
6
  import { Effect, Layer } from 'effect';
7
- import { parseMarkdown } from '#utils/tinyMDParser';
7
+ import { micromark } from 'micromark';
8
+ import { gfm, gfmHtml } from 'micromark-extension-gfm';
8
9
  // biome-ignore lint/suspicious/noTsIgnore: Typechecker override for Astro component imports
9
10
  // @ts-ignore - This is an Astro component, so we ignore TypeScript errors for this import
10
11
  import UserListItems from '../../../components/dashboard/user-mgmt/UserListItems.astro';
11
12
  import { ProcessChangelog } from './_utils/changelog.js';
12
13
 
14
+ /**
15
+ * Parses a Markdown string and returns the rendered output to HTML.
16
+ *
17
+ * @param str - The Markdown string to parse.
18
+ * @returns The rendered output as a string.
19
+ */
20
+ export const parseMarkdown = (str: string) =>
21
+ micromark(str, {
22
+ extensions: [gfm()],
23
+ htmlExtensions: [gfmHtml()],
24
+ });
25
+
13
26
  /**
14
27
  * Utility function to catch errors in the Effect chain and convert them into SDKAPIError instances with a provided message.
15
28
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "studiocms",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "A Community-Driven Astro native CMS. Built from the ground up by the Astro community.",
5
5
  "author": {
6
6
  "name": "withstudiocms",
@@ -253,7 +253,7 @@
253
253
  "tinyglobby": "^0.2.15",
254
254
  "ultrahtml": "^1.6.0",
255
255
  "web-vitals": "^5.1.0",
256
- "@withstudiocms/api-spec": "^0.3.0",
256
+ "@withstudiocms/api-spec": "^0.3.1",
257
257
  "@withstudiocms/internal_helpers": "^0.2.0",
258
258
  "@withstudiocms/auth-kit": "^0.1.4",
259
259
  "@withstudiocms/cli-kit": "^0.2.1",
@@ -263,7 +263,7 @@
263
263
  "@withstudiocms/template-lang": "^0.1.0",
264
264
  "@withstudiocms/kysely": "^0.2.1",
265
265
  "@withstudiocms/sdk": "^0.3.0",
266
- "effectify": "^0.1.0"
266
+ "effectify": "^0.1.1"
267
267
  },
268
268
  "devDependencies": {
269
269
  "@types/mdast": "^4.0.4",