Skip to content

Commit

Permalink
feat(admin): 🎉 admin initialize with tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
MuttakinHasib committed Nov 13, 2023
1 parent 20f3841 commit 524d87a
Show file tree
Hide file tree
Showing 14 changed files with 15,557 additions and 0 deletions.
31 changes: 31 additions & 0 deletions apps/admin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"extends": [
"plugin:@nx/react-typescript",
"next",
"next/core-web-vitals",
"../../.eslintrc.json"
],
"ignorePatterns": ["!**/*", ".next/**/*"],
"overrides": [
{
"files": ["*.*"],
"rules": {
"@next/next/no-html-link-for-pages": "off"
}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@next/next/no-html-link-for-pages": ["error", "apps/admin/pages"]
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
6 changes: 6 additions & 0 deletions apps/admin/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
declare module '*.svg' {
const content: any;
export const ReactComponent: any;
export default content;
}
30 changes: 30 additions & 0 deletions apps/admin/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { composePlugins, withNx } = require('@nx/next');

/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},

compiler: {
// For other options, see https://styled-components.com/docs/tooling#babel-plugin
styledComponents: true,
},
experimental: {
typedRoutes: true,
},
};

const plugins = [
// Add more Next.js plugins to this list if needed.
withNx,
];

module.exports = composePlugins(...plugins)(nextConfig);
15 changes: 15 additions & 0 deletions apps/admin/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { join } = require('path');

// Note: If you use library-specific PostCSS/Tailwind configuration then you should remove the `postcssConfig` build
// option from your application's configuration (i.e. project.json).
//
// See: https://nx.dev/guides/using-tailwind-css-in-react#step-4:-applying-configuration-to-libraries

module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, 'tailwind.config.js'),
},
autoprefixer: {},
},
};
54 changes: 54 additions & 0 deletions apps/admin/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "admin",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/admin",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/admin"
},
"configurations": {
"development": {
"outputPath": "apps/admin"
},
"production": {}
}
},
"serve": {
"executor": "@nx/next:server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "admin:build",
"dev": true
},
"configurations": {
"development": {
"buildTarget": "admin:build:development",
"dev": true
},
"production": {
"buildTarget": "admin:build:production",
"dev": false
}
}
},
"export": {
"executor": "@nx/next:export",
"options": {
"buildTarget": "admin:build:production"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/admin/**/*.{ts,tsx,js,jsx}"]
}
}
},
"tags": []
}
Empty file added apps/admin/public/.gitkeep
Empty file.
Binary file added apps/admin/public/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions apps/admin/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import '../styles/global.css';
import { StyledComponentsRegistry } from './registry';

export const metadata = {
title: 'Welcome to demo2',
description: 'Generated by create-nx-workspace',
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
<StyledComponentsRegistry>{children}</StyledComponentsRegistry>
</body>
</html>
);
}
Loading

0 comments on commit 524d87a

Please sign in to comment.