Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atp #11

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

atp #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"composite": true,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"inlineSources": false,
"isolatedModules": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmitOnError": true,
"removeComments": false,
"skipLibCheck": true,
"strict": true,
"target": "ESNext",
"verbatimModuleSyntax": true
}
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Astro
.astro

# Moon
.moon/cache
.moon/docker

# Logs
logs
*.log
Expand Down
20 changes: 20 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
node:
packageManager: pnpm
addEnginesConstraint: true
dedupeOnLockfileChange: true
dependencyVersionFormat: workspace
inferTasksFromScripts: false
syncProjectWorkspaceDependencies: true
syncVersionManagerConfig: nodenv

typescript:
createMissingConfig: true
includeProjectReferenceSources: true
includeSharedTypes: false # true
projectConfigFileName: 'tsconfig.json'
root: '.'
rootConfigFileName: 'tsconfig.json'
rootOptionsConfigFileName: '.config/tsconfig.json'
routeOutDirToCache: true
syncProjectReferences: true
syncProjectReferencesToPaths: true
26 changes: 26 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
projects:
# site: 'apps/site'
demo: 'apps/demo'
lib: 'libs/confstellation'

# codeowners:
# syncOnRun: true
# orderBy: project-name
# globalPaths:
# '*': ['@alexanderniebuhr']

vcs:
manager: git
provider: github
defaultBranch: 'main'
remoteCandidates:
- "origin"
- "upstream"

runner:
inheritColorsForPipedTasks: true

experiments:
taskOutputBoundaries: true

telemetry: true
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.13.1
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exact=true
shell-emulator=true
engine-strict=true
9 changes: 9 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# renovate: datasource=github-tags depName=moonrepo/moon
moon = "1.25.0"
# renovate: datasource=node-version depName=node versioning=node
node = "20.13.1"
# renovate: datasource=npm depName=pnpm
pnpm = "9.1.3"

[plugins]
moon = "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[astro]": {
"editor.defaultFormatter": "astro-build.astro-vscode"
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# confstellation

Astrolicious Hackathon
38 changes: 38 additions & 0 deletions apps/demo/astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import Confstellation from '@astrolicious/confstellation';
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';

export default defineConfig({
output: 'server',
adapter: cloudflare({
platformProxy: {
enabled: true,
},
}),
experimental: {
actions: true,
rewriting: true,
},
integrations: [
Confstellation({
config: {
conferenceName: 'Astro',
conferenceSlogan: 'The best conference ever',
conferenceDate: '2024-09-01T14:00:00Z',
nav: [
{ label: 'Home', link: '/' },
{ label: 'Code of Conduct', link: '/documentation/code-of-conduct' },
],
},
pages: {},
overrides: {
styles: ['./src/styles/overrides.css'],
},
}),
],
vite: {
ssr: {
external: ['node:async_hooks'],
},
},
});
61 changes: 61 additions & 0 deletions apps/demo/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
type: application
language: typescript
stack: frontend

dependsOn:
- lib

fileGroups:
sources:
- "public/**/*"
- "src/**/*"
- "astro.config.ts"
tests:
- "tests/**/*"

tasks:
astro:
command: "astro"
local: true

check:
command: "astro check"
inputs:
- "@group(sources)"

imports:
command: "biome check --apply --formatter-enabled=false --linter-enabled=false ./"
inputs:
- "@group(sources)"

format:
deps:
- "~:imports"
command: "biome format --write ./"
inputs:
- "@group(sources)"

lint:
deps:
- "~:format"
command: "biome lint --apply ./"
inputs:
- "@group(sources)"

build:
deps:
- "~:lint"
# - "~:check"
command: "astro build"
inputs:
- "@group(sources)"
outputs:
- "dist"

dev:
command: "astro dev"
local: true
options:
persistent: true
runInCI: false
cache: false
21 changes: 21 additions & 0 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "demo",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/cloudflare": "10.1.0",
"@astrolicious/confstellation": "workspace:^",
"astro": "4.9.2"
},
"devDependencies": {
"wrangler": "3.58.0"
}
}
5 changes: 5 additions & 0 deletions apps/demo/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { subscribe } from '@astrolicious/confstellation/actions';

export const server = {
subscribe,
};
6 changes: 6 additions & 0 deletions apps/demo/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineCollection } from 'astro:content';
import { confstellationSchema } from '@astrolicious/confstellation/schema';

export const collections = {
confstellation: defineCollection({ schema: confstellationSchema }),
};
26 changes: 26 additions & 0 deletions apps/demo/src/content/confstellation/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: AstroConf
hero:
name: "AstroConf"
tagline: "Everything you need to build a stellar documentation website. Fast, accessible, and easy-to-use."
date: "2024-09-16T14:00:00Z"
location: "The Internet."
actions:
- text: "View on Discord"
link: https://astro.build/chat
---

import { Hero, Form } from "confstellation:components";

<Hero hero={frontmatter.hero}>
<Fragment slot="actions">
{frontmatter.hero.actions.map((action) => (
<button>{action.text}</button>
))}
<Form />
</Fragment>
</Hero>

## Code of Conduct

Lorem ipsum
5 changes: 5 additions & 0 deletions apps/demo/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="../.astro/actions.d.ts" />
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
/// <reference types="../.astro/confstellation.d.ts" />
/// <reference types="../.astro/.d.ts" />
10 changes: 10 additions & 0 deletions apps/demo/src/styles/overrides.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@layer overrides {
:root {
/* --confstellation-bg-light: var(--neutral-50);
--confstellation-bg-dark: var(--neutral-950);
--confstellation-accent-light: var(--cyan-700);
--confstellation-accent-dark: var(--cyan-300);
--confstellation-text-light: black;
--confstellation-text-dark: white; */
}
}
16 changes: 16 additions & 0 deletions apps/demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../.config/tsconfig.json",
"include": ["**/*", "../../libs/confstellation/**/*"],
"references": [
{
"path": "../../libs/confstellation"
}
],
"compilerOptions": {
"outDir": "../../.moon/cache/types/apps/demo",
"paths": {
"@astrolicious/confstellation": ["../../libs/confstellation/index.ts"],
"@astrolicious/confstellation/*": ["../../libs/confstellation/src/*"]
}
}
}
4 changes: 4 additions & 0 deletions apps/demo/wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "confstellation-demo"

compatibility_flags = ["nodejs_als"]
pages_build_output_dir = "dist"
33 changes: 33 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": true
},
"formatter": {
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingComma": "es5"
}
},
"json": {
"formatter": {
"indentStyle": "space"
}
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": { "recommended": true }
}
}
1 change: 1 addition & 0 deletions libs/confstellation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# confstellation
12 changes: 12 additions & 0 deletions libs/confstellation/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineAction } from 'astro:actions';
import { z } from 'astro/zod';
export const subscribe = defineAction({
accept: 'form',
input: z.object({
email: z.string().email(),
}),
handler: async ({ email }) => {
console.log('DEBUG:', email, 'subscribed');
return { success: true };
},
});
19 changes: 19 additions & 0 deletions libs/confstellation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import defineTheme from 'astro-theme-provider';
import { z } from 'astro/zod';
import mdx from '@astrojs/mdx';

export default defineTheme({
name: 'confstellation',
schema: z.object({
conferenceName: z.string(),
conferenceSlogan: z.string().optional(),
conferenceDate: z.string().datetime(),
nav: z.array(
z.object({
label: z.string(),
link: z.string(),
})
),
}),
integrations: [mdx()],
});
Loading