Recreated apps to fix paths
This commit is contained in:
parent
1f85bbcf7d
commit
5799882c62
46 changed files with 1120 additions and 2126 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -44,5 +44,4 @@ Thumbs.db
|
|||
.github/instructions/nx.instructions.md
|
||||
|
||||
vite.config.*.timestamp*
|
||||
vitest.config.*.timestamp*
|
||||
test-output
|
||||
vitest.config.*.timestamp*
|
||||
|
|
@ -19,7 +19,7 @@ CI:
|
|||
|
||||
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
||||
# - npx nx-cloud record -- echo Hello World
|
||||
- npx nx run-many -t lint test build typecheck
|
||||
- npx nx run-many -t lint test build
|
||||
# Nx Cloud recommends fixes for failures to help you get CI green faster. Learn more: https://nx.dev/ci/features/self-healing-ci
|
||||
|
||||
after_script:
|
||||
|
|
|
|||
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
|
|
@ -2,7 +2,6 @@
|
|||
"recommendations": [
|
||||
"nrwl.angular-console",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"firsttris.vscode-jest-runner"
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
|
|
@ -4,9 +4,9 @@
|
|||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Debug @web/api with Nx",
|
||||
"name": "Debug api with Nx",
|
||||
"runtimeExecutable": "npx",
|
||||
"runtimeArgs": ["nx", "serve", "@web/api"],
|
||||
"runtimeArgs": ["nx", "serve", "api"],
|
||||
"env": {
|
||||
"NODE_OPTIONS": "--inspect=9229"
|
||||
},
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
"skipFiles": ["<node_internals>/**"],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/api/dist/**/*.(m|c|)js",
|
||||
"${workspaceFolder}/apps/api/dist/**/*.(m|c|)js",
|
||||
"!**/node_modules/**"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"jsc": {
|
||||
"target": "es2017",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"decorators": true,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"transform": {
|
||||
"decoratorMetadata": true,
|
||||
"legacyDecorator": true
|
||||
},
|
||||
"keepClassNames": true,
|
||||
"externalHelpers": true,
|
||||
"loose": true
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
},
|
||||
"sourceMaps": true,
|
||||
"exclude": []
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import baseConfig from '../eslint.config.mjs';
|
||||
|
||||
export default [...baseConfig];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
/* eslint-disable */
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
// Reading the SWC compilation config for the spec files
|
||||
const swcJestConfig = JSON.parse(
|
||||
readFileSync(`${__dirname}/.spec.swcrc`, 'utf-8')
|
||||
);
|
||||
|
||||
// Disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves
|
||||
swcJestConfig.swcrc = false;
|
||||
|
||||
export default {
|
||||
displayName: '@web/api-e2e',
|
||||
preset: '../jest.preset.js',
|
||||
globalSetup: '<rootDir>/src/support/global-setup.ts',
|
||||
globalTeardown: '<rootDir>/src/support/global-teardown.ts',
|
||||
setupFiles: ['<rootDir>/src/support/test-setup.ts'],
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': ['@swc/jest', swcJestConfig],
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageDirectory: 'test-output/jest/coverage',
|
||||
};
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"name": "@web/api-e2e",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"nx": {
|
||||
"implicitDependencies": [
|
||||
"@web/api"
|
||||
],
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": [
|
||||
"{projectRoot}/test-output/jest/coverage"
|
||||
],
|
||||
"options": {
|
||||
"jestConfig": "api-e2e/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"dependsOn": [
|
||||
"@web/api:build",
|
||||
"@web/api:serve"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import axios from 'axios';
|
||||
|
||||
describe('GET /api', () => {
|
||||
it('should return a message', async () => {
|
||||
const res = await axios.get(`/api`);
|
||||
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.data).toEqual({ message: 'Hello API' });
|
||||
});
|
||||
});
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { waitForPortOpen } from '@nx/node/utils';
|
||||
|
||||
/* eslint-disable */
|
||||
var __TEARDOWN_MESSAGE__: string;
|
||||
|
||||
module.exports = async function () {
|
||||
// Start services that that the app needs to run (e.g. database, docker-compose, etc.).
|
||||
console.log('\nSetting up...\n');
|
||||
|
||||
const host = process.env.HOST ?? 'localhost';
|
||||
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
|
||||
await waitForPortOpen(port, { host });
|
||||
|
||||
// Hint: Use `globalThis` to pass variables to global teardown.
|
||||
globalThis.__TEARDOWN_MESSAGE__ = '\nTearing down...\n';
|
||||
};
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { killPort } from '@nx/node/utils';
|
||||
/* eslint-disable */
|
||||
|
||||
module.exports = async function () {
|
||||
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
|
||||
// Hint: `globalThis` is shared between setup and teardown.
|
||||
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
|
||||
await killPort(port);
|
||||
console.log(globalThis.__TEARDOWN_MESSAGE__);
|
||||
};
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
/* eslint-disable */
|
||||
import axios from 'axios';
|
||||
|
||||
module.exports = async function () {
|
||||
// Configure axios for tests to use.
|
||||
const host = process.env.HOST ?? 'localhost';
|
||||
const port = process.env.PORT ?? '3000';
|
||||
axios.defaults.baseURL = `http://${host}:${port}`;
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out-tsc/@web/api-e2e",
|
||||
"esModuleInterop": true,
|
||||
"noUnusedLocals": false,
|
||||
"noImplicitAny": false
|
||||
},
|
||||
"include": ["jest.config.ts", "src/**/*.ts"],
|
||||
"references": []
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"jsc": {
|
||||
"target": "es2017",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"decorators": true,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"transform": {
|
||||
"decoratorMetadata": true,
|
||||
"legacyDecorator": true
|
||||
},
|
||||
"keepClassNames": true,
|
||||
"externalHelpers": true,
|
||||
"loose": true
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
},
|
||||
"sourceMaps": true,
|
||||
"exclude": []
|
||||
}
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
import baseConfig from '../eslint.config.mjs';
|
||||
import baseConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [...baseConfig];
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
/* eslint-disable */
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
// Reading the SWC compilation config for the spec files
|
||||
const swcJestConfig = JSON.parse(
|
||||
readFileSync(`${__dirname}/.spec.swcrc`, 'utf-8')
|
||||
);
|
||||
|
||||
// Disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves
|
||||
swcJestConfig.swcrc = false;
|
||||
|
||||
export default {
|
||||
displayName: '@web/api',
|
||||
preset: '../jest.preset.js',
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': ['@swc/jest', swcJestConfig],
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageDirectory: 'test-output/jest/coverage',
|
||||
};
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
{
|
||||
"name": "@web/api",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"nx": {
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"command": "webpack-cli build",
|
||||
"args": [
|
||||
"--node-env=production"
|
||||
],
|
||||
"cwd": "api"
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
"args": [
|
||||
"--node-env=development"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"prune-lockfile": {
|
||||
"dependsOn": [
|
||||
"build"
|
||||
],
|
||||
"cache": true,
|
||||
"executor": "@nx/js:prune-lockfile",
|
||||
"outputs": [
|
||||
"{workspaceRoot}/api/dist/package.json",
|
||||
"{workspaceRoot}/api/dist/package-lock.json"
|
||||
],
|
||||
"options": {
|
||||
"buildTarget": "build"
|
||||
}
|
||||
},
|
||||
"copy-workspace-modules": {
|
||||
"dependsOn": [
|
||||
"build"
|
||||
],
|
||||
"cache": true,
|
||||
"outputs": [
|
||||
"{workspaceRoot}/api/dist/workspace_modules"
|
||||
],
|
||||
"executor": "@nx/js:copy-workspace-modules",
|
||||
"options": {
|
||||
"buildTarget": "build"
|
||||
}
|
||||
},
|
||||
"prune": {
|
||||
"dependsOn": [
|
||||
"prune-lockfile",
|
||||
"copy-workspace-modules"
|
||||
],
|
||||
"executor": "nx:noop"
|
||||
},
|
||||
"serve": {
|
||||
"continuous": true,
|
||||
"executor": "@nx/js:node",
|
||||
"defaultConfiguration": "development",
|
||||
"dependsOn": [
|
||||
"build"
|
||||
],
|
||||
"options": {
|
||||
"buildTarget": "@web/api:build",
|
||||
"runBuildTargetDependencies": false
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
"buildTarget": "@web/api:build:development"
|
||||
},
|
||||
"production": {
|
||||
"buildTarget": "@web/api:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"options": {
|
||||
"passWithNoTests": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.0",
|
||||
"@nestjs/core": "^11.0.0",
|
||||
"@nestjs/platform-express": "^11.0.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.8.0",
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/testing": "^11.0.0"
|
||||
}
|
||||
}
|
||||
65
apps/api/project.json
Normal file
65
apps/api/project.json
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
"name": "api",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/api/src",
|
||||
"projectType": "application",
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"command": "webpack-cli build",
|
||||
"args": ["--node-env=production"],
|
||||
"cwd": "apps/api"
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
"args": ["--node-env=development"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"prune-lockfile": {
|
||||
"dependsOn": ["build"],
|
||||
"cache": true,
|
||||
"executor": "@nx/js:prune-lockfile",
|
||||
"outputs": [
|
||||
"{workspaceRoot}/dist/apps/api/package.json",
|
||||
"{workspaceRoot}/dist/apps/api/package-lock.json"
|
||||
],
|
||||
"options": {
|
||||
"buildTarget": "build"
|
||||
}
|
||||
},
|
||||
"copy-workspace-modules": {
|
||||
"dependsOn": ["build"],
|
||||
"cache": true,
|
||||
"outputs": ["{workspaceRoot}/dist/apps/api/workspace_modules"],
|
||||
"executor": "@nx/js:copy-workspace-modules",
|
||||
"options": {
|
||||
"buildTarget": "build"
|
||||
}
|
||||
},
|
||||
"prune": {
|
||||
"dependsOn": ["prune-lockfile", "copy-workspace-modules"],
|
||||
"executor": "nx:noop"
|
||||
},
|
||||
"serve": {
|
||||
"continuous": true,
|
||||
"executor": "@nx/js:node",
|
||||
"defaultConfiguration": "development",
|
||||
"dependsOn": ["build"],
|
||||
"options": {
|
||||
"buildTarget": "api:build",
|
||||
"runBuildTargetDependencies": false
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
"buildTarget": "api:build:development"
|
||||
},
|
||||
"production": {
|
||||
"buildTarget": "api:build:production"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
describe('AppController', () => {
|
||||
let app: TestingModule;
|
||||
|
||||
beforeAll(async () => {
|
||||
app = await Test.createTestingModule({
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
}).compile();
|
||||
});
|
||||
|
||||
describe('getData', () => {
|
||||
it('should return "Hello API"', () => {
|
||||
const appController = app.get<AppController>(AppController);
|
||||
expect(appController.getData()).toEqual({ message: 'Hello API' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import { Test } from '@nestjs/testing';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
describe('AppService', () => {
|
||||
let service: AppService;
|
||||
|
||||
beforeAll(async () => {
|
||||
const app = await Test.createTestingModule({
|
||||
providers: [AppService],
|
||||
}).compile();
|
||||
|
||||
service = app.get<AppService>(AppService);
|
||||
});
|
||||
|
||||
describe('getData', () => {
|
||||
it('should return "Hello API"', () => {
|
||||
expect(service.getData()).toEqual({ message: 'Hello API' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -1,25 +1,12 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"module": "nodenext",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["node"],
|
||||
"rootDir": "src",
|
||||
"moduleResolution": "nodenext",
|
||||
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"target": "es2021"
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": [
|
||||
"out-tsc",
|
||||
"dist",
|
||||
"jest.config.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.ts",
|
||||
"eslint.config.js",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.mjs"
|
||||
]
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
],
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/jest",
|
||||
"types": ["jest", "node"],
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true
|
||||
},
|
||||
"include": [
|
||||
"jest.config.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ const { join } = require('path');
|
|||
|
||||
module.exports = {
|
||||
output: {
|
||||
path: join(__dirname, 'dist'),
|
||||
path: join(__dirname, '../../dist/apps/api'),
|
||||
clean: true,
|
||||
...(process.env.NODE_ENV !== 'production' && {
|
||||
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@web/web</title>
|
||||
<title>web</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"name": "@web/web",
|
||||
"version": "0.0.1",
|
||||
"private": true
|
||||
}
|
||||
8
apps/web/project.json
Normal file
8
apps/web/project.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "web",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"sourceRoot": "apps/web/src",
|
||||
"// targets": "to see all targets run: nx show project web --web",
|
||||
"targets": {}
|
||||
}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import router from '../router';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import App from './App.vue';
|
||||
|
||||
describe('App', () => {
|
||||
it('renders properly', async () => {
|
||||
const wrapper = mount(App, {});
|
||||
expect(wrapper.text()).toContain('Welcome @web/web 👋');
|
||||
const wrapper = mount(App, { global: { plugins: [router] } });
|
||||
await router.isReady();
|
||||
expect(wrapper.text()).toContain('Welcome web 👋');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,44 @@
|
|||
<script setup lang="ts">
|
||||
import NxWelcome from './NxWelcome.vue';
|
||||
import { RouterLink, RouterView } from 'vue-router';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NxWelcome title="@web/web" />
|
||||
<header>
|
||||
<nav>
|
||||
<RouterLink to="/">Home</RouterLink>
|
||||
<RouterLink to="/about">About</RouterLink>
|
||||
</nav>
|
||||
</header>
|
||||
<RouterView />
|
||||
</template>
|
||||
|
||||
<style scoped lang="css">
|
||||
header {
|
||||
line-height: 1.5;
|
||||
max-width: 100vw;
|
||||
}
|
||||
|
||||
nav > a {
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
header {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
padding-right: calc(var(--section-gap) / 2);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 768px;
|
||||
}
|
||||
|
||||
nav {
|
||||
text-align: left;
|
||||
font-size: 1rem;
|
||||
|
||||
padding: 1rem 0;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -319,11 +319,7 @@ defineProps<{
|
|||
</h2>
|
||||
</div>
|
||||
<p>Your Nx Cloud remote cache setup is almost complete.</p>
|
||||
<a
|
||||
href="https://cloud.nx.app/connect/fzBSRksVC9"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
<a href="" target="_blank" rel="noreferrer">
|
||||
Click here to finish
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import './styles.css';
|
||||
import router from './router';
|
||||
import { createApp } from 'vue';
|
||||
import App from './app/App.vue';
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(router);
|
||||
app.mount('#root');
|
||||
|
|
|
|||
23
apps/web/src/router/index.ts
Normal file
23
apps/web/src/router/index.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import HomeView from '../views/HomeView.vue';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView,
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (About.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import('../views/AboutView.vue'),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export default router;
|
||||
16
apps/web/src/views/AboutView.vue
Normal file
16
apps/web/src/views/AboutView.vue
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
@media (min-width: 768px) {
|
||||
.about {
|
||||
max-width: 768px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
9
apps/web/src/views/HomeView.vue
Normal file
9
apps/web/src/views/HomeView.vue
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import NxWelcome from '../app/NxWelcome.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<NxWelcome title="web" />
|
||||
</main>
|
||||
</template>
|
||||
|
|
@ -1,34 +1,14 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"types": ["vite/client"],
|
||||
"rootDir": "src",
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "vue",
|
||||
"resolveJsonModule": true,
|
||||
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo"
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"types": ["vite/client"]
|
||||
},
|
||||
"exclude": [
|
||||
"out-tsc",
|
||||
"dist",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.vue",
|
||||
"src/**/*.test.vue",
|
||||
"vite.config.ts",
|
||||
"vite.config.mts",
|
||||
"vitest.config.ts",
|
||||
"vitest.config.mts",
|
||||
"src/**/*.test.tsx",
|
||||
"src/**/*.spec.tsx",
|
||||
"src/**/*.test.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.test.jsx",
|
||||
"src/**/*.spec.jsx",
|
||||
"eslint.config.js",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.mjs"
|
||||
"src/**/*.test.vue"
|
||||
],
|
||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.vue"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,20 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "vue",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
],
|
||||
"extends": "../../tsconfig.base.json"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/vitest",
|
||||
"types": [
|
||||
"vitest/globals",
|
||||
"vitest/importMeta",
|
||||
"vite/client",
|
||||
"node",
|
||||
"vitest"
|
||||
],
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "vue",
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": [
|
||||
"vite.config.ts",
|
||||
"vite.config.mts",
|
||||
"vitest.config.ts",
|
||||
"vitest.config.mts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"src/**/*.spec.tsx",
|
||||
"src/**/*.test.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.test.jsx",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
/// <reference types='vitest' />
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
||||
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
||||
|
||||
export default defineConfig(() => ({
|
||||
root: __dirname,
|
||||
cacheDir: '../../node_modules/.vite/apps/web',
|
||||
cacheDir: '../../../node_modules/.vite/apps/web',
|
||||
server: {
|
||||
port: 4200,
|
||||
host: 'localhost',
|
||||
|
|
@ -13,29 +15,17 @@ export default defineConfig(() => ({
|
|||
port: 4300,
|
||||
host: 'localhost',
|
||||
},
|
||||
plugins: [vue()],
|
||||
plugins: [vue(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])],
|
||||
// Uncomment this if you are using workers.
|
||||
// worker: {
|
||||
// plugins: [],
|
||||
// plugins: [ nxViteTsPaths() ],
|
||||
// },
|
||||
build: {
|
||||
outDir: './dist',
|
||||
outDir: '../../dist/apps/web',
|
||||
emptyOutDir: true,
|
||||
reportCompressedSize: true,
|
||||
commonjsOptions: {
|
||||
transformMixedEsModules: true,
|
||||
},
|
||||
},
|
||||
test: {
|
||||
name: '@web/web',
|
||||
watch: false,
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
reporters: ['default'],
|
||||
coverage: {
|
||||
reportsDirectory: './test-output/vitest/coverage',
|
||||
provider: 'v8' as const,
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
import type { Config } from 'jest';
|
||||
import { getJestProjectsAsync } from '@nx/jest';
|
||||
|
||||
export default async (): Promise<Config> => ({
|
||||
projects: await getJestProjectsAsync(),
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
const nxPreset = require('@nx/jest/preset').default;
|
||||
|
||||
module.exports = { ...nxPreset };
|
||||
48
nx.json
48
nx.json
|
|
@ -9,26 +9,21 @@
|
|||
"!{projectRoot}/eslint.config.mjs",
|
||||
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
|
||||
"!{projectRoot}/tsconfig.spec.json",
|
||||
"!{projectRoot}/src/test-setup.[jt]s",
|
||||
"!{projectRoot}/jest.config.[jt]s",
|
||||
"!{projectRoot}/test-setup.[jt]s"
|
||||
"!{projectRoot}/src/test-setup.[jt]s"
|
||||
],
|
||||
"sharedGlobals": ["{workspaceRoot}/.gitlab-ci.yml"]
|
||||
},
|
||||
"nxCloudId": "690fceb3d1401c12d249669a",
|
||||
"nxCloudId": "6911edcf6b32f954e0e9455d",
|
||||
"plugins": [
|
||||
{
|
||||
"plugin": "@nx/js/typescript",
|
||||
"plugin": "@nx/webpack/plugin",
|
||||
"options": {
|
||||
"typecheck": {
|
||||
"targetName": "typecheck"
|
||||
},
|
||||
"build": {
|
||||
"targetName": "build",
|
||||
"configName": "tsconfig.lib.json",
|
||||
"buildDepsName": "build-deps",
|
||||
"watchDepsName": "watch-deps"
|
||||
}
|
||||
"buildTargetName": "build",
|
||||
"serveTargetName": "serve",
|
||||
"previewTargetName": "preview",
|
||||
"buildDepsTargetName": "build-deps",
|
||||
"watchDepsTargetName": "watch-deps",
|
||||
"serveStaticTargetName": "serve-static"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -50,29 +45,6 @@
|
|||
"buildDepsTargetName": "build-deps",
|
||||
"watchDepsTargetName": "watch-deps"
|
||||
}
|
||||
},
|
||||
{
|
||||
"plugin": "@nx/webpack/plugin",
|
||||
"options": {
|
||||
"buildTargetName": "build",
|
||||
"serveTargetName": "serve",
|
||||
"previewTargetName": "preview",
|
||||
"buildDepsTargetName": "build-deps",
|
||||
"watchDepsTargetName": "watch-deps",
|
||||
"serveStaticTargetName": "serve-static"
|
||||
}
|
||||
},
|
||||
{
|
||||
"plugin": "@nx/jest/plugin",
|
||||
"options": {
|
||||
"targetName": "test"
|
||||
},
|
||||
"exclude": ["api-e2e/**/*"]
|
||||
}
|
||||
],
|
||||
"targetDefaults": {
|
||||
"test": {
|
||||
"dependsOn": ["^build"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
2443
package-lock.json
generated
2443
package-lock.json
generated
File diff suppressed because it is too large
Load diff
30
package.json
30
package.json
|
|
@ -1,8 +1,13 @@
|
|||
{
|
||||
"name": "@web/source",
|
||||
"name": "@api/source",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"start:api": "nx serve apps/api",
|
||||
"start:web": "nx serve apps/web",
|
||||
"build:api": "nx build apps/api",
|
||||
"build:web": "nx build apps/web"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.0",
|
||||
|
|
@ -11,7 +16,8 @@
|
|||
"axios": "^1.6.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.8.0",
|
||||
"vue": "^3.5.13"
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.8.0",
|
||||
|
|
@ -19,9 +25,8 @@
|
|||
"@nestjs/testing": "^11.0.0",
|
||||
"@nx/eslint": "22.0.2",
|
||||
"@nx/eslint-plugin": "22.0.2",
|
||||
"@nx/jest": "22.0.2",
|
||||
"@nx/js": "22.0.2",
|
||||
"@nx/nest": "^22.0.2",
|
||||
"@nx/nest": "22.0.2",
|
||||
"@nx/node": "22.0.2",
|
||||
"@nx/vite": "22.0.2",
|
||||
"@nx/vue": "22.0.2",
|
||||
|
|
@ -31,12 +36,9 @@
|
|||
"@swc-node/register": "~1.9.1",
|
||||
"@swc/core": "~1.5.7",
|
||||
"@swc/helpers": "~0.5.11",
|
||||
"@swc/jest": "~0.2.38",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "20.19.9",
|
||||
"@typescript-eslint/parser": "^8.40.0",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@vitest/coverage-v8": "^3.0.5",
|
||||
"@vitest/ui": "^3.0.0",
|
||||
"@vue/eslint-config-prettier": "7.1.0",
|
||||
"@vue/eslint-config-typescript": "^14.6.0",
|
||||
|
|
@ -44,15 +46,10 @@
|
|||
"eslint": "^9.8.0",
|
||||
"eslint-config-prettier": "^10.0.0",
|
||||
"eslint-plugin-vue": "^9.16.1",
|
||||
"jest": "^30.0.2",
|
||||
"jest-environment-node": "^30.0.2",
|
||||
"jest-util": "^30.0.2",
|
||||
"jiti": "2.4.2",
|
||||
"jsdom": "~22.1.0",
|
||||
"nx": "22.0.2",
|
||||
"prettier": "^2.6.2",
|
||||
"ts-jest": "^29.4.0",
|
||||
"ts-node": "10.9.1",
|
||||
"tslib": "^2.3.0",
|
||||
"typescript": "~5.9.2",
|
||||
"typescript-eslint": "^8.40.0",
|
||||
|
|
@ -60,10 +57,5 @@
|
|||
"vitest": "^3.0.0",
|
||||
"vue-tsc": "^2.2.8",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"api",
|
||||
"api-e2e"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"importHelpers": true,
|
||||
"isolatedModules": true,
|
||||
"lib": ["es2022"],
|
||||
"target": "es2015",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"noEmitOnError": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"lib": ["es2020", "dom"],
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"target": "es2022",
|
||||
"customConditions": ["@web/source"]
|
||||
}
|
||||
"skipDefaultLibCheck": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {}
|
||||
},
|
||||
"exclude": ["node_modules", "tmp"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compileOnSave": false,
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./apps/web"
|
||||
},
|
||||
{
|
||||
"path": "./apps/api-e2e"
|
||||
},
|
||||
{
|
||||
"path": "./apps/api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export default [
|
||||
'**/vite.config.{mjs,js,ts,mts}',
|
||||
'**/vitest.config.{mjs,js,ts,mts}',
|
||||
];
|
||||
Loading…
Reference in a new issue