Skip to content

Commit 524d87a

Browse files
committed
feat(admin): 🎉 admin initialize with tailwind
1 parent 20f3841 commit 524d87a

File tree

14 files changed

+15557
-0
lines changed

14 files changed

+15557
-0
lines changed

apps/admin/.eslintrc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"extends": [
3+
"plugin:@nx/react-typescript",
4+
"next",
5+
"next/core-web-vitals",
6+
"../../.eslintrc.json"
7+
],
8+
"ignorePatterns": ["!**/*", ".next/**/*"],
9+
"overrides": [
10+
{
11+
"files": ["*.*"],
12+
"rules": {
13+
"@next/next/no-html-link-for-pages": "off"
14+
}
15+
},
16+
{
17+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
18+
"rules": {
19+
"@next/next/no-html-link-for-pages": ["error", "apps/admin/pages"]
20+
}
21+
},
22+
{
23+
"files": ["*.ts", "*.tsx"],
24+
"rules": {}
25+
},
26+
{
27+
"files": ["*.js", "*.jsx"],
28+
"rules": {}
29+
}
30+
]
31+
}

apps/admin/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
declare module '*.svg' {
3+
const content: any;
4+
export const ReactComponent: any;
5+
export default content;
6+
}

apps/admin/next.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//@ts-check
2+
3+
// eslint-disable-next-line @typescript-eslint/no-var-requires
4+
const { composePlugins, withNx } = require('@nx/next');
5+
6+
/**
7+
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
8+
**/
9+
const nextConfig = {
10+
nx: {
11+
// Set this to true if you would like to to use SVGR
12+
// See: https://github.com/gregberge/svgr
13+
svgr: false,
14+
},
15+
16+
compiler: {
17+
// For other options, see https://styled-components.com/docs/tooling#babel-plugin
18+
styledComponents: true,
19+
},
20+
experimental: {
21+
typedRoutes: true,
22+
},
23+
};
24+
25+
const plugins = [
26+
// Add more Next.js plugins to this list if needed.
27+
withNx,
28+
];
29+
30+
module.exports = composePlugins(...plugins)(nextConfig);

apps/admin/postcss.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { join } = require('path');
2+
3+
// Note: If you use library-specific PostCSS/Tailwind configuration then you should remove the `postcssConfig` build
4+
// option from your application's configuration (i.e. project.json).
5+
//
6+
// See: https://nx.dev/guides/using-tailwind-css-in-react#step-4:-applying-configuration-to-libraries
7+
8+
module.exports = {
9+
plugins: {
10+
tailwindcss: {
11+
config: join(__dirname, 'tailwind.config.js'),
12+
},
13+
autoprefixer: {},
14+
},
15+
};

apps/admin/project.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "admin",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/admin",
5+
"projectType": "application",
6+
"targets": {
7+
"build": {
8+
"executor": "@nx/next:build",
9+
"outputs": ["{options.outputPath}"],
10+
"defaultConfiguration": "production",
11+
"options": {
12+
"outputPath": "dist/apps/admin"
13+
},
14+
"configurations": {
15+
"development": {
16+
"outputPath": "apps/admin"
17+
},
18+
"production": {}
19+
}
20+
},
21+
"serve": {
22+
"executor": "@nx/next:server",
23+
"defaultConfiguration": "development",
24+
"options": {
25+
"buildTarget": "admin:build",
26+
"dev": true
27+
},
28+
"configurations": {
29+
"development": {
30+
"buildTarget": "admin:build:development",
31+
"dev": true
32+
},
33+
"production": {
34+
"buildTarget": "admin:build:production",
35+
"dev": false
36+
}
37+
}
38+
},
39+
"export": {
40+
"executor": "@nx/next:export",
41+
"options": {
42+
"buildTarget": "admin:build:production"
43+
}
44+
},
45+
"lint": {
46+
"executor": "@nx/eslint:lint",
47+
"outputs": ["{options.outputFile}"],
48+
"options": {
49+
"lintFilePatterns": ["apps/admin/**/*.{ts,tsx,js,jsx}"]
50+
}
51+
}
52+
},
53+
"tags": []
54+
}

apps/admin/public/.gitkeep

Whitespace-only changes.

apps/admin/public/favicon.ico

14.7 KB
Binary file not shown.

apps/admin/src/app/layout.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import '../styles/global.css';
2+
import { StyledComponentsRegistry } from './registry';
3+
4+
export const metadata = {
5+
title: 'Welcome to demo2',
6+
description: 'Generated by create-nx-workspace',
7+
};
8+
9+
export default function RootLayout({
10+
children,
11+
}: {
12+
children: React.ReactNode;
13+
}) {
14+
return (
15+
<html lang="en">
16+
<body>
17+
<StyledComponentsRegistry>{children}</StyledComponentsRegistry>
18+
</body>
19+
</html>
20+
);
21+
}

0 commit comments

Comments
 (0)