@bleedingdev/modern-js-create 3.2.0-ultramodern.6 → 3.2.0-ultramodern.8
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 +225 -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 +8 -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/rstackjs-agent-skills-LICENSE +21 -0
- package/template-workspace/.agents/skills/rsbuild-best-practices/SKILL.md +57 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/SKILL.md +96 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/command-map.md +113 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/common-analysis-patterns.md +190 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +88 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +138 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +71 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor.md +39 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +103 -0
- package/template-workspace/.agents/skills/rslib-best-practices/SKILL.md +58 -0
- package/template-workspace/.agents/skills/rslib-modern-package/SKILL.md +173 -0
- package/template-workspace/.agents/skills/rspack-best-practices/SKILL.md +70 -0
- package/template-workspace/.agents/skills/rspack-tracing/SKILL.md +75 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/bottlenecks.md +47 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/tracing-guide.md +38 -0
- package/template-workspace/.agents/skills/rspack-tracing/scripts/analyze_trace.js +184 -0
- package/template-workspace/.agents/skills/rstest-best-practices/SKILL.md +133 -0
- package/template-workspace/.agents/skills-lock.json +95 -0
- package/template-workspace/AGENTS.md +45 -0
- 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 +127 -0
- package/template/biome.json +0 -41
package/dist/index.js
CHANGED
|
@@ -556,10 +556,32 @@ 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:*';
|
|
567
|
+
const RSTACK_AGENT_SKILLS_COMMIT = '61c948b42512e223bad44b83af4080eba48b2677';
|
|
568
|
+
const baselineAgentSkills = [
|
|
569
|
+
'rsbuild-best-practices',
|
|
570
|
+
'rspack-best-practices',
|
|
571
|
+
'rspack-tracing',
|
|
572
|
+
'rsdoctor-analysis',
|
|
573
|
+
'rslib-best-practices',
|
|
574
|
+
'rslib-modern-package',
|
|
575
|
+
'rstest-best-practices'
|
|
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);\"";
|
|
563
585
|
const modernPackageNames = [
|
|
564
586
|
'@modern-js/app-tools',
|
|
565
587
|
'@modern-js/plugin-bff',
|
|
@@ -706,6 +728,81 @@ const effectService = {
|
|
|
706
728
|
}
|
|
707
729
|
}
|
|
708
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
|
+
];
|
|
709
806
|
const sharedPackages = [
|
|
710
807
|
{
|
|
711
808
|
id: 'shared-contracts',
|
|
@@ -834,10 +931,11 @@ function appDependencies(scope, packageSource) {
|
|
|
834
931
|
function appDevDependencies(packageSource) {
|
|
835
932
|
return {
|
|
836
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,
|
|
837
936
|
'@types/node': '^20',
|
|
838
937
|
'@types/react': '^19.1.8',
|
|
839
|
-
'@types/react-dom': '^19.1.6'
|
|
840
|
-
typescript: TYPESCRIPT_VERSION
|
|
938
|
+
'@types/react-dom': '^19.1.6'
|
|
841
939
|
};
|
|
842
940
|
}
|
|
843
941
|
function createRootPackageJson(scope, packageSource) {
|
|
@@ -854,9 +952,15 @@ function createRootPackageJson(scope, packageSource) {
|
|
|
854
952
|
'dev:design-system': `pnpm --filter ${ultramodern_workspace_packageName(scope, 'remote-design-system')} dev`,
|
|
855
953
|
'dev:recommendations': `pnpm --filter ${ultramodern_workspace_packageName(scope, effectService.packageSuffix)} dev`,
|
|
856
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',
|
|
857
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",
|
|
858
962
|
'ultramodern:check': "node ./scripts/validate-ultramodern-workspace.mjs",
|
|
859
|
-
check: 'pnpm ultramodern:check'
|
|
963
|
+
check: 'pnpm format:check && pnpm lint && pnpm typecheck && pnpm skills:check && pnpm ultramodern:check'
|
|
860
964
|
},
|
|
861
965
|
engines: {
|
|
862
966
|
node: '>=20',
|
|
@@ -879,35 +983,62 @@ function createRootPackageJson(scope, packageSource) {
|
|
|
879
983
|
}
|
|
880
984
|
},
|
|
881
985
|
devDependencies: {
|
|
882
|
-
'@
|
|
883
|
-
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
|
|
884
991
|
}
|
|
885
992
|
};
|
|
886
993
|
}
|
|
887
994
|
function createTsConfigBase(scope) {
|
|
888
995
|
return {
|
|
889
996
|
compilerOptions: {
|
|
890
|
-
target: '
|
|
997
|
+
target: 'ESNext',
|
|
891
998
|
lib: [
|
|
999
|
+
'ESNext',
|
|
892
1000
|
'DOM',
|
|
893
|
-
'DOM.Iterable'
|
|
894
|
-
'ES2022'
|
|
1001
|
+
'DOM.Iterable'
|
|
895
1002
|
],
|
|
896
|
-
module: '
|
|
1003
|
+
module: 'preserve',
|
|
897
1004
|
moduleResolution: 'Bundler',
|
|
1005
|
+
moduleDetection: 'force',
|
|
898
1006
|
jsx: 'preserve',
|
|
1007
|
+
isolatedModules: true,
|
|
1008
|
+
verbatimModuleSyntax: true,
|
|
899
1009
|
strict: true,
|
|
900
1010
|
noEmit: true,
|
|
1011
|
+
allowJs: true,
|
|
901
1012
|
esModuleInterop: true,
|
|
1013
|
+
noUncheckedIndexedAccess: true,
|
|
1014
|
+
exactOptionalPropertyTypes: true,
|
|
1015
|
+
noImplicitOverride: true,
|
|
1016
|
+
noFallthroughCasesInSwitch: true,
|
|
1017
|
+
noPropertyAccessFromIndexSignature: true,
|
|
1018
|
+
noImplicitReturns: true,
|
|
902
1019
|
skipLibCheck: true,
|
|
903
1020
|
resolveJsonModule: true,
|
|
904
|
-
baseUrl: '.',
|
|
905
1021
|
paths: Object.fromEntries(sharedPackages.map((sharedPackage)=>[
|
|
906
1022
|
ultramodern_workspace_packageName(scope, sharedPackage.id),
|
|
907
1023
|
[
|
|
908
1024
|
`${sharedPackage.directory}/src/index.ts`
|
|
909
1025
|
]
|
|
910
|
-
]))
|
|
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
|
+
]
|
|
911
1042
|
}
|
|
912
1043
|
};
|
|
913
1044
|
}
|
|
@@ -946,7 +1077,7 @@ function createAppPackage(scope, app, packageSource) {
|
|
|
946
1077
|
dev: 'modern dev',
|
|
947
1078
|
build: 'modern build',
|
|
948
1079
|
serve: 'modern serve',
|
|
949
|
-
typecheck:
|
|
1080
|
+
typecheck: effectTsgoTypecheckCommand
|
|
950
1081
|
},
|
|
951
1082
|
modernjs: {
|
|
952
1083
|
preset: 'presetUltramodern',
|
|
@@ -967,7 +1098,7 @@ function createServicePackage(scope, packageSource) {
|
|
|
967
1098
|
dev: 'modern dev',
|
|
968
1099
|
build: 'modern build',
|
|
969
1100
|
serve: 'modern serve',
|
|
970
|
-
typecheck:
|
|
1101
|
+
typecheck: effectTsgoTypecheckCommand
|
|
971
1102
|
},
|
|
972
1103
|
modernjs: {
|
|
973
1104
|
preset: 'presetUltramodern',
|
|
@@ -984,10 +1115,11 @@ function createServicePackage(scope, packageSource) {
|
|
|
984
1115
|
devDependencies: {
|
|
985
1116
|
'@modern-js/app-tools': modernPackageSpecifier('@modern-js/app-tools', packageSource),
|
|
986
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,
|
|
987
1120
|
'@types/node': '^20',
|
|
988
1121
|
'@types/react': '^19.1.8',
|
|
989
|
-
'@types/react-dom': '^19.1.6'
|
|
990
|
-
typescript: TYPESCRIPT_VERSION
|
|
1122
|
+
'@types/react-dom': '^19.1.6'
|
|
991
1123
|
}
|
|
992
1124
|
};
|
|
993
1125
|
}
|
|
@@ -1002,20 +1134,22 @@ function createSharedPackage(scope, id, description) {
|
|
|
1002
1134
|
'.': './src/index.ts'
|
|
1003
1135
|
},
|
|
1004
1136
|
scripts: {
|
|
1005
|
-
typecheck:
|
|
1137
|
+
typecheck: effectTsgoTypecheckCommand
|
|
1006
1138
|
},
|
|
1007
1139
|
devDependencies: {
|
|
1008
|
-
|
|
1140
|
+
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
1141
|
+
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION
|
|
1009
1142
|
}
|
|
1010
1143
|
};
|
|
1011
1144
|
}
|
|
1012
1145
|
function createAppModernConfig(app) {
|
|
1013
|
-
return
|
|
1146
|
+
return `// @effect-diagnostics processEnv:off
|
|
1147
|
+
import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
|
|
1014
1148
|
import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
|
|
1015
1149
|
import { moduleFederationPlugin } from '@module-federation/modern-js-v3';
|
|
1016
1150
|
|
|
1017
1151
|
const appId = '${app.id}';
|
|
1018
|
-
const port = Number(process.env
|
|
1152
|
+
const port = Number(process.env['${app.portEnv}'] ?? ${app.port});
|
|
1019
1153
|
|
|
1020
1154
|
export default defineConfig(
|
|
1021
1155
|
presetUltramodern(
|
|
@@ -1050,7 +1184,8 @@ export default defineConfig(
|
|
|
1050
1184
|
`;
|
|
1051
1185
|
}
|
|
1052
1186
|
function createShellModuleFederationConfig() {
|
|
1053
|
-
return
|
|
1187
|
+
return `// @effect-diagnostics nodeBuiltinImport:off processEnv:off
|
|
1188
|
+
import { createRequire } from 'node:module';
|
|
1054
1189
|
import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
|
|
1055
1190
|
import { dependencies } from './package.json';
|
|
1056
1191
|
|
|
@@ -1069,13 +1204,13 @@ export default createModuleFederationConfig({
|
|
|
1069
1204
|
dts: false,
|
|
1070
1205
|
remotes: {
|
|
1071
1206
|
commerce:
|
|
1072
|
-
process.env
|
|
1207
|
+
process.env['REMOTE_COMMERCE_MF_MANIFEST'] ??
|
|
1073
1208
|
'remoteCommerce@http://localhost:3021/mf-manifest.json',
|
|
1074
1209
|
identity:
|
|
1075
|
-
process.env
|
|
1210
|
+
process.env['REMOTE_IDENTITY_MF_MANIFEST'] ??
|
|
1076
1211
|
'remoteIdentity@http://localhost:3022/mf-manifest.json',
|
|
1077
1212
|
designSystem:
|
|
1078
|
-
process.env
|
|
1213
|
+
process.env['REMOTE_DESIGN_SYSTEM_MF_MANIFEST'] ??
|
|
1079
1214
|
'remoteDesignSystem@http://localhost:3023/mf-manifest.json',
|
|
1080
1215
|
},
|
|
1081
1216
|
shared: {
|
|
@@ -1105,7 +1240,8 @@ export default createModuleFederationConfig({
|
|
|
1105
1240
|
}
|
|
1106
1241
|
function createRemoteModuleFederationConfig(app) {
|
|
1107
1242
|
const exposes = JSON.stringify(app.exposes ?? {}, null, 4).replace(/^/gm, ' ');
|
|
1108
|
-
return
|
|
1243
|
+
return `// @effect-diagnostics nodeBuiltinImport:off
|
|
1244
|
+
import { createRequire } from 'node:module';
|
|
1109
1245
|
import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
|
|
1110
1246
|
import { dependencies } from './package.json';
|
|
1111
1247
|
|
|
@@ -1150,11 +1286,12 @@ export default createModuleFederationConfig({
|
|
|
1150
1286
|
`;
|
|
1151
1287
|
}
|
|
1152
1288
|
function createServiceModernConfig() {
|
|
1153
|
-
return
|
|
1289
|
+
return `// @effect-diagnostics processEnv:off
|
|
1290
|
+
import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
|
|
1154
1291
|
import { bffPlugin } from '@modern-js/plugin-bff';
|
|
1155
1292
|
|
|
1156
1293
|
const appId = '${effectService.id}';
|
|
1157
|
-
const port = Number(process.env
|
|
1294
|
+
const port = Number(process.env['${effectService.portEnv}'] ?? ${effectService.port});
|
|
1158
1295
|
|
|
1159
1296
|
export default defineConfig(
|
|
1160
1297
|
presetUltramodern(
|
|
@@ -1309,7 +1446,7 @@ import { recommendationsEffectApi } from '../../shared/effect/api';
|
|
|
1309
1446
|
const recommendationsLayer = HttpApiBuilder.group(
|
|
1310
1447
|
recommendationsEffectApi,
|
|
1311
1448
|
'recommendations',
|
|
1312
|
-
|
|
1449
|
+
handlers =>
|
|
1313
1450
|
handlers.handle('list', () =>
|
|
1314
1451
|
Effect.succeed({
|
|
1315
1452
|
items: [
|
|
@@ -1533,11 +1670,15 @@ function createTemplateManifest(modernVersion, packageSource) {
|
|
|
1533
1670
|
materialization: {
|
|
1534
1671
|
targetRoot: 'generated-project-root',
|
|
1535
1672
|
allowedPaths: [
|
|
1673
|
+
'.agents/**',
|
|
1536
1674
|
'.modernjs/**',
|
|
1675
|
+
'AGENTS.md',
|
|
1537
1676
|
'README.md',
|
|
1538
1677
|
'apps/**',
|
|
1539
1678
|
'packages/**',
|
|
1540
1679
|
'package.json',
|
|
1680
|
+
'oxfmt.config.ts',
|
|
1681
|
+
'oxlint.config.ts',
|
|
1541
1682
|
'pnpm-workspace.yaml',
|
|
1542
1683
|
"scripts/**",
|
|
1543
1684
|
'services/**',
|
|
@@ -1562,6 +1703,22 @@ function createTemplateManifest(modernVersion, packageSource) {
|
|
|
1562
1703
|
modernPackageSpecifier: modernPackageVersion(packageSource),
|
|
1563
1704
|
generatedWorkspacePackageSpecifier: WORKSPACE_PACKAGE_VERSION
|
|
1564
1705
|
},
|
|
1706
|
+
agentSkills: {
|
|
1707
|
+
installDir: '.agents/skills',
|
|
1708
|
+
source: {
|
|
1709
|
+
repository: 'https://github.com/rstackjs/agent-skills',
|
|
1710
|
+
commit: RSTACK_AGENT_SKILLS_COMMIT,
|
|
1711
|
+
license: 'MIT',
|
|
1712
|
+
licensePath: '.agents/rstackjs-agent-skills-LICENSE'
|
|
1713
|
+
},
|
|
1714
|
+
baseline: baselineAgentSkills,
|
|
1715
|
+
privateSource: {
|
|
1716
|
+
repository: 'https://github.com/TechsioCZ/skills',
|
|
1717
|
+
install: 'clone-if-authorized',
|
|
1718
|
+
baseline: privateAgentSkills
|
|
1719
|
+
},
|
|
1720
|
+
lockFile: '.agents/skills-lock.json'
|
|
1721
|
+
},
|
|
1565
1722
|
validation: {
|
|
1566
1723
|
schemaValidation: true,
|
|
1567
1724
|
sourceValidation: [
|
|
@@ -1858,14 +2015,17 @@ function createBuiltinTemplateManifest(version) {
|
|
|
1858
2015
|
materialization: {
|
|
1859
2016
|
targetRoot: 'generated-project-root',
|
|
1860
2017
|
allowedPaths: [
|
|
2018
|
+
'.agents/**',
|
|
1861
2019
|
'.browserslistrc',
|
|
1862
2020
|
'.gitignore',
|
|
1863
2021
|
'.modernjs/**',
|
|
1864
2022
|
'.nvmrc',
|
|
2023
|
+
'AGENTS.md',
|
|
1865
2024
|
'README.md',
|
|
1866
2025
|
'api/**',
|
|
1867
|
-
'biome.json',
|
|
1868
2026
|
'modern.config.ts',
|
|
2027
|
+
'oxfmt.config.ts',
|
|
2028
|
+
'oxlint.config.ts',
|
|
1869
2029
|
'package.json',
|
|
1870
2030
|
'postcss.config.mjs',
|
|
1871
2031
|
"scripts/**",
|
|
@@ -2121,6 +2281,17 @@ function detectUltramodernPackageSource(args, defaultPackageVersion, createPacka
|
|
|
2121
2281
|
]) ?? 'modern-js-'
|
|
2122
2282
|
};
|
|
2123
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
|
+
}
|
|
2124
2295
|
function isDirectoryEmpty(dirPath) {
|
|
2125
2296
|
if (!node_fs.existsSync(dirPath)) return false;
|
|
2126
2297
|
try {
|
|
@@ -2235,12 +2406,17 @@ async function main() {
|
|
|
2235
2406
|
const bffRuntime = detectBffRuntime();
|
|
2236
2407
|
const enableTailwind = detectTailwindFlag();
|
|
2237
2408
|
const useWorkspaceProtocol = detectWorkspaceProtocolFlag();
|
|
2238
|
-
const
|
|
2409
|
+
const packageSource = detectUltramodernPackageSource(args, ultramodernPackageVersion, createPackage);
|
|
2239
2410
|
const templateManifest = createBuiltinTemplateManifest(version);
|
|
2240
2411
|
validateTemplateManifest(templateManifest);
|
|
2241
2412
|
copyTemplate(templateDir, targetDir, {
|
|
2242
2413
|
packageName: generatedPackageName,
|
|
2243
|
-
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),
|
|
2244
2420
|
isSubproject,
|
|
2245
2421
|
routerFramework,
|
|
2246
2422
|
bffRuntime,
|
|
@@ -2255,12 +2431,19 @@ async function main() {
|
|
|
2255
2431
|
delete packageJson['simple-git-hooks'];
|
|
2256
2432
|
if (packageJson.scripts) {
|
|
2257
2433
|
delete packageJson.scripts.prepare;
|
|
2434
|
+
delete packageJson.scripts.format;
|
|
2435
|
+
delete packageJson.scripts['format:check'];
|
|
2258
2436
|
delete packageJson.scripts.lint;
|
|
2437
|
+
delete packageJson.scripts['lint:fix'];
|
|
2438
|
+
delete packageJson.scripts['skills:install'];
|
|
2439
|
+
delete packageJson.scripts['skills:check'];
|
|
2259
2440
|
}
|
|
2260
2441
|
if (packageJson.devDependencies) {
|
|
2261
2442
|
delete packageJson.devDependencies['lint-staged'];
|
|
2262
2443
|
delete packageJson.devDependencies['simple-git-hooks'];
|
|
2263
|
-
delete packageJson.devDependencies
|
|
2444
|
+
delete packageJson.devDependencies.oxlint;
|
|
2445
|
+
delete packageJson.devDependencies.oxfmt;
|
|
2446
|
+
delete packageJson.devDependencies.ultracite;
|
|
2264
2447
|
}
|
|
2265
2448
|
}
|
|
2266
2449
|
node_fs.writeFileSync(targetPackageJson, `${JSON.stringify(packageJson, null, 2)}\n`);
|
|
@@ -2280,10 +2463,13 @@ function copyTemplate(src, dest, options) {
|
|
|
2280
2463
|
recursive: true
|
|
2281
2464
|
});
|
|
2282
2465
|
const excludeInSubproject = [
|
|
2466
|
+
'.agents',
|
|
2283
2467
|
'.gitignore.handlebars',
|
|
2284
|
-
'
|
|
2468
|
+
'AGENTS.md',
|
|
2285
2469
|
'.npmrc',
|
|
2286
|
-
'.nvmrc'
|
|
2470
|
+
'.nvmrc',
|
|
2471
|
+
'oxfmt.config.ts',
|
|
2472
|
+
'oxlint.config.ts'
|
|
2287
2473
|
];
|
|
2288
2474
|
function copyRecursive(srcDir, destDir) {
|
|
2289
2475
|
const entries = node_fs.readdirSync(srcDir, {
|
|
@@ -2305,6 +2491,11 @@ function copyTemplate(src, dest, options) {
|
|
|
2305
2491
|
const rendered = src_renderTemplate(templateContent, {
|
|
2306
2492
|
packageName: options.packageName,
|
|
2307
2493
|
version: options.version,
|
|
2494
|
+
runtimeVersion: options.runtimeVersion,
|
|
2495
|
+
appToolsVersion: options.appToolsVersion,
|
|
2496
|
+
tsconfigVersion: options.tsconfigVersion,
|
|
2497
|
+
pluginTanstackVersion: options.pluginTanstackVersion,
|
|
2498
|
+
pluginBffVersion: options.pluginBffVersion,
|
|
2308
2499
|
isSubproject: options.isSubproject,
|
|
2309
2500
|
isTanstackRouter: 'tanstack' === options.routerFramework,
|
|
2310
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.8",
|
|
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.8"
|
|
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.8"
|
|
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: any) =>
|
|
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,19 @@
|
|
|
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';
|
|
16
17
|
|
|
17
18
|
// https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html
|
|
18
19
|
export default defineConfig(
|
|
@@ -43,8 +44,8 @@ export default defineConfig(
|
|
|
43
44
|
enableModuleFederationSSR,
|
|
44
45
|
enableTelemetryExporters,
|
|
45
46
|
telemetryFailLoudStartup,
|
|
46
|
-
otlpEndpoint: process.env
|
|
47
|
-
victoriaMetricsEndpoint: process.env
|
|
47
|
+
otlpEndpoint: process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'],
|
|
48
|
+
victoriaMetricsEndpoint: process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'],
|
|
48
49
|
},
|
|
49
50
|
),
|
|
50
51
|
);
|