@bleedingdev/modern-js-create 3.2.0-ultramodern.7 → 3.2.0-ultramodern.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +202 -34
- package/package.json +3 -3
- package/template/.agents/skills-lock.json +34 -0
- package/template/AGENTS.md +20 -0
- package/template/api/effect/index.ts.handlebars +7 -39
- package/template/modern.config.ts.handlebars +13 -7
- package/template/oxfmt.config.ts +7 -0
- package/template/oxlint.config.ts +12 -0
- package/template/package.json.handlebars +21 -11
- package/template/scripts/bootstrap-agent-skills.mjs +103 -0
- package/template/scripts/validate-ultramodern.mjs.handlebars +84 -0
- package/template/tsconfig.json +106 -2
- package/template-workspace/.agents/skills-lock.json +39 -0
- package/template-workspace/AGENTS.md +18 -1
- package/template-workspace/oxfmt.config.ts +7 -0
- package/template-workspace/oxlint.config.ts +12 -0
- package/template-workspace/pnpm-workspace.yaml +0 -2
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +106 -0
- package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +60 -0
- package/template/biome.json +0 -41
package/dist/index.js
CHANGED
|
@@ -556,7 +556,11 @@ const ultramodern_workspace_dirname = node_path.dirname(fileURLToPath(import.met
|
|
|
556
556
|
const workspaceTemplateDir = node_path.resolve(ultramodern_workspace_dirname, '..', 'template-workspace');
|
|
557
557
|
const TANSTACK_ROUTER_VERSION = '1.170.1';
|
|
558
558
|
const MODULE_FEDERATION_VERSION = '2.4.0';
|
|
559
|
-
const
|
|
559
|
+
const EFFECT_TSGO_VERSION = '0.7.3';
|
|
560
|
+
const TYPESCRIPT_NATIVE_PREVIEW_VERSION = '7.0.0-dev.20260518.1';
|
|
561
|
+
const OXLINT_VERSION = '1.65.0';
|
|
562
|
+
const OXFMT_VERSION = '0.50.0';
|
|
563
|
+
const ULTRACITE_VERSION = '7.7.0';
|
|
560
564
|
const REACT_VERSION = '^19.2.6';
|
|
561
565
|
const REACT_DOM_VERSION = '^19.2.6';
|
|
562
566
|
const WORKSPACE_PACKAGE_VERSION = 'workspace:*';
|
|
@@ -570,6 +574,14 @@ const baselineAgentSkills = [
|
|
|
570
574
|
'rslib-modern-package',
|
|
571
575
|
'rstest-best-practices'
|
|
572
576
|
];
|
|
577
|
+
const privateAgentSkills = [
|
|
578
|
+
'plan-graph',
|
|
579
|
+
'dag',
|
|
580
|
+
'subagent-graph',
|
|
581
|
+
'helm',
|
|
582
|
+
'debugger-mode'
|
|
583
|
+
];
|
|
584
|
+
const effectTsgoTypecheckCommand = "node -e \"const fs = require('node:fs'); const { execFileSync, spawnSync } = require('node:child_process'); const bin = execFileSync('effect-tsgo', ['get-exe-path'], { encoding: 'utf8' }).trim(); if (process.platform !== 'win32') fs.chmodSync(bin, 0o755); const result = spawnSync(bin, ['--noEmit', '-p', 'tsconfig.json'], { stdio: 'inherit' }); process.exit(result.status ?? 1);\"";
|
|
573
585
|
const modernPackageNames = [
|
|
574
586
|
'@modern-js/app-tools',
|
|
575
587
|
'@modern-js/plugin-bff',
|
|
@@ -716,6 +728,81 @@ const effectService = {
|
|
|
716
728
|
}
|
|
717
729
|
}
|
|
718
730
|
};
|
|
731
|
+
const effectDiagnostics = [
|
|
732
|
+
'anyUnknownInErrorContext',
|
|
733
|
+
'classSelfMismatch',
|
|
734
|
+
'duplicatePackage',
|
|
735
|
+
'effectFnImplicitAny',
|
|
736
|
+
'floatingEffect',
|
|
737
|
+
'genericEffectServices',
|
|
738
|
+
'missingEffectContext',
|
|
739
|
+
'missingEffectError',
|
|
740
|
+
'missingLayerContext',
|
|
741
|
+
'missingReturnYieldStar',
|
|
742
|
+
'missingStarInYieldEffectGen',
|
|
743
|
+
'nonObjectEffectServiceType',
|
|
744
|
+
'outdatedApi',
|
|
745
|
+
'overriddenSchemaConstructor',
|
|
746
|
+
'catchUnfailableEffect',
|
|
747
|
+
'effectFnIife',
|
|
748
|
+
'effectGenUsesAdapter',
|
|
749
|
+
'effectInFailure',
|
|
750
|
+
'effectInVoidSuccess',
|
|
751
|
+
'globalErrorInEffectCatch',
|
|
752
|
+
'globalErrorInEffectFailure',
|
|
753
|
+
'layerMergeAllWithDependencies',
|
|
754
|
+
'lazyPromiseInEffectSync',
|
|
755
|
+
'leakingRequirements',
|
|
756
|
+
'multipleEffectProvide',
|
|
757
|
+
'returnEffectInGen',
|
|
758
|
+
'runEffectInsideEffect',
|
|
759
|
+
'schemaSyncInEffect',
|
|
760
|
+
'scopeInLayerEffect',
|
|
761
|
+
'strictEffectProvide',
|
|
762
|
+
'tryCatchInEffectGen',
|
|
763
|
+
'unknownInEffectCatch',
|
|
764
|
+
'asyncFunction',
|
|
765
|
+
'cryptoRandomUUID',
|
|
766
|
+
'cryptoRandomUUIDInEffect',
|
|
767
|
+
'extendsNativeError',
|
|
768
|
+
'globalConsole',
|
|
769
|
+
'globalConsoleInEffect',
|
|
770
|
+
'globalDate',
|
|
771
|
+
'globalDateInEffect',
|
|
772
|
+
'globalFetch',
|
|
773
|
+
'globalFetchInEffect',
|
|
774
|
+
'globalRandom',
|
|
775
|
+
'globalRandomInEffect',
|
|
776
|
+
'globalTimers',
|
|
777
|
+
'globalTimersInEffect',
|
|
778
|
+
'instanceOfSchema',
|
|
779
|
+
'newPromise',
|
|
780
|
+
'nodeBuiltinImport',
|
|
781
|
+
'preferSchemaOverJson',
|
|
782
|
+
'processEnv',
|
|
783
|
+
'processEnvInEffect',
|
|
784
|
+
'unsafeEffectTypeAssertion',
|
|
785
|
+
'catchAllToMapError',
|
|
786
|
+
'deterministicKeys',
|
|
787
|
+
'effectDoNotation',
|
|
788
|
+
'effectFnOpportunity',
|
|
789
|
+
'effectMapFlatten',
|
|
790
|
+
'effectMapVoid',
|
|
791
|
+
'effectSucceedWithVoid',
|
|
792
|
+
'missedPipeableOpportunity',
|
|
793
|
+
'missingEffectServiceDependency',
|
|
794
|
+
'nestedEffectGenYield',
|
|
795
|
+
'redundantSchemaTagIdentifier',
|
|
796
|
+
'schemaStructWithTag',
|
|
797
|
+
'schemaUnionOfLiterals',
|
|
798
|
+
'serviceNotAsClass',
|
|
799
|
+
'strictBooleanExpressions',
|
|
800
|
+
'unnecessaryArrowBlock',
|
|
801
|
+
'unnecessaryEffectGen',
|
|
802
|
+
'unnecessaryFailYieldableError',
|
|
803
|
+
'unnecessaryPipe',
|
|
804
|
+
'unnecessaryPipeChain'
|
|
805
|
+
];
|
|
719
806
|
const sharedPackages = [
|
|
720
807
|
{
|
|
721
808
|
id: 'shared-contracts',
|
|
@@ -844,10 +931,11 @@ function appDependencies(scope, packageSource) {
|
|
|
844
931
|
function appDevDependencies(packageSource) {
|
|
845
932
|
return {
|
|
846
933
|
'@modern-js/app-tools': modernPackageSpecifier('@modern-js/app-tools', packageSource),
|
|
934
|
+
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
935
|
+
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION,
|
|
847
936
|
'@types/node': '^20',
|
|
848
937
|
'@types/react': '^19.1.8',
|
|
849
|
-
'@types/react-dom': '^19.1.6'
|
|
850
|
-
typescript: TYPESCRIPT_VERSION
|
|
938
|
+
'@types/react-dom': '^19.1.6'
|
|
851
939
|
};
|
|
852
940
|
}
|
|
853
941
|
function createRootPackageJson(scope, packageSource) {
|
|
@@ -864,9 +952,15 @@ function createRootPackageJson(scope, packageSource) {
|
|
|
864
952
|
'dev:design-system': `pnpm --filter ${ultramodern_workspace_packageName(scope, 'remote-design-system')} dev`,
|
|
865
953
|
'dev:recommendations': `pnpm --filter ${ultramodern_workspace_packageName(scope, effectService.packageSuffix)} dev`,
|
|
866
954
|
build: 'pnpm -r --filter ./apps/** --filter ./services/** build',
|
|
955
|
+
format: 'oxfmt .',
|
|
956
|
+
'format:check': 'oxfmt --check .',
|
|
957
|
+
lint: 'oxlint .',
|
|
958
|
+
'lint:fix': 'oxlint . --fix',
|
|
867
959
|
typecheck: 'pnpm -r --filter ./apps/** --filter ./services/** --filter ./packages/** typecheck',
|
|
960
|
+
'skills:install': "node ./scripts/bootstrap-agent-skills.mjs",
|
|
961
|
+
'skills:check': "node ./scripts/bootstrap-agent-skills.mjs --check",
|
|
868
962
|
'ultramodern:check': "node ./scripts/validate-ultramodern-workspace.mjs",
|
|
869
|
-
check: 'pnpm ultramodern:check'
|
|
963
|
+
check: 'pnpm format:check && pnpm lint && pnpm typecheck && pnpm skills:check && pnpm ultramodern:check'
|
|
870
964
|
},
|
|
871
965
|
engines: {
|
|
872
966
|
node: '>=20',
|
|
@@ -889,35 +983,62 @@ function createRootPackageJson(scope, packageSource) {
|
|
|
889
983
|
}
|
|
890
984
|
},
|
|
891
985
|
devDependencies: {
|
|
892
|
-
'@
|
|
893
|
-
typescript:
|
|
986
|
+
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
987
|
+
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION,
|
|
988
|
+
oxlint: OXLINT_VERSION,
|
|
989
|
+
oxfmt: OXFMT_VERSION,
|
|
990
|
+
ultracite: ULTRACITE_VERSION
|
|
894
991
|
}
|
|
895
992
|
};
|
|
896
993
|
}
|
|
897
994
|
function createTsConfigBase(scope) {
|
|
898
995
|
return {
|
|
899
996
|
compilerOptions: {
|
|
900
|
-
target: '
|
|
997
|
+
target: 'ESNext',
|
|
901
998
|
lib: [
|
|
999
|
+
'ESNext',
|
|
902
1000
|
'DOM',
|
|
903
|
-
'DOM.Iterable'
|
|
904
|
-
'ES2022'
|
|
1001
|
+
'DOM.Iterable'
|
|
905
1002
|
],
|
|
906
|
-
module: '
|
|
1003
|
+
module: 'preserve',
|
|
907
1004
|
moduleResolution: 'Bundler',
|
|
1005
|
+
moduleDetection: 'force',
|
|
908
1006
|
jsx: 'preserve',
|
|
1007
|
+
isolatedModules: true,
|
|
1008
|
+
verbatimModuleSyntax: true,
|
|
909
1009
|
strict: true,
|
|
910
1010
|
noEmit: true,
|
|
1011
|
+
allowJs: true,
|
|
911
1012
|
esModuleInterop: true,
|
|
1013
|
+
noUncheckedIndexedAccess: true,
|
|
1014
|
+
exactOptionalPropertyTypes: true,
|
|
1015
|
+
noImplicitOverride: true,
|
|
1016
|
+
noFallthroughCasesInSwitch: true,
|
|
1017
|
+
noPropertyAccessFromIndexSignature: true,
|
|
1018
|
+
noImplicitReturns: true,
|
|
912
1019
|
skipLibCheck: true,
|
|
913
1020
|
resolveJsonModule: true,
|
|
914
|
-
baseUrl: '.',
|
|
915
1021
|
paths: Object.fromEntries(sharedPackages.map((sharedPackage)=>[
|
|
916
1022
|
ultramodern_workspace_packageName(scope, sharedPackage.id),
|
|
917
1023
|
[
|
|
918
1024
|
`${sharedPackage.directory}/src/index.ts`
|
|
919
1025
|
]
|
|
920
|
-
]))
|
|
1026
|
+
])),
|
|
1027
|
+
plugins: [
|
|
1028
|
+
{
|
|
1029
|
+
name: '@effect/language-service',
|
|
1030
|
+
diagnostics: true,
|
|
1031
|
+
includeSuggestionsInTsc: true,
|
|
1032
|
+
ignoreEffectSuggestionsInTscExitCode: false,
|
|
1033
|
+
ignoreEffectWarningsInTscExitCode: false,
|
|
1034
|
+
ignoreEffectErrorsInTscExitCode: false,
|
|
1035
|
+
skipDisabledOptimization: true,
|
|
1036
|
+
diagnosticSeverity: Object.fromEntries(effectDiagnostics.map((name)=>[
|
|
1037
|
+
name,
|
|
1038
|
+
'error'
|
|
1039
|
+
]))
|
|
1040
|
+
}
|
|
1041
|
+
]
|
|
921
1042
|
}
|
|
922
1043
|
};
|
|
923
1044
|
}
|
|
@@ -956,7 +1077,7 @@ function createAppPackage(scope, app, packageSource) {
|
|
|
956
1077
|
dev: 'modern dev',
|
|
957
1078
|
build: 'modern build',
|
|
958
1079
|
serve: 'modern serve',
|
|
959
|
-
typecheck:
|
|
1080
|
+
typecheck: effectTsgoTypecheckCommand
|
|
960
1081
|
},
|
|
961
1082
|
modernjs: {
|
|
962
1083
|
preset: 'presetUltramodern',
|
|
@@ -977,7 +1098,7 @@ function createServicePackage(scope, packageSource) {
|
|
|
977
1098
|
dev: 'modern dev',
|
|
978
1099
|
build: 'modern build',
|
|
979
1100
|
serve: 'modern serve',
|
|
980
|
-
typecheck:
|
|
1101
|
+
typecheck: effectTsgoTypecheckCommand
|
|
981
1102
|
},
|
|
982
1103
|
modernjs: {
|
|
983
1104
|
preset: 'presetUltramodern',
|
|
@@ -994,10 +1115,11 @@ function createServicePackage(scope, packageSource) {
|
|
|
994
1115
|
devDependencies: {
|
|
995
1116
|
'@modern-js/app-tools': modernPackageSpecifier('@modern-js/app-tools', packageSource),
|
|
996
1117
|
'@modern-js/plugin-bff': modernPackageSpecifier('@modern-js/plugin-bff', packageSource),
|
|
1118
|
+
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
1119
|
+
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION,
|
|
997
1120
|
'@types/node': '^20',
|
|
998
1121
|
'@types/react': '^19.1.8',
|
|
999
|
-
'@types/react-dom': '^19.1.6'
|
|
1000
|
-
typescript: TYPESCRIPT_VERSION
|
|
1122
|
+
'@types/react-dom': '^19.1.6'
|
|
1001
1123
|
}
|
|
1002
1124
|
};
|
|
1003
1125
|
}
|
|
@@ -1012,20 +1134,22 @@ function createSharedPackage(scope, id, description) {
|
|
|
1012
1134
|
'.': './src/index.ts'
|
|
1013
1135
|
},
|
|
1014
1136
|
scripts: {
|
|
1015
|
-
typecheck:
|
|
1137
|
+
typecheck: effectTsgoTypecheckCommand
|
|
1016
1138
|
},
|
|
1017
1139
|
devDependencies: {
|
|
1018
|
-
|
|
1140
|
+
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
1141
|
+
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION
|
|
1019
1142
|
}
|
|
1020
1143
|
};
|
|
1021
1144
|
}
|
|
1022
1145
|
function createAppModernConfig(app) {
|
|
1023
|
-
return
|
|
1146
|
+
return `// @effect-diagnostics processEnv:off
|
|
1147
|
+
import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
|
|
1024
1148
|
import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
|
|
1025
1149
|
import { moduleFederationPlugin } from '@module-federation/modern-js-v3';
|
|
1026
1150
|
|
|
1027
1151
|
const appId = '${app.id}';
|
|
1028
|
-
const port = Number(process.env
|
|
1152
|
+
const port = Number(process.env['${app.portEnv}'] ?? ${app.port});
|
|
1029
1153
|
|
|
1030
1154
|
export default defineConfig(
|
|
1031
1155
|
presetUltramodern(
|
|
@@ -1060,7 +1184,8 @@ export default defineConfig(
|
|
|
1060
1184
|
`;
|
|
1061
1185
|
}
|
|
1062
1186
|
function createShellModuleFederationConfig() {
|
|
1063
|
-
return
|
|
1187
|
+
return `// @effect-diagnostics nodeBuiltinImport:off processEnv:off
|
|
1188
|
+
import { createRequire } from 'node:module';
|
|
1064
1189
|
import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
|
|
1065
1190
|
import { dependencies } from './package.json';
|
|
1066
1191
|
|
|
@@ -1079,13 +1204,13 @@ export default createModuleFederationConfig({
|
|
|
1079
1204
|
dts: false,
|
|
1080
1205
|
remotes: {
|
|
1081
1206
|
commerce:
|
|
1082
|
-
process.env
|
|
1207
|
+
process.env['REMOTE_COMMERCE_MF_MANIFEST'] ??
|
|
1083
1208
|
'remoteCommerce@http://localhost:3021/mf-manifest.json',
|
|
1084
1209
|
identity:
|
|
1085
|
-
process.env
|
|
1210
|
+
process.env['REMOTE_IDENTITY_MF_MANIFEST'] ??
|
|
1086
1211
|
'remoteIdentity@http://localhost:3022/mf-manifest.json',
|
|
1087
1212
|
designSystem:
|
|
1088
|
-
process.env
|
|
1213
|
+
process.env['REMOTE_DESIGN_SYSTEM_MF_MANIFEST'] ??
|
|
1089
1214
|
'remoteDesignSystem@http://localhost:3023/mf-manifest.json',
|
|
1090
1215
|
},
|
|
1091
1216
|
shared: {
|
|
@@ -1115,7 +1240,8 @@ export default createModuleFederationConfig({
|
|
|
1115
1240
|
}
|
|
1116
1241
|
function createRemoteModuleFederationConfig(app) {
|
|
1117
1242
|
const exposes = JSON.stringify(app.exposes ?? {}, null, 4).replace(/^/gm, ' ');
|
|
1118
|
-
return
|
|
1243
|
+
return `// @effect-diagnostics nodeBuiltinImport:off
|
|
1244
|
+
import { createRequire } from 'node:module';
|
|
1119
1245
|
import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
|
|
1120
1246
|
import { dependencies } from './package.json';
|
|
1121
1247
|
|
|
@@ -1160,11 +1286,12 @@ export default createModuleFederationConfig({
|
|
|
1160
1286
|
`;
|
|
1161
1287
|
}
|
|
1162
1288
|
function createServiceModernConfig() {
|
|
1163
|
-
return
|
|
1289
|
+
return `// @effect-diagnostics processEnv:off
|
|
1290
|
+
import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
|
|
1164
1291
|
import { bffPlugin } from '@modern-js/plugin-bff';
|
|
1165
1292
|
|
|
1166
1293
|
const appId = '${effectService.id}';
|
|
1167
|
-
const port = Number(process.env
|
|
1294
|
+
const port = Number(process.env['${effectService.portEnv}'] ?? ${effectService.port});
|
|
1168
1295
|
|
|
1169
1296
|
export default defineConfig(
|
|
1170
1297
|
presetUltramodern(
|
|
@@ -1319,7 +1446,7 @@ import { recommendationsEffectApi } from '../../shared/effect/api';
|
|
|
1319
1446
|
const recommendationsLayer = HttpApiBuilder.group(
|
|
1320
1447
|
recommendationsEffectApi,
|
|
1321
1448
|
'recommendations',
|
|
1322
|
-
|
|
1449
|
+
handlers =>
|
|
1323
1450
|
handlers.handle('list', () =>
|
|
1324
1451
|
Effect.succeed({
|
|
1325
1452
|
items: [
|
|
@@ -1550,6 +1677,8 @@ function createTemplateManifest(modernVersion, packageSource) {
|
|
|
1550
1677
|
'apps/**',
|
|
1551
1678
|
'packages/**',
|
|
1552
1679
|
'package.json',
|
|
1680
|
+
'oxfmt.config.ts',
|
|
1681
|
+
'oxlint.config.ts',
|
|
1553
1682
|
'pnpm-workspace.yaml',
|
|
1554
1683
|
"scripts/**",
|
|
1555
1684
|
'services/**',
|
|
@@ -1583,6 +1712,11 @@ function createTemplateManifest(modernVersion, packageSource) {
|
|
|
1583
1712
|
licensePath: '.agents/rstackjs-agent-skills-LICENSE'
|
|
1584
1713
|
},
|
|
1585
1714
|
baseline: baselineAgentSkills,
|
|
1715
|
+
privateSource: {
|
|
1716
|
+
repository: 'https://github.com/TechsioCZ/skills',
|
|
1717
|
+
install: 'clone-if-authorized',
|
|
1718
|
+
baseline: privateAgentSkills
|
|
1719
|
+
},
|
|
1586
1720
|
lockFile: '.agents/skills-lock.json'
|
|
1587
1721
|
},
|
|
1588
1722
|
validation: {
|
|
@@ -1881,14 +2015,17 @@ function createBuiltinTemplateManifest(version) {
|
|
|
1881
2015
|
materialization: {
|
|
1882
2016
|
targetRoot: 'generated-project-root',
|
|
1883
2017
|
allowedPaths: [
|
|
2018
|
+
'.agents/**',
|
|
1884
2019
|
'.browserslistrc',
|
|
1885
2020
|
'.gitignore',
|
|
1886
2021
|
'.modernjs/**',
|
|
1887
2022
|
'.nvmrc',
|
|
2023
|
+
'AGENTS.md',
|
|
1888
2024
|
'README.md',
|
|
1889
2025
|
'api/**',
|
|
1890
|
-
'biome.json',
|
|
1891
2026
|
'modern.config.ts',
|
|
2027
|
+
'oxfmt.config.ts',
|
|
2028
|
+
'oxlint.config.ts',
|
|
1892
2029
|
'package.json',
|
|
1893
2030
|
'postcss.config.mjs',
|
|
1894
2031
|
"scripts/**",
|
|
@@ -2144,6 +2281,17 @@ function detectUltramodernPackageSource(args, defaultPackageVersion, createPacka
|
|
|
2144
2281
|
]) ?? 'modern-js-'
|
|
2145
2282
|
};
|
|
2146
2283
|
}
|
|
2284
|
+
function src_modernAliasPackageName(packageName, packageSource) {
|
|
2285
|
+
if (!packageSource.aliasScope) return packageName;
|
|
2286
|
+
const scope = packageSource.aliasScope.replace(/^@/, '');
|
|
2287
|
+
const unscopedName = packageName.split('/').at(-1);
|
|
2288
|
+
return `@${scope}/${packageSource.aliasPackageNamePrefix ?? ''}${unscopedName}`;
|
|
2289
|
+
}
|
|
2290
|
+
function singleAppModernPackageSpecifier(packageName, packageSource, useWorkspaceProtocol) {
|
|
2291
|
+
if (useWorkspaceProtocol) return 'workspace:*';
|
|
2292
|
+
if ('install' !== packageSource.strategy || !packageSource.aliasScope) return packageSource.modernPackageVersion;
|
|
2293
|
+
return `npm:${src_modernAliasPackageName(packageName, packageSource)}@${packageSource.modernPackageVersion}`;
|
|
2294
|
+
}
|
|
2147
2295
|
function isDirectoryEmpty(dirPath) {
|
|
2148
2296
|
if (!node_fs.existsSync(dirPath)) return false;
|
|
2149
2297
|
try {
|
|
@@ -2258,12 +2406,17 @@ async function main() {
|
|
|
2258
2406
|
const bffRuntime = detectBffRuntime();
|
|
2259
2407
|
const enableTailwind = detectTailwindFlag();
|
|
2260
2408
|
const useWorkspaceProtocol = detectWorkspaceProtocolFlag();
|
|
2261
|
-
const
|
|
2409
|
+
const packageSource = detectUltramodernPackageSource(args, ultramodernPackageVersion, createPackage);
|
|
2262
2410
|
const templateManifest = createBuiltinTemplateManifest(version);
|
|
2263
2411
|
validateTemplateManifest(templateManifest);
|
|
2264
2412
|
copyTemplate(templateDir, targetDir, {
|
|
2265
2413
|
packageName: generatedPackageName,
|
|
2266
|
-
version:
|
|
2414
|
+
version: useWorkspaceProtocol ? 'workspace:*' : packageSource.modernPackageVersion,
|
|
2415
|
+
runtimeVersion: singleAppModernPackageSpecifier('@modern-js/runtime', packageSource, useWorkspaceProtocol),
|
|
2416
|
+
appToolsVersion: singleAppModernPackageSpecifier('@modern-js/app-tools', packageSource, useWorkspaceProtocol),
|
|
2417
|
+
tsconfigVersion: singleAppModernPackageSpecifier('@modern-js/tsconfig', packageSource, useWorkspaceProtocol),
|
|
2418
|
+
pluginTanstackVersion: singleAppModernPackageSpecifier('@modern-js/plugin-tanstack', packageSource, useWorkspaceProtocol),
|
|
2419
|
+
pluginBffVersion: singleAppModernPackageSpecifier('@modern-js/plugin-bff', packageSource, useWorkspaceProtocol),
|
|
2267
2420
|
isSubproject,
|
|
2268
2421
|
routerFramework,
|
|
2269
2422
|
bffRuntime,
|
|
@@ -2278,12 +2431,19 @@ async function main() {
|
|
|
2278
2431
|
delete packageJson['simple-git-hooks'];
|
|
2279
2432
|
if (packageJson.scripts) {
|
|
2280
2433
|
delete packageJson.scripts.prepare;
|
|
2434
|
+
delete packageJson.scripts.format;
|
|
2435
|
+
delete packageJson.scripts['format:check'];
|
|
2281
2436
|
delete packageJson.scripts.lint;
|
|
2437
|
+
delete packageJson.scripts['lint:fix'];
|
|
2438
|
+
delete packageJson.scripts['skills:install'];
|
|
2439
|
+
delete packageJson.scripts['skills:check'];
|
|
2282
2440
|
}
|
|
2283
2441
|
if (packageJson.devDependencies) {
|
|
2284
2442
|
delete packageJson.devDependencies['lint-staged'];
|
|
2285
2443
|
delete packageJson.devDependencies['simple-git-hooks'];
|
|
2286
|
-
delete packageJson.devDependencies
|
|
2444
|
+
delete packageJson.devDependencies.oxlint;
|
|
2445
|
+
delete packageJson.devDependencies.oxfmt;
|
|
2446
|
+
delete packageJson.devDependencies.ultracite;
|
|
2287
2447
|
}
|
|
2288
2448
|
}
|
|
2289
2449
|
node_fs.writeFileSync(targetPackageJson, `${JSON.stringify(packageJson, null, 2)}\n`);
|
|
@@ -2303,10 +2463,13 @@ function copyTemplate(src, dest, options) {
|
|
|
2303
2463
|
recursive: true
|
|
2304
2464
|
});
|
|
2305
2465
|
const excludeInSubproject = [
|
|
2466
|
+
'.agents',
|
|
2306
2467
|
'.gitignore.handlebars',
|
|
2307
|
-
'
|
|
2468
|
+
'AGENTS.md',
|
|
2308
2469
|
'.npmrc',
|
|
2309
|
-
'.nvmrc'
|
|
2470
|
+
'.nvmrc',
|
|
2471
|
+
'oxfmt.config.ts',
|
|
2472
|
+
'oxlint.config.ts'
|
|
2310
2473
|
];
|
|
2311
2474
|
function copyRecursive(srcDir, destDir) {
|
|
2312
2475
|
const entries = node_fs.readdirSync(srcDir, {
|
|
@@ -2328,6 +2491,11 @@ function copyTemplate(src, dest, options) {
|
|
|
2328
2491
|
const rendered = src_renderTemplate(templateContent, {
|
|
2329
2492
|
packageName: options.packageName,
|
|
2330
2493
|
version: options.version,
|
|
2494
|
+
runtimeVersion: options.runtimeVersion,
|
|
2495
|
+
appToolsVersion: options.appToolsVersion,
|
|
2496
|
+
tsconfigVersion: options.tsconfigVersion,
|
|
2497
|
+
pluginTanstackVersion: options.pluginTanstackVersion,
|
|
2498
|
+
pluginBffVersion: options.pluginBffVersion,
|
|
2331
2499
|
isSubproject: options.isSubproject,
|
|
2332
2500
|
isTanstackRouter: 'tanstack' === options.routerFramework,
|
|
2333
2501
|
enableBff: 'none' !== options.bffRuntime,
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
24
|
-
"version": "3.2.0-ultramodern.
|
|
24
|
+
"version": "3.2.0-ultramodern.9",
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
26
|
"main": "./dist/index.js",
|
|
27
27
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/node": "^25.8.0",
|
|
42
42
|
"@typescript/native-preview": "7.0.0-dev.20260516.1",
|
|
43
43
|
"tsx": "^4.22.0",
|
|
44
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.
|
|
44
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.9"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"start": "node ./dist/index.js"
|
|
55
55
|
},
|
|
56
56
|
"ultramodern": {
|
|
57
|
-
"frameworkVersion": "3.2.0-ultramodern.
|
|
57
|
+
"frameworkVersion": "3.2.0-ultramodern.9"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"installDir": ".agents/skills",
|
|
4
|
+
"sources": [
|
|
5
|
+
{
|
|
6
|
+
"id": "techsiocz-private",
|
|
7
|
+
"visibility": "private",
|
|
8
|
+
"repository": "https://github.com/TechsioCZ/skills",
|
|
9
|
+
"install": "clone-if-authorized",
|
|
10
|
+
"baseline": [
|
|
11
|
+
{
|
|
12
|
+
"name": "plan-graph",
|
|
13
|
+
"reason": "Build and validate DAGs from .plan.md files"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "dag",
|
|
17
|
+
"reason": "Inspect current plan frontiers and blocked lanes"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "subagent-graph",
|
|
21
|
+
"reason": "Design dependency-aware multi-agent launch graphs"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "helm",
|
|
25
|
+
"reason": "Steer already-running multi-agent work"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "debugger-mode",
|
|
29
|
+
"reason": "Run hypothesis-driven debugging with runtime evidence"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# UltraModern Agent Contract
|
|
2
|
+
|
|
3
|
+
This project is generated for Codex-first UltraModern.js work.
|
|
4
|
+
|
|
5
|
+
## Quality Gates
|
|
6
|
+
|
|
7
|
+
- `pnpm lint` runs Oxlint with the Ultracite preset.
|
|
8
|
+
- `pnpm format` runs oxfmt.
|
|
9
|
+
- `pnpm typecheck` runs effect-tsgo as the TypeScript checker.
|
|
10
|
+
- `pnpm ultramodern:check` verifies the generated contract.
|
|
11
|
+
|
|
12
|
+
## Private Skills
|
|
13
|
+
|
|
14
|
+
Private orchestration skills are not vendored into this template. If you are authorized for `TechsioCZ/skills`, run:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm skills:install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`.
|
|
@@ -2,56 +2,24 @@
|
|
|
2
2
|
Effect,
|
|
3
3
|
HttpApiBuilder,
|
|
4
4
|
Layer,
|
|
5
|
-
Schema,
|
|
6
|
-
ServiceMap,
|
|
7
5
|
defineEffectBff,
|
|
8
6
|
} from '@modern-js/plugin-bff/effect-server';
|
|
9
7
|
import { bffEffectApi } from '../../shared/effect/api';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class GreetingService extends ServiceMap.Service<GreetingService>()('GreetingService', {
|
|
19
|
-
make: Effect.succeed({
|
|
20
|
-
hello: Effect.fn('GreetingService.hello')(function* () {
|
|
21
|
-
if (Date.now() < 0) {
|
|
22
|
-
return yield* Effect.fail(
|
|
23
|
-
new GreetingUnavailableError({
|
|
24
|
-
message: 'Greeting service is unavailable',
|
|
25
|
-
}),
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return {
|
|
9
|
+
const greetingsLayer = HttpApiBuilder.group(
|
|
10
|
+
bffEffectApi,
|
|
11
|
+
'greetings',
|
|
12
|
+
handlers =>
|
|
13
|
+
handlers.handle('hello', () =>
|
|
14
|
+
Effect.succeed({
|
|
30
15
|
message: 'Hello from Effect HttpApi',
|
|
31
16
|
runtime: 'effect' as const,
|
|
32
|
-
}
|
|
33
|
-
}),
|
|
34
|
-
}),
|
|
35
|
-
}) {
|
|
36
|
-
static readonly layer = Layer.effect(this, this.make);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const greetingsLayer = HttpApiBuilder.group(bffEffectApi, 'greetings', handlers =>
|
|
40
|
-
handlers.handle('hello', () =>
|
|
41
|
-
GreetingService.use(service => service.hello()).pipe(
|
|
42
|
-
Effect.catchTag('GreetingUnavailableError', error =>
|
|
43
|
-
Effect.succeed({
|
|
44
|
-
message: error.message,
|
|
45
|
-
runtime: 'effect' as const,
|
|
46
|
-
}),
|
|
47
|
-
),
|
|
17
|
+
}),
|
|
48
18
|
),
|
|
49
|
-
),
|
|
50
19
|
);
|
|
51
20
|
|
|
52
21
|
const layer = HttpApiBuilder.layer(bffEffectApi).pipe(
|
|
53
22
|
Layer.provide(greetingsLayer),
|
|
54
|
-
Layer.provide(GreetingService.layer),
|
|
55
23
|
);
|
|
56
24
|
|
|
57
25
|
export default defineEffectBff({
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
+
// @effect-diagnostics nodeBuiltinImport:off processEnv:off
|
|
1
2
|
import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
{{#if enableBff}}import { bffPlugin } from '@modern-js/plugin-bff';
|
|
4
5
|
{{/if}}{{#if isTanstackRouter}}import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
|
|
5
6
|
{{/if}}
|
|
6
7
|
|
|
7
|
-
const appId = process.env
|
|
8
|
+
const appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());
|
|
8
9
|
const enableModuleFederationSSR =
|
|
9
|
-
process.env
|
|
10
|
+
process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';
|
|
10
11
|
const enableBffRequestId =
|
|
11
|
-
process.env
|
|
12
|
+
process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';
|
|
12
13
|
const enableTelemetryExporters =
|
|
13
|
-
process.env
|
|
14
|
+
process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';
|
|
14
15
|
const telemetryFailLoudStartup =
|
|
15
|
-
process.env
|
|
16
|
+
process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';
|
|
17
|
+
const otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'];
|
|
18
|
+
const victoriaMetricsEndpoint =
|
|
19
|
+
process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];
|
|
16
20
|
|
|
17
21
|
// https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html
|
|
18
22
|
export default defineConfig(
|
|
@@ -43,8 +47,10 @@ export default defineConfig(
|
|
|
43
47
|
enableModuleFederationSSR,
|
|
44
48
|
enableTelemetryExporters,
|
|
45
49
|
telemetryFailLoudStartup,
|
|
46
|
-
otlpEndpoint:
|
|
47
|
-
victoriaMetricsEndpoint
|
|
50
|
+
...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),
|
|
51
|
+
...(typeof victoriaMetricsEndpoint === 'string'
|
|
52
|
+
? { victoriaMetricsEndpoint }
|
|
53
|
+
: {}),
|
|
48
54
|
},
|
|
49
55
|
),
|
|
50
56
|
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
import core from "ultracite/oxlint/core";
|
|
3
|
+
import react from "ultracite/oxlint/react";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
env: {
|
|
7
|
+
browser: true,
|
|
8
|
+
node: true,
|
|
9
|
+
},
|
|
10
|
+
extends: [core, react],
|
|
11
|
+
ignorePatterns: ["dist", "node_modules", ".modern", ".modernjs", "**/routeTree.gen.ts"],
|
|
12
|
+
});
|