Skip to content

Commit

Permalink
chore: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalcheung committed Nov 28, 2024
1 parent 2d458a7 commit 06741e1
Show file tree
Hide file tree
Showing 32 changed files with 823 additions and 105 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Sgalsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# example

## 0.1.2

### Patch Changes

- Updated dependencies
- [email protected]

## 0.1.1

### Patch Changes

- Updated dependencies
- [email protected]
4 changes: 4 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ A [Starlight](https://starlight.astro.build) plugin to server render contents, i
- SSR render contents

> This README format inspired from [starlight-blog/README.md at main · HiDeoo/starlight-blog (github.com)](https://github.com/HiDeoo/starlight-blog/blob/main/README.md)
## Licensing

[MIT Licensed](./LICENSE). Made with ❤️ by [Sgal Cheung](https://github.com/sgalcheung).
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "example",
"type": "module",
"version": "0.1.0",
"version": "0.1.2",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"name": "starlight-squidex",
"version": "0.1.0",
"type": "module",
"name": "root",
"private": true,
"packageManager": "[email protected]",
"engines": {
"node": ">=18.19.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"changeset": "changeset"
},
"keywords": [],
"author": "Sgal Cheung",
"license": "MIT",
"packageManager": "[email protected]",
"pnpm": {
"overrides": {
"@astrojs/starlight>@astrojs/mdx": "4.0.0-beta.1"
}
},
"devDependencies": {
"@changesets/cli": "^2.27.10",
"astro": "^5.0.0-beta"
}
}
7 changes: 7 additions & 0 deletions packages/desquidex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# desquidex

## 0.1.0

### Minor Changes

- Refactored according to the [astro-integration-template](https://github.com/florian-lefebvre/astro-integration-template) specification.
56 changes: 41 additions & 15 deletions packages/desquidex/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,58 @@
{
"name": "desquidex",
"version": "0.0.4",
"type": "module",
"scripts": {
"generate": "ts-to-zod"
},
"exports": {
"./loaders": "./loaders.ts",
"./schemas": "./data/models/schemas.ts",
"./integrations": "./integrations.ts",
"./package.json": "./package.json"
"version": "0.1.0",
"description": "Use your Squidex data in Astro projects",
"author": {
"email": "[email protected]",
"name": "Sgal Cheung",
"url": "https://github.com/sgalcheung"
},
"license": "MIT",
"keywords": [
"withastro",
"astro-loader"
],
"author": "Sgal Cheung <[email protected]>",
"license": "MIT",
"description": "Use your Squidex data in Astro projects",
"homepage": "https://sdk--starlight-squidex.netlify.app/",
"repository": {
"type": "git",
"url": "https://github.com/sgalcheung/starlight-squidex/tree/sdk",
"url": "https://github.com/sgalcheung/starlight-squidex.git",
"directory": "packages/desquidex"
},
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"exports": {
"./loaders": {
"types": "./dist/loaders.d.ts",
"default": "./dist/loaders.js"
},
"./schemas": {
"types": "./dist/data/models/schemas.d.ts",
"default": "./dist/data/models/schemas.js"
},
"./integrations": {
"types": "./dist/integrations.d.ts",
"default": "./dist/integrations.js"
}
},
"files": [
"dist"
],
"scripts": {
"generate": "ts-to-zod",
"dev": "tsup --watch",
"build": "tsup"
},
"type": "module",
"peerDependencies": {
"astro": "^5.0.0-beta"
},
"devDependencies": {
"astro": "5.0.0-beta.2",
"astro": "^5.0.0-beta",
"ts-to-zod": "^3.14.1",
"tsup": "^8.3.5",
"typescript": "^5.5.4",
"zod": "^3.23.8"
},
"dependencies": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { configService } from "../../configService";
import { configService } from "../../configService.js";
import { SquidexClient } from "@squidex/squidex";
import { InMemoryTokenStore } from "@squidex/squidex/dist/wrapper/SquidexClient.js";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { ZodType } from "zod";
import { z } from "astro/zod";
import type {
ResourceLink,
AppDto,
FeatureDto,
FeaturesDto,
ScheduleJobDto,
StatusInfoDto,
ContentDto,
ContentsDto,
} from "@squidex/squidex";

export enum SCHEMAS {
Expand All @@ -27,7 +23,7 @@ export const resourceLinkSchema = z.object({
href: z.string(),
method: z.string(),
metadata: z.string().optional().nullable(),
}) satisfies ZodType<ResourceLink>;
}); // satisfies ZodType<ResourceLink>;

export const appDtoSchema = z.object({
links: z.record(resourceLinkSchema),
Expand All @@ -44,7 +40,7 @@ export const appDtoSchema = z.object({
canAccessContent: z.boolean(),
roleName: z.string().optional().nullable(),
roleProperties: z.record(z.any()),
}) satisfies ZodType<AppDto>;
}); //satisfies ZodType<AppDto>;

export const featureDtoSchema = z.object({
name: z.string(),
Expand Down
1 change: 1 addition & 0 deletions packages/desquidex/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="astro/client" />
4 changes: 4 additions & 0 deletions packages/desquidex/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./data/models/schemas.js";

export { squidexCollections } from "./loaders.js";
export { refreshContentIntegration } from "./integrations.js";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AstroIntegration } from "astro";
import { validateRequest } from "./signatureUtils";
import { validateRequest } from "./signatureUtils.js";

export function refreshContentIntegration(
webhookSecret: string
Expand Down
20 changes: 10 additions & 10 deletions packages/desquidex/loaders.ts → packages/desquidex/src/loaders.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { AstroError } from "astro/errors";
import type { DataStore, Loader } from "astro/loaders";
import {
defineCollection,
type BaseSchema,
type CollectionConfig,
} from "astro:content";
import { configService, type Config } from "./configService";
import { getClient } from "./data/core/client";
import { configService, type Config } from "./configService.js";
import { getClient } from "./data/core/client.js";
import {
SCHEMAS,
SCHEMAS_CONST,
Expand All @@ -16,7 +15,7 @@ import {
dataSchema,
featuresDtoSchema,
type SCHEMAS_VALUES,
} from "./data/models/schemas";
} from "./data/models/schemas.js";

type DataEntry = Parameters<DataStore["set"]>[0];

Expand Down Expand Up @@ -74,14 +73,14 @@ export function squidexCollections<T extends string>(config: Config<T>) {

if (contentSchemaMapping) {
type SquidexContentSchemasLiteral = keyof typeof contentSchemaMapping;
type T = typeof contentSchemaMapping;
// type T = typeof contentSchemaMapping;

const schemaKeys = Object.keys(
contentSchemaMapping
) as SquidexContentSchemasLiteral[];
const schemaValues = Object.values(
contentSchemaMapping
) as T[SquidexContentSchemasLiteral][];
// const schemaValues = Object.values(
// contentSchemaMapping
// ) as T[SquidexContentSchemasLiteral][];

console.log("---------------");
schemaKeys.forEach((key) => {
Expand Down Expand Up @@ -111,6 +110,7 @@ export function squidexCollections<T extends string>(config: Config<T>) {
return contentCollections;
}
}
return null;
},
};

Expand All @@ -136,15 +136,15 @@ function makeLoader({
}: {
type: SCHEMAS;
schema: BaseSchema;
contentSchema?: string;
contentSchema?: string | undefined;
}) {
const { client } = getClient();

const name = contentSchema ?? type.toString();

const loader: Loader = {
name: `desquidex-${name}`,
load: async ({ store, parseData, logger, refreshContextData, meta }) => {
load: async ({ store, parseData, logger, refreshContextData }) => {
if (refreshContextData?.webhookBody) {
logger.info("Received incoming webhook");
// do something with the webhook body
Expand Down
File renamed without changes.
Loading

0 comments on commit 06741e1

Please sign in to comment.