Skip to content

Commit

Permalink
feat(nebula): setup project nebula (litespace landing page)
Browse files Browse the repository at this point in the history
  • Loading branch information
neuodev committed Aug 5, 2024
1 parent bd027b8 commit 1cf3bf5
Show file tree
Hide file tree
Showing 22 changed files with 1,601 additions and 207 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ jobs:
run: yarn build:luna:vercel
- name: Deploy Luna to Vercel
run: yarn deploy:luna:vercel --token=${{ secrets.VERCEL_TOKEN }}
# Nebula Deployment
- name: Pull Nebula from Vercel
run: yarn vercel:ci pull "nebula" "nebula/" --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Nebula using Vercel
run: yarn build:nebula:vercel
- name: Deploy Nebula to Vercel
run: yarn deploy:nebula:vercel --token=${{ secrets.VERCEL_TOKEN }}
3 changes: 3 additions & 0 deletions nebula/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions nebula/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
3 changes: 3 additions & 0 deletions nebula/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nebula

LiteSpace landing page
Binary file added nebula/app/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions nebula/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
22 changes: 22 additions & 0 deletions nebula/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "LiteSpace",
description: "Learn English with ease!",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
9 changes: 9 additions & 0 deletions nebula/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Image from "next/image";

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<h1 className="text-9xl italic">LiteSpace</h1>
</main>
);
}
7 changes: 7 additions & 0 deletions nebula/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
distDir: "dist",
};

export default nextConfig;
29 changes: 29 additions & 0 deletions nebula/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@litespace/nebula",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build:vercel": "yarn vercel build",
"deploy:vercel": "yarn vercel deploy --prebuilt",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5",
"vercel": "^34.2.7"
}
}
8 changes: 8 additions & 0 deletions nebula/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;
1 change: 1 addition & 0 deletions nebula/public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions nebula/public/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions nebula/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Config } from "tailwindcss";

const config: Config = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
},
},
plugins: [],
};
export default config;
22 changes: 22 additions & 0 deletions nebula/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [{ "name": "next" }],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion nova/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"vercel": "^35.2.2",
"vercel": "^34.2.7",
"vite": "^5.2.0"
}
}
2 changes: 1 addition & 1 deletion nova/src/pages/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Root: React.FC = () => {

return (
<div className="mx-auto max-w-screen-md my-10">
<h1>Version: 2.0</h1>
<ul className="flex flex-col gap-4">
<li>
<Link to={Route.Login}>
Expand Down Expand Up @@ -56,7 +57,6 @@ const Root: React.FC = () => {
</Button>
</li>
</ul>

<div className="mt-10">
<pre
className="bg-gray-50 p-3 rounded-md text-gray-700 font-mono"
Expand Down
2 changes: 1 addition & 1 deletion orbit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"typescript": "^5.4.5",
"vercel": "^35.2.2",
"vercel": "^34.2.7",
"vite": "^4.3.1"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions orbit/src/providers/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,12 @@ export const dataProvider: DataProvider = {

if (resource === Resource.Users) {
const list = await atlas.user.list();
return { data: as.any(list), total: list.length };
return { data: as.any(list).list, total: as.any(list).total };
}

if (resource === Resource.Tutors) {
const list = await atlas.tutor.findAll();
return { data: as.casted(list), total: list.length };
return { data: as.any(list).list, total: as.any(list).total };
}

if (resource === Resource.TutorsMedia) {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"build:orbit:vercel": "yarn workspace @litespace/orbit build:vercel",
"build:nova:vercel": "yarn workspace @litespace/nova build:vercel",
"build:luna:vercel": "yarn workspace @litespace/luna build:vercel",
"build:nebula:vercel": "yarn workspace @litespace/nebula build:vercel",
"deploy:orbit:vercel": "yarn workspace @litespace/orbit deploy:vercel",
"deploy:nova:vercel": "yarn workspace @litespace/nova deploy:vercel",
"deploy:luna:vercel": "yarn workspace @litespace/luna deploy:vercel",
"deploy:nebula:vercel": "yarn workspace @litespace/nebula deploy:vercel",
"vercel": "env-cmd ts-node scripts/vercel.ts",
"vercel:ci": "ts-node scripts/vercel.ts"
},
Expand All @@ -28,7 +30,8 @@
"orbit",
"atlas",
"types",
"nova"
"nova",
"nebula"
]
},
"packageManager": "[email protected]",
Expand Down
17 changes: 14 additions & 3 deletions scripts/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { Command } from "commander";
import fs from "node:fs";
import path from "node:path";

type Framework = "vite" | "nextjs";

type Project = {
id: string;
name: string;
accountId: string;
createdAt: string;
framework: string;
framework: Framework;
devCommand: string | null;
installCommand: string | null;
buildCommand: string | null;
Expand Down Expand Up @@ -46,23 +48,25 @@ async function findProject(name: string, token?: string): Promise<Project> {

async function createProject({
name,
framework = "vite",
buildCommand = "yarn build",
outputDirectory = "dist",
installCommand = "yarn",
token,
}: {
name: string;
framework?: Framework;
buildCommand?: string;
outputDirectory?: string;
installCommand?: string;
token?: string;
}): Promise<Project> {
const { data } = await client(token).post<Project>("/v10/projects", {
name,
framework,
buildCommand,
installCommand,
outputDirectory,
framework: "vite",
});

return data;
Expand Down Expand Up @@ -99,15 +103,22 @@ const create = new Command()
.option("-b, --build <build-command>", "Project build command")
.option("-i, --install <install-command>", "Project install command")
.option("-o, --output <output-directory>", "Project output directory")
.option("-f, --framework <framework>", "Project framework")
.action(
async (
name: string,
options: { build?: string; install?: string; output?: string }
options: {
build?: string;
install?: string;
output?: string;
framework: Framework;
}
) => {
const project = await safe(() =>
createProject({
name,
buildCommand: options.build,
framework: options.framework,
installCommand: options.install,
outputDirectory: options.output,
})
Expand Down
Loading

0 comments on commit 1cf3bf5

Please sign in to comment.