speckit: внедрение Spec Kit и фиксация архитектуры в конституции JT4D v1.0.0
- Интеграция Spec Kit для pi: команды `/speckit.*`, bash-скрипты и шаблоны в `.specify` - Конституция JT4D v1.0.0 вместо шаблона: принципы WELD для слоёв web и api, публичный API директории - Слои web описаны по методологии WELD и проверяются `eslint-plugin-weld` - Vitest в api запускает `*.test.ts` рядом с `*.spec.ts`, тесты исключены из сборки приложения - `yarn.lock` пересобран через `yarn deduplicate` Нужно зафиксировать архитектуру проекта в конституции JT4D v1.0.0 и подключить Spec Kit, чтобы планировать фичи до написания кода. - `eslint-plugin-weld` настроен только в `apps/web`: схема слоёв API описана конституцией и документацией, но линтером пока не проверяется Reviewed-on: jt4d/jt4d#4 Co-authored-by: Arswarog <arswarog@yandex.ru>
This commit is contained in:
1 parent
1d80630fb2
commit
7d5156d92e
55 files changed
+6070
-415
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
import baseConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [...baseConfig];
|
||||
export default defineConfig(baseConfig);
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@geo-platform/api-e2e",
|
||||
"name": "@jt4d-platform/api-e2e",
|
||||
"version": "0.0.1",
|
||||
"private": true
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out-tsc/@geo-platform/api-e2e",
|
||||
"outDir": "out-tsc/@jt4d-platform/api-e2e",
|
||||
"esModuleInterop": true,
|
||||
"noUnusedLocals": false,
|
||||
"noImplicitAny": false
|
||||
|
||||
@@ -16,7 +16,7 @@ const nodeExternals = require('webpack-node-externals');
|
||||
*/
|
||||
module.exports.DenyExternalsPlugin = class DenyExternalsPlugin {
|
||||
constructor(skipExternalPackages) {
|
||||
// Массив строк-префиксов, например ['@geo-platform/']
|
||||
// Массив строк-префиксов, например ['@jt4d-platform/']
|
||||
this.skipExternalPackages = skipExternalPackages;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
import baseConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [...baseConfig];
|
||||
export default defineConfig(baseConfig);
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@geo-platform/api",
|
||||
"name": "@jt4d-platform/api",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"eslint.config.js",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.mjs",
|
||||
"src/**/*.spec.ts"
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.ts"
|
||||
]
|
||||
}
|
||||
@@ -18,14 +18,14 @@ export default defineConfig({
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@geo-platform/api': resolve(import.meta.dirname, 'src'),
|
||||
'@jt4d-platform/api': resolve(import.meta.dirname, 'src'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
name: '@geo-platform/api',
|
||||
name: '@jt4d-platform/api',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['src/**/*.spec.ts'],
|
||||
include: ['src/**/*.{test,spec}.ts'],
|
||||
setupFiles: ['src/test-setup.ts'],
|
||||
coverage: {
|
||||
reportsDirectory: './test-output/vitest/coverage',
|
||||
|
||||
@@ -25,7 +25,7 @@ function createApiWebpackConfig({ output, nxPlugin, plugins = [] }) {
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@geo-platform/api': join(__dirname, 'src'),
|
||||
'@jt4d-platform/api': join(__dirname, 'src'),
|
||||
},
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
||||
},
|
||||
@@ -42,7 +42,7 @@ function createApiWebpackConfig({ output, nxPlugin, plugins = [] }) {
|
||||
// Обязательно в паре с externalDependencies: 'none'. Без плагина webpack
|
||||
// вкомпилирует второй экземпляр typeorm, и он перестанет быть тем же
|
||||
// модулем, что грузит CLI.
|
||||
new DenyExternalsPlugin(['@geo-platform/']),
|
||||
new DenyExternalsPlugin(['@jt4d-platform/']),
|
||||
...plugins,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
import nx from '@nx/eslint-plugin';
|
||||
import weld from 'eslint-plugin-weld';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
import baseConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [...nx.configs['flat/react'], ...baseConfig];
|
||||
export default defineConfig([
|
||||
...nx.configs['flat/react'],
|
||||
...baseConfig,
|
||||
{
|
||||
name: 'weld',
|
||||
extends: [weld.configs.recommended],
|
||||
settings: {
|
||||
weld: {
|
||||
layers: ['app', 'pages', '@modules', 'common'],
|
||||
moduleLayers: ['widgets', 'entities'],
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@geo-platform/web",
|
||||
"name": "@jt4d-platform/web",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -19,6 +19,6 @@ describe('App', () => {
|
||||
<App />
|
||||
</BrowserRouter>,
|
||||
);
|
||||
expect(getAllByText(/Hello @geo-platform\/web/i).length > 0).toBeTruthy();
|
||||
expect(getAllByText(/Hello @jt4d-platform\/web/i).length > 0).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -5,7 +5,7 @@ import { HealthPage } from '../pages/HealthPage';
|
||||
export function App() {
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold">Hello @geo-platform/web</h1>
|
||||
<h1 className="text-2xl font-bold">Hello @jt4d-platform/web</h1>
|
||||
|
||||
<nav role="navigation">
|
||||
<ul>
|
||||
|
||||
@@ -34,7 +34,7 @@ export default defineConfig(() => ({
|
||||
},
|
||||
},
|
||||
test: {
|
||||
name: '@geo-platform/web',
|
||||
name: '@jt4d-platform/web',
|
||||
watch: false,
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
|
||||
Reference in new issue
Block a user