Skip to content

Commit

Permalink
refactor(landingpage): integrate nx executors for next.js (#1339)
Browse files Browse the repository at this point in the history
Closes landingpage package in #1290

---------

Co-authored-by: Jan-Niklas Voß <[email protected]>
  • Loading branch information
TobiasHeimGalindo and janivo authored Apr 4, 2024
1 parent 1f4fd7a commit 950c508
Show file tree
Hide file tree
Showing 6 changed files with 1,249 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ tmp/
.angular
.nx-cache

.nx/cache
.nx/cache
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@nx/eslint": "18.0.7",
"@nx/eslint-plugin": "18.0.7",
"@nx/js": "18.0.7",
"@nx/next": "18.0.7",
"@nx/playwright": "18.0.7",
"@nx/storybook": "18.0.7",
"@playwright/test": "^1.36.0",
Expand Down Expand Up @@ -78,6 +79,7 @@
"prettier": "^2.6.2",
"prompts": "^2.4.0",
"semver": "^7.5.4",
"serve": "^14.2.1",
"shelljs": "^0.8.4",
"shx": "^0.3.2",
"svgo": "^2.8.0",
Expand All @@ -94,6 +96,9 @@
"@angular/platform-browser": "~15.1.0",
"@angular/platform-browser-dynamic": "~15.1.0",
"@angular/router": "~15.1.0",
"next": "14.0.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
Expand Down
5 changes: 0 additions & 5 deletions packages/landingpage/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { remarkCodeHike } from '@code-hike/mdx';
import nextMdx from '@next/mdx';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { readFile } from 'fs/promises';
import withImages from 'next-images';
import withHtml from 'next-html';
import path, { join } from 'path';
import remarkGfm from 'remark-gfm';

const theme = JSON.parse(
await readFile('../../node_modules/shiki/themes/github-light.json'),
);

const __dirname = path.resolve();
const assetsPath = join(__dirname, '..', '..', 'assets', 'logo');
const publicPath = join(__dirname, 'public');
Expand Down
3 changes: 0 additions & 3 deletions packages/landingpage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
"date-fns": "^2.29.3",
"lodash-es": "^4.17.21",
"negotiator": "^0.6.3",
"next": "14.1.0",
"next-mdx-remote": "^4.2.0",
"react": "^18.2.0",
"react-chartjs-2": "^5.0.1",
"react-dom": "18.2.0",
"react-use": "^17.4.0",
"rehype-highlight": "^6.0.0",
"remark-gfm": "^3.0.1",
Expand Down
39 changes: 22 additions & 17 deletions packages/landingpage/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,33 @@
"tags": [],
"targets": {
"build": {
"outputs": ["{projectRoot}/out"],
"executor": "nx:run-commands",
"executor": "@nx/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "prod",
"options": {
"cwd": "packages/landingpage",
"commands": ["next build"],
"parallel": false,
"color": true
}
},
"start": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/landingpage"
"outputPath": "{projectRoot}/out",
"nextConfig": "{projectRoot}/next.config.mjs"
},
"defaultConfiguration": "dev",
"configurations": {
"dev": {
"command": "next dev -p 4600"
"debug": true
},
"prod": {
"command": "next start -p 4600"
}
"prod": {}
}
},
"start": {
"executor": "@nx/next:server",
"defaultConfiguration": "dev",
"options": {
"buildTarget": "landingpage:build",
"dev": true
}
},
"preview": {
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "landingpage:build:prod",
"port": 4600
}
},
"lint": {
Expand Down
Loading

0 comments on commit 950c508

Please sign in to comment.