Skip to content

Commit

Permalink
Monorepo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
LeahHirst committed Sep 18, 2024
1 parent da18615 commit a2b6ae7
Show file tree
Hide file tree
Showing 244 changed files with 22,600 additions and 59,012 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install, build, and upload your site
uses: withastro/action@v3
with:
path: ./site
path: ./apps/site

deploy:
needs: build
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v4

- name: Install modules
run: npm install
run: yarn

- name: Run tests
run: npm run test
run: yarn test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# turbo
.turbo
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion site/astro.config.mjs → apps/site/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// @ts-check
import { defineConfig } from 'astro/config';

import react from '@astrojs/react';

// https://astro.build/config
export default defineConfig({
site: 'https://nospacelang.org',
integrations: [react()],
});
});
File renamed without changes.
5 changes: 5 additions & 0 deletions site/package.json → apps/site/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "site",
"private": true,
"type": "module",
"version": "0.0.1",
"scripts": {
Expand All @@ -13,12 +14,16 @@
},
"dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/react": "^3.6.2",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@monaco-editor/react": "^4.6.0",
"@types/react": "^18.3.7",
"@types/react-dom": "^18.3.0",
"astro": "^4.15.4",
"monaco-editor": "^0.51.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.5.4"
},
"devDependencies": {
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
const { color, direction, width, height } = Astro.props;
function calculateDegrees(direction) {
function calculateDegrees(direction: 'left' | 'up' | 'right' | 'down') {
switch (direction) {
case 'left': return 90;
case 'up': return 180;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const Base = styled.button`
padding: 16px 10px;
font-weight: 500;
align-items: center;
color: white;
background-color: #767676;
&:hover {
background-color: #262626;
Expand Down
10 changes: 10 additions & 0 deletions apps/site/src/components/playground/Editor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { useEffect } from 'react';
import { Editor as MonacoEditor, useMonaco } from '@monaco-editor/react';

export default function Editor() {
const monaco = useMonaco();

return (
<MonacoEditor defaultValue="" theme="vs-dark" options={{ minimap: { enabled: false }, fontSize: 16, fontFamily: 'monaco, Consolas, "Lucida Console", monospace' }} />
);
}
10 changes: 10 additions & 0 deletions apps/site/src/components/playground/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
// import Editor, { DiffEditor, useMonaco, loader } from '@monaco-editor/react';
// import styled from '@emotion/styled';

export default function Header() {
return (
// <Editor defaultValue="" theme="vs-dark" />
<div>hello</div>
);
}
5 changes: 5 additions & 0 deletions apps/site/src/content/blog/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Test blog post
---

Testing
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const { title } = Astro.props;
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<style is:global>
body { margin: 0; }
* { font-family: -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; }
</style>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Blog from '../../layouts/blog.astro';
import { getEntry } from 'astro:content';
const entry = await getEntry('blog', 'type-system');
const { Content, headings } = await entry.render();
const entry = await getEntry('blog', 'test');
const { Content } = await entry.render();
---

<style is:global>
Expand All @@ -18,4 +18,4 @@ const { Content, headings } = await entry.render();
authorImage="https://avatars.githubusercontent.com/u/9085100?v=4"
>
<Content />
</Blog>
</Blog>
File renamed without changes.
4 changes: 2 additions & 2 deletions site/src/pages/play.astro → apps/site/src/pages/play.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Shell from '../layouts/shell.astro';
import Editor from '../components/editor.astro';
import Editor from '../components/playground/Editor.tsx';
import Chevron from '../components/chevron.astro';
---

Expand Down Expand Up @@ -178,7 +178,7 @@ import Chevron from '../components/chevron.astro';
Insert
</div>
</div>
<Editor client:load />
<Editor client:only="react" />
</div>
<div class="sidebar">
<div class="field">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/site/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
}
File renamed without changes.
6 changes: 0 additions & 6 deletions astro.config.mjs

This file was deleted.

Loading

0 comments on commit a2b6ae7

Please sign in to comment.