@suryasairus/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ const { spawn } = require('child_process');
3
+ const path = require('path');
4
+
5
+ const arg = process.argv[2] || 'dev';
6
+ const corePath = path.resolve(__dirname, '..');
7
+ const userPath = process.cwd();
8
+ const isWindows = process.platform === 'win32';
9
+
10
+ const nextBin = path.join(corePath, 'node_modules', '.bin', isWindows ? 'next.cmd' : 'next');
11
+
12
+ // IMPORTANT: We now run the command from 'userPath'
13
+ // but we pass 'corePath' as the argument so Next knows where the code is.
14
+ const child = spawn(`"${nextBin}"`, [arg, `"${corePath}"` ], {
15
+ stdio: 'inherit',
16
+ shell: true,
17
+ cwd: userPath, // Run from the user's project folder
18
+ env: {
19
+ ...process.env,
20
+ NEXT_PUBLIC_USER_CWD: userPath
21
+ }
22
+ });
23
+
24
+ child.on('exit', (code) => process.exit(code));
@@ -0,0 +1,18 @@
1
+ import { defineConfig, globalIgnores } from "eslint/config";
2
+ import nextVitals from "eslint-config-next/core-web-vitals";
3
+ import nextTs from "eslint-config-next/typescript";
4
+
5
+ const eslintConfig = defineConfig([
6
+ ...nextVitals,
7
+ ...nextTs,
8
+ // Override default ignores of eslint-config-next.
9
+ globalIgnores([
10
+ // Default ignores of eslint-config-next:
11
+ ".next/**",
12
+ "out/**",
13
+ "build/**",
14
+ "next-env.d.ts",
15
+ ]),
16
+ ]);
17
+
18
+ export default eslintConfig;
package/next-env.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ /// <reference types="next/navigation-types/compat/navigation" />
4
+ import "./.projectCMS/dev/types/routes.d.ts";
5
+
6
+ // NOTE: This file should not be edited
7
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
package/next.config.js ADDED
@@ -0,0 +1,12 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ // Since the process is now running FROM the user folder,
4
+ // we can just point directly to .projectCMS
5
+ distDir: '.projectCMS',
6
+
7
+ transpilePackages: ['@project-cms/core'],
8
+ typescript: { ignoreBuildErrors: true },
9
+ eslint: { ignoreDuringBuilds: true }
10
+ };
11
+
12
+ module.exports = nextConfig;
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@suryasairus/core",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "bin": {
6
+ "project-cms": "./bin/cli.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "src",
11
+ "next.config.js",
12
+ "eslint.config.mjs",
13
+ "next-env.d.ts",
14
+ "eslint.config.mjs",
15
+ "postcss.config.js",
16
+ "tailwind.config.ts",
17
+ "tsconfig.json"
18
+ ],
19
+ "scripts": {
20
+ "dev": "next dev",
21
+ "build": "next build",
22
+ "start": "next start",
23
+ "lint": "eslint"
24
+ },
25
+ "dependencies": {
26
+ "next": "16.1.1",
27
+ "react": "19.2.3",
28
+ "react-dom": "19.2.3"
29
+ },
30
+ "devDependencies": {
31
+ "@tailwindcss/postcss": "^4",
32
+ "@types/node": "^20",
33
+ "@types/react": "^19",
34
+ "@types/react-dom": "^19",
35
+ "eslint": "^9",
36
+ "eslint-config-next": "16.1.1",
37
+ "tailwindcss": "^4",
38
+ "typescript": "^5"
39
+ }
40
+ }
Binary file
@@ -0,0 +1,26 @@
1
+ @import "tailwindcss";
2
+
3
+ :root {
4
+ --background: #ffffff;
5
+ --foreground: #171717;
6
+ }
7
+
8
+ @theme inline {
9
+ --color-background: var(--background);
10
+ --color-foreground: var(--foreground);
11
+ --font-sans: var(--font-geist-sans);
12
+ --font-mono: var(--font-geist-mono);
13
+ }
14
+
15
+ @media (prefers-color-scheme: dark) {
16
+ :root {
17
+ --background: #0a0a0a;
18
+ --foreground: #ededed;
19
+ }
20
+ }
21
+
22
+ body {
23
+ background: var(--background);
24
+ color: var(--foreground);
25
+ font-family: Arial, Helvetica, sans-serif;
26
+ }
@@ -0,0 +1,34 @@
1
+ import type { Metadata } from "next";
2
+ import { Geist, Geist_Mono } from "next/font/google";
3
+ import "./globals.css";
4
+
5
+ const geistSans = Geist({
6
+ variable: "--font-geist-sans",
7
+ subsets: ["latin"],
8
+ });
9
+
10
+ const geistMono = Geist_Mono({
11
+ variable: "--font-geist-mono",
12
+ subsets: ["latin"],
13
+ });
14
+
15
+ export const metadata: Metadata = {
16
+ title: "Create Next App",
17
+ description: "Generated by create next app",
18
+ };
19
+
20
+ export default function RootLayout({
21
+ children,
22
+ }: Readonly<{
23
+ children: React.ReactNode;
24
+ }>) {
25
+ return (
26
+ <html lang="en">
27
+ <body
28
+ className={`${geistSans.variable} ${geistMono.variable} antialiased`}
29
+ >
30
+ {children}
31
+ </body>
32
+ </html>
33
+ );
34
+ }
@@ -0,0 +1,65 @@
1
+ import Image from "next/image";
2
+
3
+ export default function Home() {
4
+ return (
5
+ <div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
6
+ <main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
7
+ <Image
8
+ className="dark:invert"
9
+ src="/next.svg"
10
+ alt="Next.js logo"
11
+ width={100}
12
+ height={20}
13
+ priority
14
+ />
15
+ <div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
16
+ <h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
17
+ To get started, edit the page.tsx file.
18
+ </h1>
19
+ <p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
20
+ Looking for a starting point or more instructions? Head over to{" "}
21
+ <a
22
+ href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
23
+ className="font-medium text-zinc-950 dark:text-zinc-50"
24
+ >
25
+ Templates
26
+ </a>{" "}
27
+ or the{" "}
28
+ <a
29
+ href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
30
+ className="font-medium text-zinc-950 dark:text-zinc-50"
31
+ >
32
+ Learning
33
+ </a>{" "}
34
+ center.
35
+ </p>
36
+ </div>
37
+ <div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
38
+ <a
39
+ className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
40
+ href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
41
+ target="_blank"
42
+ rel="noopener noreferrer"
43
+ >
44
+ <Image
45
+ className="dark:invert"
46
+ src="/vercel.svg"
47
+ alt="Vercel logomark"
48
+ width={16}
49
+ height={16}
50
+ />
51
+ Deploy Now
52
+ </a>
53
+ <a
54
+ className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
55
+ href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
56
+ target="_blank"
57
+ rel="noopener noreferrer"
58
+ >
59
+ Documentation
60
+ </a>
61
+ </div>
62
+ </main>
63
+ </div>
64
+ );
65
+ }
@@ -0,0 +1,5 @@
1
+ import type { NextApiRequest, NextApiResponse } from 'next'
2
+
3
+ export default function handler(req: NextApiRequest, res: NextApiResponse) {
4
+ res.status(200).json({ message: 'Hello World from API!' })
5
+ }
@@ -0,0 +1,26 @@
1
+ import type { Config } from 'tailwindcss';
2
+ import path from 'path';
3
+
4
+ const config: Config = {
5
+ content: [
6
+ // This points to the source files inside your CORE package
7
+ path.join(__dirname, './src/**/*.{js,ts,jsx,tsx}'),
8
+ // This allows the user to have their own components styled if they wish
9
+ './components/**/*.{js,ts,jsx,tsx}',
10
+ './app/**/*.{js,ts,jsx,tsx}',
11
+ ],
12
+ theme: {
13
+ extend: {
14
+ // You can add your CMS branding colors here
15
+ colors: {
16
+ cms: {
17
+ primary: '#0070f3',
18
+ secondary: '#1a1a1a',
19
+ }
20
+ }
21
+ },
22
+ },
23
+ plugins: [],
24
+ };
25
+
26
+ export default config;
package/tsconfig.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable",
7
+ "esnext"
8
+ ],
9
+ "allowJs": true,
10
+ "skipLibCheck": true,
11
+ "strict": true,
12
+ "noEmit": true,
13
+ "esModuleInterop": true,
14
+ "module": "esnext",
15
+ "moduleResolution": "bundler",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "jsx": "react-jsx",
19
+ "incremental": true,
20
+ "plugins": [
21
+ {
22
+ "name": "next"
23
+ }
24
+ ],
25
+ "paths": {
26
+ "@/*": [
27
+ "./src/*"
28
+ ]
29
+ }
30
+ },
31
+ "include": [
32
+ "next-env.d.ts",
33
+ "**/*.ts",
34
+ "**/*.tsx",
35
+ ".next/types/**/*.ts",
36
+ ".next/dev/types/**/*.ts",
37
+ "**/*.mts",
38
+ ".projectCMS/types/**/*.ts",
39
+ ".projectCMS/dev/types/**/*.ts"
40
+ ],
41
+ "exclude": [
42
+ "node_modules"
43
+ ]
44
+ }