Skip to content

Commit

Permalink
Chore: add new theme and cleanup (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adammatthiesen authored Feb 18, 2024
2 parents c9ed407 + 32da6bf commit 7e29bd8
Show file tree
Hide file tree
Showing 23 changed files with 156 additions and 36 deletions.
6 changes: 6 additions & 0 deletions .changeset/long-pens-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@matthiesenxyz/create-astro-ghostcms": patch
"@matthiesenxyz/astro-ghostcms": patch
---

cleanup and add new theme
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 6 additions & 4 deletions packages/astro-ghostcms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/create-astro-ghostcms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ npx @matthiesenxyz/create-astro-ghostcms --<arg>
| ------------ | ----------------------------------------------------- |
| `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 |
10 changes: 0 additions & 10 deletions packages/create-astro-ghostcms/index.d.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/create-astro-ghostcms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"bin": {
"create-astro-ghostcms": "./create-astro-ghostcms.mjs"
},
"exports": {
".": "./create-astro-ghostcms.mjs"
"scripts": {
"test": "node . --dry"
},
"scripts": {},
"sideEffects": false,
"author": {
"email": "[email protected]",
Expand Down
17 changes: 13 additions & 4 deletions packages/create-astro-ghostcms/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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}`));
}
Expand All @@ -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
*/
10 changes: 4 additions & 6 deletions packages/create-astro-ghostcms/src/scripts/createProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
*/
2 changes: 1 addition & 1 deletion packages/create-astro-ghostcms/src/templates/basic/LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions packages/create-astro-ghostcms/src/templates/brutal/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 11 additions & 0 deletions packages/create-astro-ghostcms/src/templates/brutal/README.md
Original file line number Diff line number Diff line change
@@ -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)

Original file line number Diff line number Diff line change
@@ -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",
})
],
});
25 changes: 25 additions & 0 deletions packages/create-astro-ghostcms/src/templates/brutal/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="astro/client" />
interface ImportMetaEnv {
readonly CONTENT_API_KEY: string
readonly CONTENT_API_URL: string
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "astro/tsconfigs/strict",
"exclude": ["dist"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import brutalTheme from '@matthiesenxyz/astro-ghostcms-brutalbyelian';
import { defineConfig } from 'unocss';

export default defineConfig({
presets: [ brutalTheme() ],
});
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions packages/create-astro-ghostcms/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -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"];
2 changes: 1 addition & 1 deletion packages/create-astro-ghostcms/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function isPackageManager(str) {
}

/**
* @typedef {import("../../types").PackageManager} PackageManager
* @typedef {import("../types.js").PackageManager} PackageManager
*/

/**
Expand Down
3 changes: 0 additions & 3 deletions packages/create-astro-ghostcms/types.d.ts

This file was deleted.

0 comments on commit 7e29bd8

Please sign in to comment.