@studiocms/devapps 0.1.0-beta.20 → 0.1.0-beta.22
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/LICENSE +1 -1
- package/dist/effects/WordPressAPI/converters.d.ts +3 -3
- package/dist/effects/WordPressAPI/converters.js +3 -3
- package/dist/effects/WordPressAPI/importers.d.ts +5 -5
- package/dist/effects/WordPressAPI/importers.js +3 -3
- package/dist/effects/WordPressAPI/utils.js +1 -1
- package/dist/effects/wpImporter.d.ts +1 -1
- package/package.json +11 -9
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025-present StudioCMS - withstudiocms (https://github.com/withstudiocms)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -2,7 +2,7 @@ import { Effect } from 'studiocms/effect';
|
|
|
2
2
|
import { FullPageData, ImportEndpointConfig, RawPageData, UseBlogPkgConfig } from './configs.js';
|
|
3
3
|
import { WordPressAPIUtils } from './utils.js';
|
|
4
4
|
declare const WordPressAPIConverters_base: Effect.Service.Class<WordPressAPIConverters, "WordPressAPIConverters", {
|
|
5
|
-
readonly dependencies: readonly [import("effect/Layer").Layer<
|
|
5
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<WordPressAPIUtils, never, never>];
|
|
6
6
|
readonly effect: Effect.Effect<{
|
|
7
7
|
convertToPageData: Effect.Effect<{
|
|
8
8
|
title: string;
|
|
@@ -16,11 +16,11 @@ declare const WordPressAPIConverters_base: Effect.Service.Class<WordPressAPIConv
|
|
|
16
16
|
title: string;
|
|
17
17
|
slug: string;
|
|
18
18
|
description: string;
|
|
19
|
-
}, boolean | import("astro/errors").AstroError | import("effect/Cause").UnknownException | import("
|
|
19
|
+
}, boolean | import("astro/errors").AstroError | import("effect/Cause").UnknownException | import("effect/ParseResult").ParseError | import("studiocms/sdk/effect/db").LibSQLDatabaseError, ImportEndpointConfig | RawPageData | UseBlogPkgConfig>;
|
|
20
20
|
convertToPostContent: Effect.Effect<{
|
|
21
21
|
contentId: string;
|
|
22
22
|
}, boolean | Error | import("effect/ParseResult").ParseError, RawPageData | FullPageData>;
|
|
23
|
-
}, never, WordPressAPIUtils
|
|
23
|
+
}, never, WordPressAPIUtils>;
|
|
24
24
|
}>;
|
|
25
25
|
export declare class WordPressAPIConverters extends WordPressAPIConverters_base {
|
|
26
26
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import { eq } from "astro:db";
|
|
2
|
+
import path from "node:path";
|
|
3
3
|
import { SDKCore } from "studiocms:sdk";
|
|
4
4
|
import { userProjectRoot } from "virtual:studiocms-devapps/config";
|
|
5
|
-
import { Console, Effect,
|
|
5
|
+
import { Console, Effect, genLogger, Schema } from "studiocms/effect";
|
|
6
6
|
import { decode } from "studiocms/runtime";
|
|
7
7
|
import { tsPageDataCategories, tsPageDataTags } from "studiocms/sdk/tables";
|
|
8
8
|
import {
|
|
@@ -24,7 +24,7 @@ const postsImagesFolder = path.resolve(WPImportFolder, "posts");
|
|
|
24
24
|
class WordPressAPIConverters extends Effect.Service()(
|
|
25
25
|
"WordPressAPIConverters",
|
|
26
26
|
{
|
|
27
|
-
dependencies: [
|
|
27
|
+
dependencies: [WordPressAPIUtils.Default],
|
|
28
28
|
effect: genLogger("@studiocms/devapps/effects/WordPressAPI/converters.effect")(function* () {
|
|
29
29
|
const sdk = yield* SDKCore;
|
|
30
30
|
const {
|
|
@@ -6,12 +6,12 @@ import { WordPressAPIUtils } from './utils.js';
|
|
|
6
6
|
export type PageData = typeof tsPageData.$inferInsert;
|
|
7
7
|
export type PageContent = typeof tsPageContent.$inferInsert;
|
|
8
8
|
declare const WordPressAPI_base: Effect.Service.Class<WordPressAPI, "WordPressAPI", {
|
|
9
|
-
readonly dependencies: readonly [import("effect/Layer").Layer<
|
|
9
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<WordPressAPIUtils, never, never>, import("effect/Layer").Layer<WordPressAPIConverters, never, never>];
|
|
10
10
|
readonly effect: Effect.Effect<{
|
|
11
|
-
importSettingsFromWPAPI: Effect.Effect<void, boolean | import("astro/errors").AstroError | import("effect/Cause").UnknownException | import("
|
|
12
|
-
importPagesFromWPAPI: Effect.Effect<void, boolean | Error | import("
|
|
13
|
-
importPostsFromWPAPI: Effect.Effect<void, boolean | Error | import("
|
|
14
|
-
}, never, WordPressAPIUtils | WordPressAPIConverters
|
|
11
|
+
importSettingsFromWPAPI: Effect.Effect<void, boolean | import("astro/errors").AstroError | import("effect/Cause").UnknownException | import("effect/ParseResult").ParseError | import("studiocms/sdk/errors").SDKCoreError, ImportEndpointConfig>;
|
|
12
|
+
importPagesFromWPAPI: Effect.Effect<void, boolean | Error | import("effect/ParseResult").ParseError | import("studiocms/sdk/errors").SDKCoreError, ImportEndpointConfig>;
|
|
13
|
+
importPostsFromWPAPI: Effect.Effect<void, boolean | Error | import("effect/ParseResult").ParseError | import("studiocms/sdk/effect/db").LibSQLDatabaseError | import("studiocms/sdk/errors").SDKCoreError, ImportPostsEndpointConfig>;
|
|
14
|
+
}, never, WordPressAPIUtils | WordPressAPIConverters>;
|
|
15
15
|
}>;
|
|
16
16
|
export declare class WordPressAPI extends WordPressAPI_base {
|
|
17
17
|
static Provide: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, WordPressAPI>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { SDKCore } from "studiocms:sdk";
|
|
3
3
|
import { userProjectRoot } from "virtual:studiocms-devapps/config";
|
|
4
|
-
import { Console, Effect,
|
|
4
|
+
import { Console, Effect, genLogger, Schema } from "studiocms/effect";
|
|
5
5
|
import {
|
|
6
6
|
APIEndpointConfig,
|
|
7
7
|
DownloadPostImageConfig,
|
|
@@ -16,7 +16,7 @@ import { PagesSchema, PostsSchema, SiteSettings } from "./schema.js";
|
|
|
16
16
|
import { WordPressAPIUtils } from "./utils.js";
|
|
17
17
|
const ASTRO_PUBLIC_FOLDER = path.resolve(userProjectRoot, "public");
|
|
18
18
|
class WordPressAPI extends Effect.Service()("WordPressAPI", {
|
|
19
|
-
dependencies: [
|
|
19
|
+
dependencies: [WordPressAPIUtils.Default, WordPressAPIConverters.Default],
|
|
20
20
|
effect: genLogger("@studiocms/devapps/effects/WordPressAPI.effect")(function* () {
|
|
21
21
|
const sdk = yield* SDKCore;
|
|
22
22
|
const { apiEndpoint, downloadPostImage, fetchAll } = yield* WordPressAPIUtils;
|
|
@@ -31,7 +31,7 @@ class WordPressAPI extends Effect.Service()("WordPressAPI", {
|
|
|
31
31
|
const rawSettings = yield* Effect.tryPromise(() => response.json());
|
|
32
32
|
const settings = yield* Schema.decodeUnknown(SiteSettings)(rawSettings);
|
|
33
33
|
yield* Console.log("Importing site settings: ", settings);
|
|
34
|
-
let siteIcon
|
|
34
|
+
let siteIcon;
|
|
35
35
|
if (settings.site_icon_url) {
|
|
36
36
|
siteIcon = yield* downloadPostImage.pipe(
|
|
37
37
|
DownloadPostImageConfig.makeProvide(settings.site_icon_url, ASTRO_PUBLIC_FOLDER)
|
|
@@ -4,7 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import { AstroError } from "astro/errors";
|
|
5
5
|
import * as cheerio from "cheerio";
|
|
6
6
|
import sanitizeHtml from "sanitize-html";
|
|
7
|
-
import { Console,
|
|
7
|
+
import { Console, Effect, genLogger } from "studiocms/effect";
|
|
8
8
|
import TurndownService from "turndown";
|
|
9
9
|
import {
|
|
10
10
|
APIEndpointConfig,
|
|
@@ -4,7 +4,7 @@ import { WordPressAPI } from './WordPressAPI/importers.js';
|
|
|
4
4
|
declare const WPImporter_base: Effect.Service.Class<WPImporter, "WPImporter", {
|
|
5
5
|
readonly dependencies: readonly [import("effect/Layer").Layer<WordPressAPI, never, never>];
|
|
6
6
|
readonly effect: Effect.Effect<{
|
|
7
|
-
runPostEvent: Effect.Effect<Response, boolean | Error | import("
|
|
7
|
+
runPostEvent: Effect.Effect<Response, boolean | Error | import("effect/ParseResult").ParseError | import("studiocms/sdk/effect/db").LibSQLDatabaseError | import("studiocms/sdk/errors").SDKCoreError, AstroAPIContextProvider>;
|
|
8
8
|
}, never, WordPressAPI>;
|
|
9
9
|
}>;
|
|
10
10
|
export declare class WPImporter extends WPImporter_base {
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiocms/devapps",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.22",
|
|
4
4
|
"description": "A dedicated CMS for Astro DB. Built from the ground up by the Astro community.",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "withstudiocms",
|
|
7
7
|
"url": "https://studiocms.dev"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/withstudiocms/studiocms.git",
|
|
12
|
-
"directory": "packages/
|
|
12
|
+
"directory": "packages/@studiocms/devapps"
|
|
13
13
|
},
|
|
14
14
|
"contributors": [
|
|
15
15
|
"Adammatthiesen",
|
|
@@ -55,20 +55,21 @@
|
|
|
55
55
|
"type": "module",
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"astro-integration-kit": "^0.18",
|
|
58
|
-
"cheerio": "^1.
|
|
58
|
+
"cheerio": "^1.1.2",
|
|
59
59
|
"turndown": "^7.2.0",
|
|
60
60
|
"sanitize-html": "^2.17.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/turndown": "^5.0.5",
|
|
64
64
|
"@types/sanitize-html": "^2.16.0",
|
|
65
|
-
"typescript": "^5.8.
|
|
65
|
+
"typescript": "^5.8.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@astrojs/db": "^0.15",
|
|
69
|
-
"astro": "^5.
|
|
68
|
+
"@astrojs/db": "^0.15.1",
|
|
69
|
+
"astro": "^5.12.6",
|
|
70
|
+
"effect": "^3.17.3",
|
|
70
71
|
"vite": "^6.3.4",
|
|
71
|
-
"studiocms": "0.1.0-beta.
|
|
72
|
+
"studiocms": "0.1.0-beta.22"
|
|
72
73
|
},
|
|
73
74
|
"peerDependenciesMeta": {
|
|
74
75
|
"studiocms": {
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
},
|
|
78
79
|
"scripts": {
|
|
79
80
|
"build": "buildkit build 'src/**/*.{ts,astro,css,json,png}'",
|
|
80
|
-
"dev": "buildkit dev 'src/**/*.{ts,astro,css,json,png}'"
|
|
81
|
+
"dev": "buildkit dev 'src/**/*.{ts,astro,css,json,png}'",
|
|
82
|
+
"typecheck": "tspc -p tsconfig.tspc.json"
|
|
81
83
|
}
|
|
82
84
|
}
|