From 1639191d93c5b2dcff9969c11c68a0104fe5db42 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Thu, 15 Feb 2024 07:39:56 -0800 Subject: [PATCH 1/2] some type fixes --- packages/astro-ghostcms/package.json | 10 ++++++---- packages/create-astro-ghostcms/package.json | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/astro-ghostcms/package.json b/packages/astro-ghostcms/package.json index 74470e3b..968fc270 100644 --- a/packages/astro-ghostcms/package.json +++ b/packages/astro-ghostcms/package.json @@ -47,13 +47,15 @@ ], "exports": { ".": "./index.ts", - "./api": "./src/api/index.ts", + "./api": { + "types": "./src/api/index.ts", + "default": "./src/api/index.ts" + }, "./api-core": "./src/api/content-api/index.ts", "./config": { - "default": "./src/integrations/virtual-config.ts", - "types": "./src/integrations/virtual.d.ts" + "types": "./src/integrations/virtual.d.ts", + "default": "./src/integrations/virtual-config.ts" }, - "./types": "./types.d.ts", "./satoriOG": "./src/integrations/satori.ts", "./404.astro": "./src/default-routes/404/404.astro", "./rss.xml.ts": "./src/default-routes/rss.xml.ts", diff --git a/packages/create-astro-ghostcms/package.json b/packages/create-astro-ghostcms/package.json index 7734e267..dbdb5800 100644 --- a/packages/create-astro-ghostcms/package.json +++ b/packages/create-astro-ghostcms/package.json @@ -7,6 +7,7 @@ "bin": { "create-astro-ghostcms": "./create-astro-ghostcms.mjs" }, + "types": "./index.d.ts", "exports": { ".": "./create-astro-ghostcms.mjs" }, From 32da6bfd7ed791cea894b28b2c8b9709ca862092 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Thu, 15 Feb 2024 08:47:49 -0800 Subject: [PATCH 2/2] cleanup and add new theme to create util --- .changeset/long-pens-tap.md | 6 +++++ package.json | 6 +++-- packages/create-astro-ghostcms/README.md | 1 + packages/create-astro-ghostcms/index.d.ts | 10 -------- packages/create-astro-ghostcms/package.json | 6 ++--- packages/create-astro-ghostcms/src/index.js | 17 ++++++++++--- .../src/scripts/createProject.js | 10 +++----- .../src/templates/basic/LICENSE | 2 +- .../src/templates/brutal/.gitignore | 1 + .../src/templates/brutal/LICENSE | 21 ++++++++++++++++ .../src/templates/brutal/README.md | 11 ++++++++ .../src/templates/brutal/astro.config.mjs | 16 ++++++++++++ .../src/templates/brutal/package.json | 25 +++++++++++++++++++ .../src/templates/brutal/public/favicon.svg | 9 +++++++ .../src/templates/brutal/src/env.d.ts | 9 +++++++ .../src/templates/brutal/tsconfig.json | 4 +++ .../src/templates/brutal/uno.config.ts | 6 +++++ .../src/templates/catppuccin/LICENSE | 2 +- .../src/templates/starterkit/LICENSE | 2 +- packages/create-astro-ghostcms/src/types.d.ts | 14 +++++++++++ .../create-astro-ghostcms/src/utils/index.js | 2 +- packages/create-astro-ghostcms/types.d.ts | 3 --- 22 files changed, 150 insertions(+), 33 deletions(-) create mode 100644 .changeset/long-pens-tap.md delete mode 100644 packages/create-astro-ghostcms/index.d.ts create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/.gitignore create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/LICENSE create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/README.md create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/astro.config.mjs create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/package.json create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/public/favicon.svg create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/src/env.d.ts create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/tsconfig.json create mode 100644 packages/create-astro-ghostcms/src/templates/brutal/uno.config.ts create mode 100644 packages/create-astro-ghostcms/src/types.d.ts delete mode 100644 packages/create-astro-ghostcms/types.d.ts diff --git a/.changeset/long-pens-tap.md b/.changeset/long-pens-tap.md new file mode 100644 index 00000000..2283f319 --- /dev/null +++ b/.changeset/long-pens-tap.md @@ -0,0 +1,6 @@ +--- +"@matthiesenxyz/create-astro-ghostcms": patch +"@matthiesenxyz/astro-ghostcms": patch +--- + +cleanup and add new theme diff --git a/package.json b/package.json index c0bb222b..90ee3197 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,11 @@ "lint:fix": "biome check --apply .", "ci:version": "pnpm changeset version", "ci:publish": "pnpm changeset publish", - "ci:test:api": "pnpm --filter astro-ghostcms test:ci", "test:api": "pnpm --filter astro-ghostcms test", + "ci:test:api": "pnpm --filter astro-ghostcms test:ci", + "test:api": "pnpm --filter astro-ghostcms test", "test:api:watch": "pnpm --filter astro-ghostcms test:watch", - "test:api:coverage": "pnpm --filter astro-ghostcms test:coverage" + "test:api:coverage": "pnpm --filter astro-ghostcms test:coverage", + "test:create": "pnpm --filter create-astro-ghostcms test" }, "devDependencies": { "@biomejs/biome": "1.5.3", diff --git a/packages/create-astro-ghostcms/README.md b/packages/create-astro-ghostcms/README.md index b6f697ad..e35f6010 100644 --- a/packages/create-astro-ghostcms/README.md +++ b/packages/create-astro-ghostcms/README.md @@ -31,4 +31,5 @@ npx @matthiesenxyz/create-astro-ghostcms -- | ------------ | ----------------------------------------------------- | | `basic` | Basic Setup with astro-ghostcms and theme-default | | `catppuccin` | Integration w/ Catppuccin & TailwindCSS | +| `brutal` | Integration w/ BrutalbyElian & UnoCSS | | `starterkit` | Integration in API-Only Mode with customizable theme | diff --git a/packages/create-astro-ghostcms/index.d.ts b/packages/create-astro-ghostcms/index.d.ts deleted file mode 100644 index c62fcbbf..00000000 --- a/packages/create-astro-ghostcms/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface Context { - dryRun: boolean; - installDeps: boolean; - initGitRepo: boolean; - template: string; - pkgManager: "npm" | "yarn" | "pnpm" | null; - args: string[]; -} - -export type Template = ["basic", "starterkit", "catppuccin"]; diff --git a/packages/create-astro-ghostcms/package.json b/packages/create-astro-ghostcms/package.json index dbdb5800..fbea3734 100644 --- a/packages/create-astro-ghostcms/package.json +++ b/packages/create-astro-ghostcms/package.json @@ -7,11 +7,9 @@ "bin": { "create-astro-ghostcms": "./create-astro-ghostcms.mjs" }, - "types": "./index.d.ts", - "exports": { - ".": "./create-astro-ghostcms.mjs" + "scripts": { + "test": "node . --dry" }, - "scripts": {}, "sideEffects": false, "author": { "email": "adam@matthiesen.xyz", diff --git a/packages/create-astro-ghostcms/src/index.js b/packages/create-astro-ghostcms/src/index.js index d3a96def..82752bff 100644 --- a/packages/create-astro-ghostcms/src/index.js +++ b/packages/create-astro-ghostcms/src/index.js @@ -100,6 +100,12 @@ export async function main() { c.italic("Integration w/ Catppuccin TailwindCSS theme"), )}`, }, + { + value: "brutal", + label: `${c.magenta("BrutalbyElian")} - ${c.cyan( + c.italic("Integration w/ BrutalbyElian UnoCSS theme"), + )}`, + }, { value: "starterkit", label: `${c.magenta("Starter Kit")} - ${c.cyan( @@ -135,6 +141,9 @@ export async function main() { case "catppuccin": await createProject(ctx).catch(console.error); break; + case "brutal": + await createProject(ctx).catch(console.error); + break; default: throw new Error(c.red(`Unknown template: ${template}`)); } @@ -160,11 +169,11 @@ function getHelp() { * @returns {template is Template} */ function isValidTemplate(template) { - return ["basic", "starterkit"].includes(template); + return ["basic", "starterkit", "catppuccin", "brutal"].includes(template); } /** - * @typedef {import("../types.js").Template} Template - * @typedef {import("../types.js").PackageManager} PackageManager - * @typedef {import("../types.js").Context} Context + * @typedef {import("./types.js").Template} Template + * @typedef {import("./types.js").PackageManager} PackageManager + * @typedef {import("./types.js").Context} Context */ diff --git a/packages/create-astro-ghostcms/src/scripts/createProject.js b/packages/create-astro-ghostcms/src/scripts/createProject.js index e492f024..f100c8d1 100644 --- a/packages/create-astro-ghostcms/src/scripts/createProject.js +++ b/packages/create-astro-ghostcms/src/scripts/createProject.js @@ -11,8 +11,6 @@ import { wait, } from "../utils/index.js"; -//const runnerName = "basic"; - /** @param {Context} ctx */ export async function createProject(ctx) { let { args, dryRun, initGitRepo, installDeps, template } = ctx; @@ -276,8 +274,8 @@ function isValidProjectName(projectName) { } /** - * @typedef {import("../../types.js").Template} Template - * @typedef {import("../../types.js").PackageManager} PackageManager - * @typedef {import("../../types.js").Context} Context - * @typedef {import("../../types.js").Serializable} Serializable + * @typedef {import("../types.js").Template} Template + * @typedef {import("../types.js").PackageManager} PackageManager + * @typedef {import("../types.js").Context} Context + * @typedef {import("../types.js").Serializable} Serializable */ diff --git a/packages/create-astro-ghostcms/src/templates/basic/LICENSE b/packages/create-astro-ghostcms/src/templates/basic/LICENSE index 88dd1335..592eb27d 100644 --- a/packages/create-astro-ghostcms/src/templates/basic/LICENSE +++ b/packages/create-astro-ghostcms/src/templates/basic/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Matthiesen XYZ +Copyright (c) 2024 MatthiesenXYZ - Astro-GhostCMS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/create-astro-ghostcms/src/templates/brutal/.gitignore b/packages/create-astro-ghostcms/src/templates/brutal/.gitignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/templates/brutal/LICENSE b/packages/create-astro-ghostcms/src/templates/brutal/LICENSE new file mode 100644 index 00000000..592eb27d --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 MatthiesenXYZ - Astro-GhostCMS + +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. diff --git a/packages/create-astro-ghostcms/src/templates/brutal/README.md b/packages/create-astro-ghostcms/src/templates/brutal/README.md new file mode 100644 index 00000000..608b1aba --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/README.md @@ -0,0 +1,11 @@ +# Astro-GhostCMS Demo Template + +[Demo](https://brutal-demo.astro-ghostcms.xyz/) + +This Repo is a Demo Website for the [@matthiesenxyz/astro-ghostcms](https://github.com/MatthiesenXYZ/astro-ghostcms) integraion. + + +### For more information Check our website + +[Astro-GhostCMS.xyz](https://astro-ghostcms.xyz) + diff --git a/packages/create-astro-ghostcms/src/templates/brutal/astro.config.mjs b/packages/create-astro-ghostcms/src/templates/brutal/astro.config.mjs new file mode 100644 index 00000000..7eeba2bd --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/astro.config.mjs @@ -0,0 +1,16 @@ +import { defineConfig } from "astro/config"; +import ghostcms from "@matthiesenxyz/astro-ghostcms"; +import UnoCSS from 'unocss/astro'; + +// https://astro.build/config +export default defineConfig({ + site: "https://example.xyz/", + trailingSlash: 'ignore', + integrations: [ + UnoCSS({ injectReset: true }), + ghostcms({ + theme: "@matthiesenxyz/astro-ghostcms-brutalbyelian", + ghostURL: "https://ghostdemo.matthiesen.xyz", + }) + ], +}); diff --git a/packages/create-astro-ghostcms/src/templates/brutal/package.json b/packages/create-astro-ghostcms/src/templates/brutal/package.json new file mode 100644 index 00000000..3f35d750 --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/package.json @@ -0,0 +1,25 @@ +{ + "name": "{{PROJECT_NAME}}", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro check && astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "astro": "^4.3.2", + "@matthiesenxyz/astro-ghostcms": "^3.2.2", + "@matthiesenxyz/astro-ghostcms-brutalbyelian": "^0.0.5", + "@unocss/astro": "^0.57.7" + }, + "devDependencies": { + "@astrojs/check": "^0.4.1", + "@unocss/reset": "^0.57.7", + "typescript": "^5.3.3", + "postcss": "8.4.35", + "unocss": "^0.57.7" + } +} diff --git a/packages/create-astro-ghostcms/src/templates/brutal/public/favicon.svg b/packages/create-astro-ghostcms/src/templates/brutal/public/favicon.svg new file mode 100644 index 00000000..f157bd1c --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/public/favicon.svg @@ -0,0 +1,9 @@ + + + + diff --git a/packages/create-astro-ghostcms/src/templates/brutal/src/env.d.ts b/packages/create-astro-ghostcms/src/templates/brutal/src/env.d.ts new file mode 100644 index 00000000..e8c8b171 --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/src/env.d.ts @@ -0,0 +1,9 @@ +/// +interface ImportMetaEnv { + readonly CONTENT_API_KEY: string + readonly CONTENT_API_URL: string +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/templates/brutal/tsconfig.json b/packages/create-astro-ghostcms/src/templates/brutal/tsconfig.json new file mode 100644 index 00000000..0be1a571 --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "astro/tsconfigs/strict", + "exclude": ["dist"] +} \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/templates/brutal/uno.config.ts b/packages/create-astro-ghostcms/src/templates/brutal/uno.config.ts new file mode 100644 index 00000000..d056c836 --- /dev/null +++ b/packages/create-astro-ghostcms/src/templates/brutal/uno.config.ts @@ -0,0 +1,6 @@ +import brutalTheme from '@matthiesenxyz/astro-ghostcms-brutalbyelian'; +import { defineConfig } from 'unocss'; + +export default defineConfig({ + presets: [ brutalTheme() ], +}); diff --git a/packages/create-astro-ghostcms/src/templates/catppuccin/LICENSE b/packages/create-astro-ghostcms/src/templates/catppuccin/LICENSE index 88dd1335..592eb27d 100644 --- a/packages/create-astro-ghostcms/src/templates/catppuccin/LICENSE +++ b/packages/create-astro-ghostcms/src/templates/catppuccin/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Matthiesen XYZ +Copyright (c) 2024 MatthiesenXYZ - Astro-GhostCMS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/create-astro-ghostcms/src/templates/starterkit/LICENSE b/packages/create-astro-ghostcms/src/templates/starterkit/LICENSE index 848a13f2..592eb27d 100644 --- a/packages/create-astro-ghostcms/src/templates/starterkit/LICENSE +++ b/packages/create-astro-ghostcms/src/templates/starterkit/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Adam Matthiesen +Copyright (c) 2024 MatthiesenXYZ - Astro-GhostCMS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/create-astro-ghostcms/src/types.d.ts b/packages/create-astro-ghostcms/src/types.d.ts new file mode 100644 index 00000000..97e359e8 --- /dev/null +++ b/packages/create-astro-ghostcms/src/types.d.ts @@ -0,0 +1,14 @@ +export * from "./index"; + +export interface Context { + dryRun: boolean; + installDeps: boolean; + initGitRepo: boolean; + template: string; + pkgManager: "npm" | "yarn" | "pnpm" | null; + args: string[]; +} + +export type PackageManager = "npm" | "yarn" | "pnpm"; +export type Serializable = string | object | number | boolean | bigint; +export type Template = ["basic", "starterkit", "catppuccin", "brutal"]; diff --git a/packages/create-astro-ghostcms/src/utils/index.js b/packages/create-astro-ghostcms/src/utils/index.js index fe97620a..dbd24764 100644 --- a/packages/create-astro-ghostcms/src/utils/index.js +++ b/packages/create-astro-ghostcms/src/utils/index.js @@ -33,7 +33,7 @@ export function isPackageManager(str) { } /** - * @typedef {import("../../types").PackageManager} PackageManager + * @typedef {import("../types.js").PackageManager} PackageManager */ /** diff --git a/packages/create-astro-ghostcms/types.d.ts b/packages/create-astro-ghostcms/types.d.ts deleted file mode 100644 index fc102873..00000000 --- a/packages/create-astro-ghostcms/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./index"; -export type PackageManager = "npm" | "yarn" | "pnpm"; -export type Serializable = string | object | number | boolean | bigint;