Phase 1+2: Nx workspace with apps, libs, and module boundaries

This commit is contained in:
Maurycy
2026-05-06 21:15:49 +01:00
commit b196624929
93 changed files with 19667 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# api-interfaces
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build api-interfaces` to build the library.
## Running unit tests
Run `nx test api-interfaces` to execute the unit tests via [Vitest](https://vitest.dev/).

View File

@@ -0,0 +1,22 @@
import baseConfig from '../../eslint.config.mjs';
export default [
...baseConfig,
{
files: ['**/*.json'],
rules: {
'@nx/dependency-checks': [
'error',
{
ignoredFiles: [
'{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}',
'{projectRoot}/vite.config.{js,ts,mjs,mts}',
],
},
],
},
languageOptions: {
parser: await import('jsonc-eslint-parser'),
},
},
];

View File

@@ -0,0 +1,13 @@
{
"name": "@fog-explorer/api-interfaces",
"version": "0.0.1",
"private": true,
"type": "commonjs",
"main": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"tslib": "^2.3.0",
"vitest": "^4.0.8",
"@nx/vite": "^22.7.1"
}
}

View File

@@ -0,0 +1,19 @@
{
"name": "api-interfaces",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/api-interfaces/src",
"projectType": "library",
"tags": ["scope:shared", "type:lib"],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/api-interfaces",
"main": "libs/api-interfaces/src/index.ts",
"tsConfig": "libs/api-interfaces/tsconfig.lib.json",
"assets": ["libs/api-interfaces/*.md"]
}
}
}
}

View File

@@ -0,0 +1 @@
export * from './lib/api-interfaces';

View File

@@ -0,0 +1,7 @@
import { apiInterfaces } from './api-interfaces';
describe('apiInterfaces', () => {
it('should work', () => {
expect(apiInterfaces()).toEqual('api-interfaces');
});
});

View File

@@ -0,0 +1,3 @@
export function apiInterfaces(): string {
return 'api-interfaces';
}

View File

@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"importHelpers": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@@ -0,0 +1,23 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": [
"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"
]
}

View File

@@ -0,0 +1,28 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"vitest"
]
},
"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"
]
}

View File

@@ -0,0 +1,21 @@
import { defineConfig } from 'vitest/config';
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/libs/api-interfaces',
plugins: [nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])],
test: {
name: 'api-interfaces',
watch: false,
globals: true,
environment: 'node',
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/libs/api-interfaces',
provider: 'v8' as const,
},
},
}));