@ultrst-armada/krnl 1.0.1 → 1.0.3
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/README.md +67 -65
- package/package.json +13 -9
- package/packages/cli/dist/bin/krnl.cjs +1535 -9508
- package/packages/cli/dist/bin/krnl.js +55 -1915
- package/packages/cli/dist/chunk-6SHSECXR.js +1628 -0
- package/packages/cli/dist/index.cjs +1244 -7373
- package/packages/cli/dist/index.d.cts +45 -2
- package/packages/cli/dist/index.d.ts +45 -2
- package/packages/cli/dist/index.js +5 -20
- package/packages/cli/package.json +17 -10
- package/packages/core/dist/index.cjs +3039 -141
- package/packages/core/dist/index.d.cts +633 -27
- package/packages/core/dist/index.d.ts +633 -27
- package/packages/core/dist/index.js +3028 -139
- package/packages/core/package.json +15 -7
- package/packages/create-krnl/dist/index.cjs +322 -316
- package/packages/create-krnl/dist/index.js +322 -316
- package/packages/create-krnl/package.json +5 -3
- package/packages/eslint-plugin/dist/index.cjs +17 -55
- package/packages/eslint-plugin/dist/index.d.cts +8 -43
- package/packages/eslint-plugin/dist/index.d.ts +8 -43
- package/packages/eslint-plugin/dist/index.js +17 -55
- package/packages/eslint-plugin/package.json +5 -4
- package/packages/validate/dist/index.cjs +692 -361
- package/packages/validate/dist/index.d.cts +12 -14
- package/packages/validate/dist/index.d.ts +12 -14
- package/packages/validate/dist/index.js +692 -361
- package/packages/validate/package.json +14 -7
- package/packages/cli/dist/K_ENT_Entity-PQ5MURQY-ZG6FZXXX.js +0 -13
- package/packages/cli/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-K4CRQYA5.js +0 -8
- package/packages/cli/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-LNPXZYOE.js +0 -110
- package/packages/cli/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-3ALZPNX4.js +0 -11
- package/packages/cli/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-PJTICYSW.js +0 -11
- package/packages/cli/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-M5TYU55O.js +0 -8
- package/packages/cli/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-H6STOXRK.js +0 -20
- package/packages/cli/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-XPJXSF7D.js +0 -19
- package/packages/cli/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-CUYGTWOW.js +0 -7
- package/packages/cli/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-VR6T4N6J.js +0 -17
- package/packages/cli/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-RLJ4QWDP.js +0 -58
- package/packages/cli/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-BOQGUASC.js +0 -22
- package/packages/cli/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-XJI7KIT5.js +0 -8
- package/packages/cli/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-K5VCWAFW.js +0 -9
- package/packages/cli/dist/chunk-3TRM6CYL.js +0 -152
- package/packages/cli/dist/chunk-5JDK35TG.js +0 -3872
- package/packages/cli/dist/chunk-63PTK33I.js +0 -997
- package/packages/cli/dist/chunk-6NIKAMUZ.js +0 -82
- package/packages/cli/dist/chunk-BOXWWXQG.js +0 -400
- package/packages/cli/dist/chunk-EEKLK7QJ.js +0 -565
- package/packages/cli/dist/chunk-EG7T2IAD.js +0 -107
- package/packages/cli/dist/chunk-F5EHXE2O.js +0 -1036
- package/packages/cli/dist/chunk-F65ANSQG.js +0 -269
- package/packages/cli/dist/chunk-FDNCADFE.js +0 -71
- package/packages/cli/dist/chunk-GDLRMDAN.js +0 -127
- package/packages/cli/dist/chunk-HWMTCMOS.js +0 -656
- package/packages/cli/dist/chunk-I74QIQOD.js +0 -5536
- package/packages/cli/dist/chunk-JTLSTO25.js +0 -71
- package/packages/cli/dist/chunk-JULBBJ27.js +0 -1033
- package/packages/cli/dist/chunk-OHVMVRBP.js +0 -117
- package/packages/cli/dist/chunk-P2PCLEKX.js +0 -666
- package/packages/cli/dist/chunk-PJQIUOX2.js +0 -7767
- package/packages/cli/dist/chunk-PPOF3DJW.js +0 -471
- package/packages/cli/dist/chunk-Q45257P6.js +0 -173
- package/packages/cli/dist/chunk-QNROWGBI.js +0 -1036
- package/packages/cli/dist/chunk-RJNYUXZD.js +0 -977
- package/packages/cli/dist/chunk-SRTOPJ5W.js +0 -104
- package/packages/cli/dist/chunk-TCEX3MPS.js +0 -702
- package/packages/cli/dist/chunk-TNOAJO2J.js +0 -675
- package/packages/cli/dist/chunk-UR2SUCSF.js +0 -701
- package/packages/cli/dist/chunk-X5LOIFM7.js +0 -68
- package/packages/cli/dist/chunk-XIRFOO3H.js +0 -589
- package/packages/cli/dist/chunk-ZAAV3JXQ.js +0 -809
- package/packages/core/dist/K_ENT_Entity-4MB7CU4A.js +0 -12
- package/packages/core/dist/K_ENT_Entity-DEJGIDGH.js +0 -12
- package/packages/core/dist/K_ENT_Entity-FXZO5UZ2.js +0 -12
- package/packages/core/dist/K_ENT_Entity-HDSCXC5F.js +0 -12
- package/packages/core/dist/K_ENT_Entity-JILABHLW.js +0 -12
- package/packages/core/dist/K_ENT_Entity-PQ5MURQY.js +0 -13
- package/packages/core/dist/K_ENT_Entity-ROAKDIHW.js +0 -12
- package/packages/core/dist/K_ENT_Entity-TBVFSKDV.js +0 -12
- package/packages/core/dist/K_ENT_Entity-ZFLKG3JO.js +0 -12
- package/packages/core/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW.js +0 -8
- package/packages/core/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF.js +0 -110
- package/packages/core/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF.js +0 -9
- package/packages/core/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X.js +0 -9
- package/packages/core/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW.js +0 -8
- package/packages/core/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2.js +0 -20
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-4C6GBQAG.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-6V23A6F6.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK.js +0 -19
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-DYLLC5G2.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-F4FOFAUP.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-FBOXXMI3.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-Q73BWLNP.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QM2C4MVA.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QUGI6SMP.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RGMTBHNP.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RWR7UNDW.js +0 -18
- package/packages/core/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7.js +0 -7
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-32MFJJ5Z.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-4J4CEWRY.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-A366YHF2.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-LK4LYJHI.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-NW3K63II.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-QDHTI5ZV.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-VHCT6VIW.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-WBRKF24R.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-XKYQYT6Q.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-Z2PWZYDZ.js +0 -17
- package/packages/core/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5.js +0 -58
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-2EZU7QF4.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-6G3AQNAV.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-B2NZMQUG.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-C2RABMZP.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-HHE3NZ4F.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-LHFGR6WK.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-M74BLM3N.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-PT6ZA6EA.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-SP52V3CX.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF.js +0 -22
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-YNSEUHJJ.js +0 -21
- package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-M6SBHIVA.js +0 -8
- package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG.js +0 -8
- package/packages/core/dist/K_LIB_Krnl_Telemetry-77FRZ3KV.js +0 -9
- package/packages/core/dist/chunk-33L2J7V7.js +0 -82
- package/packages/core/dist/chunk-3ES4K2ZP.js +0 -817
- package/packages/core/dist/chunk-3SMHVVLL.js +0 -82
- package/packages/core/dist/chunk-3UEZ7JQA.js +0 -4877
- package/packages/core/dist/chunk-3XIE6KBD.js +0 -4877
- package/packages/core/dist/chunk-46ZLCML6.js +0 -107
- package/packages/core/dist/chunk-4UEL3DWJ.js +0 -107
- package/packages/core/dist/chunk-54GWZ5PC.js +0 -82
- package/packages/core/dist/chunk-6QCYRS5L.js +0 -127
- package/packages/core/dist/chunk-6ULMHNXR.js +0 -104
- package/packages/core/dist/chunk-7WUETJEV.js +0 -117
- package/packages/core/dist/chunk-A5KRAYDB.js +0 -107
- package/packages/core/dist/chunk-ANEAZ3PO.js +0 -107
- package/packages/core/dist/chunk-BE76RL6F.js +0 -82
- package/packages/core/dist/chunk-CIARVYDO.js +0 -107
- package/packages/core/dist/chunk-CR2ANE62.js +0 -107
- package/packages/core/dist/chunk-DI27MOR7.js +0 -173
- package/packages/core/dist/chunk-E6RLFHM5.js +0 -596
- package/packages/core/dist/chunk-EELAPMNV.js +0 -4877
- package/packages/core/dist/chunk-ENZ2RQVJ.js +0 -107
- package/packages/core/dist/chunk-F2U6CX4F.js +0 -4877
- package/packages/core/dist/chunk-FKG64OHL.js +0 -82
- package/packages/core/dist/chunk-FYAZJYM5.js +0 -772
- package/packages/core/dist/chunk-G4NP4RDQ.js +0 -82
- package/packages/core/dist/chunk-GADIRLRS.js +0 -473
- package/packages/core/dist/chunk-GR6CSLQJ.js +0 -772
- package/packages/core/dist/chunk-HDS7AT6O.js +0 -772
- package/packages/core/dist/chunk-HIMEZUU2.js +0 -71
- package/packages/core/dist/chunk-IB4UHG5I.js +0 -596
- package/packages/core/dist/chunk-J7ZYNVRS.js +0 -772
- package/packages/core/dist/chunk-JVLZU4K7.js +0 -604
- package/packages/core/dist/chunk-JYXXI7Q3.js +0 -82
- package/packages/core/dist/chunk-K54K2KZW.js +0 -192
- package/packages/core/dist/chunk-K6VHLBNH.js +0 -3316
- package/packages/core/dist/chunk-KCBP7ZYA.js +0 -596
- package/packages/core/dist/chunk-KFQGP6VL.js +0 -33
- package/packages/core/dist/chunk-KIUEUI7K.js +0 -82
- package/packages/core/dist/chunk-LB67NIZP.js +0 -949
- package/packages/core/dist/chunk-LDTYFUNW.js +0 -596
- package/packages/core/dist/chunk-MLVWARD4.js +0 -596
- package/packages/core/dist/chunk-MPYVXHKO.js +0 -2777
- package/packages/core/dist/chunk-MRQ3MITU.js +0 -772
- package/packages/core/dist/chunk-MVUN7I7O.js +0 -107
- package/packages/core/dist/chunk-NDDOIRW7.js +0 -596
- package/packages/core/dist/chunk-O3KDB5MH.js +0 -3330
- package/packages/core/dist/chunk-OEINUDSE.js +0 -400
- package/packages/core/dist/chunk-OPDENPT4.js +0 -4877
- package/packages/core/dist/chunk-P6XEM2LA.js +0 -429
- package/packages/core/dist/chunk-QKMRSQV4.js +0 -82
- package/packages/core/dist/chunk-R6CCWALL.js +0 -4877
- package/packages/core/dist/chunk-RAMMOO73.js +0 -774
- package/packages/core/dist/chunk-S3FTZFG6.js +0 -772
- package/packages/core/dist/chunk-T2ZVN434.js +0 -4877
- package/packages/core/dist/chunk-TFHLDMIA.js +0 -107
- package/packages/core/dist/chunk-TI3QUCIJ.js +0 -107
- package/packages/core/dist/chunk-TR2BAIGI.js +0 -107
- package/packages/core/dist/chunk-UGVVJKC6.js +0 -4877
- package/packages/core/dist/chunk-V2DX7YIU.js +0 -984
- package/packages/core/dist/chunk-W4IHYUYD.js +0 -772
- package/packages/core/dist/chunk-W6WBG5OY.js +0 -4877
- package/packages/core/dist/chunk-WN3M7O7H.js +0 -3312
- package/packages/core/dist/chunk-WR3NCU7U.js +0 -4877
- package/packages/core/dist/chunk-XC6B6L27.js +0 -82
- package/packages/core/dist/chunk-XNSE64ZY.js +0 -3316
- package/packages/core/dist/chunk-XROES2WN.js +0 -634
- package/packages/core/dist/chunk-XSCKNRCZ.js +0 -5020
- package/packages/core/dist/chunk-XVABPAUZ.js +0 -82
- package/packages/core/dist/chunk-YOBCB5C5.js +0 -596
- package/packages/core/dist/chunk-YUK6Q563.js +0 -666
- package/packages/core/dist/chunk-YXGL3ZEU.js +0 -1030
- package/packages/core/dist/chunk-ZINJ5OUX.js +0 -596
- package/packages/core/dist/chunk-ZPFD4BIQ.js +0 -604
- package/packages/core/dist/chunk-ZQZBFG6F.js +0 -4826
- package/packages/core/dist/chunk-ZZFRJGXM.js +0 -4877
- package/packages/create-krnl/dist/K_ENT_Entity-PQ5MURQY-R2OH4VXE.js +0 -14
- package/packages/create-krnl/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-AZM5HF4M.js +0 -9
- package/packages/create-krnl/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-X5N6SV2S.js +0 -111
- package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-5PFHF4JU.js +0 -12
- package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-ED33OQPH.js +0 -12
- package/packages/create-krnl/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-YGQLVR4P.js +0 -9
- package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-VM7CTU2L.js +0 -21
- package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-Y2GQFJ7I.js +0 -21
- package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-L3JQWO54.js +0 -8
- package/packages/create-krnl/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-KQARASPR.js +0 -19
- package/packages/create-krnl/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-OF3IGLVL.js +0 -59
- package/packages/create-krnl/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-JOLHKOEX.js +0 -24
- package/packages/create-krnl/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-L46LSHKQ.js +0 -10
- package/packages/create-krnl/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-4JUPRR3X.js +0 -10
- package/packages/create-krnl/dist/chunk-3TRM6CYL.js +0 -152
- package/packages/create-krnl/dist/chunk-3URCB3QS.js +0 -127
- package/packages/create-krnl/dist/chunk-5JDK35TG.js +0 -3872
- package/packages/create-krnl/dist/chunk-A2XAXDOW.js +0 -812
- package/packages/create-krnl/dist/chunk-AN6TMQHG.js +0 -1033
- package/packages/create-krnl/dist/chunk-BOXWWXQG.js +0 -400
- package/packages/create-krnl/dist/chunk-BPTBREBG.js +0 -38
- package/packages/create-krnl/dist/chunk-FDNCADFE.js +0 -71
- package/packages/create-krnl/dist/chunk-JTLSTO25.js +0 -71
- package/packages/create-krnl/dist/chunk-M3NCUIPL.js +0 -107
- package/packages/create-krnl/dist/chunk-N2EONSOC.js +0 -7769
- package/packages/create-krnl/dist/chunk-OHVMVRBP.js +0 -117
- package/packages/create-krnl/dist/chunk-Q45257P6.js +0 -173
- package/packages/create-krnl/dist/chunk-QGM4M3NI.js +0 -37
- package/packages/create-krnl/dist/chunk-RJNYUXZD.js +0 -977
- package/packages/create-krnl/dist/chunk-SRTOPJ5W.js +0 -104
- package/packages/create-krnl/dist/chunk-UPBIGEC3.js +0 -666
- package/packages/create-krnl/dist/chunk-V2DB7UD7.js +0 -82
- package/packages/create-krnl/dist/chunk-WMHLIUI6.js +0 -3644
- package/packages/create-krnl/dist/chunk-XIRFOO3H.js +0 -589
- package/packages/create-krnl/dist/chunk-Y2CEEVZP.js +0 -5536
- package/packages/create-krnl/dist/main-DXUMPBND.js +0 -2217
- package/packages/create-krnl/dist/wrapper-SDF2VKX3.js +0 -31
|
@@ -1,367 +1,373 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import { KrnlPackageReconciler } from "@
|
|
7
|
-
var rawArg = process.argv[2] || "my-krnl-app";
|
|
8
|
-
var targetDir = path.resolve(process.cwd(), rawArg);
|
|
9
|
-
var projectName = path.basename(targetDir);
|
|
10
|
-
console.log(`
|
|
11
|
-
\u{1F680} [create-krnl] Scaffolding new Krnl project with symmetric backend/frontend planes in: ${targetDir}
|
|
12
|
-
`);
|
|
13
|
-
if (fs.existsSync(targetDir)) {
|
|
14
|
-
console.error(`\u274C Directory "${projectName}" already exists.`);
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
fs.mkdirSync(targetDir, { recursive: true });
|
|
18
|
-
var bLibDir = path.join(targetDir, "krnl", "backend", "libraries", "AppConcepts");
|
|
19
|
-
var bEntityDir = path.join(targetDir, "krnl", "backend", "entities", "App");
|
|
20
|
-
var bFuncDir = path.join(targetDir, "krnl", "backend", "functionalities", "Hello");
|
|
21
|
-
fs.mkdirSync(path.join(bLibDir, "tests"), { recursive: true });
|
|
22
|
-
fs.mkdirSync(path.join(bEntityDir, "orchestrations"), { recursive: true });
|
|
23
|
-
fs.mkdirSync(path.join(bEntityDir, "tests"), { recursive: true });
|
|
24
|
-
fs.mkdirSync(path.join(bFuncDir, "main_function"), { recursive: true });
|
|
25
|
-
fs.mkdirSync(path.join(bFuncDir, "state_data"), { recursive: true });
|
|
26
|
-
fs.mkdirSync(path.join(bFuncDir, "helper_functions"), { recursive: true });
|
|
27
|
-
fs.mkdirSync(path.join(bFuncDir, "events"), { recursive: true });
|
|
28
|
-
fs.mkdirSync(path.join(bFuncDir, "tests"), { recursive: true });
|
|
29
|
-
var fLibDir = path.join(targetDir, "krnl", "frontend", "libraries", "ButtonConcepts");
|
|
30
|
-
var fEntityDir = path.join(targetDir, "krnl", "frontend", "entities", "App");
|
|
31
|
-
var fFuncDir = path.join(targetDir, "krnl", "frontend", "functionalities", "Hello");
|
|
32
|
-
fs.mkdirSync(path.join(fLibDir, "tests"), { recursive: true });
|
|
33
|
-
fs.mkdirSync(path.join(fEntityDir, "tests"), { recursive: true });
|
|
34
|
-
fs.mkdirSync(path.join(fFuncDir, "tests"), { recursive: true });
|
|
35
|
-
fs.mkdirSync(path.join(targetDir, "docs"), { recursive: true });
|
|
36
|
-
fs.mkdirSync(path.join(targetDir, ".skipo"), { recursive: true });
|
|
37
|
-
fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify({
|
|
38
|
-
name: projectName,
|
|
39
|
-
version: "1.0.0",
|
|
40
|
-
description: "Full-stack application powered by Krnl symmetric architecture",
|
|
41
|
-
type: "module",
|
|
42
|
-
main: "dist/index.js",
|
|
43
|
-
scripts: {
|
|
44
|
-
dev: "krnl dev",
|
|
45
|
-
build: "krnl build",
|
|
46
|
-
validate: "krnl validate",
|
|
47
|
-
test: "vitest run",
|
|
48
|
-
sync: "krnl sync"
|
|
49
|
-
},
|
|
50
|
-
dependencies: {
|
|
51
|
-
"@dinilmusick/krnl": "^1.0.0",
|
|
52
|
-
"@dinilmusick/krnl-core": "^1.0.0",
|
|
53
|
-
"@dinilmusick/krnl-ui": "^1.0.0"
|
|
54
|
-
},
|
|
55
|
-
devDependencies: {
|
|
56
|
-
"@dinilmusick/krnl-cli": "^1.0.0",
|
|
57
|
-
"@dinilmusick/krnl-validate": "^1.0.0",
|
|
58
|
-
"@dinilmusick/eslint-plugin-krnl": "^1.0.0",
|
|
59
|
-
"typescript": "^5.7.3",
|
|
60
|
-
"vitest": "^1.6.0"
|
|
61
|
-
}
|
|
62
|
-
}, null, 2));
|
|
63
|
-
fs.writeFileSync(path.join(targetDir, "tsconfig.json"), JSON.stringify({
|
|
64
|
-
compilerOptions: {
|
|
65
|
-
target: "ESNext",
|
|
66
|
-
module: "NodeNext",
|
|
67
|
-
moduleResolution: "NodeNext",
|
|
68
|
-
lib: ["ESNext", "DOM"],
|
|
69
|
-
jsx: "react-jsx",
|
|
70
|
-
strict: true,
|
|
71
|
-
outDir: "./dist",
|
|
72
|
-
skipLibCheck: true,
|
|
73
|
-
resolveJsonModule: true,
|
|
74
|
-
paths: {
|
|
75
|
-
"@/*": ["./krnl/*"]
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
include: ["krnl/**/*", `${projectName}.ts`, "krnl-magnetic.d.ts"],
|
|
79
|
-
exclude: ["node_modules", "dist"]
|
|
80
|
-
}, null, 2));
|
|
81
|
-
fs.writeFileSync(path.join(targetDir, `${projectName}.ts`), `import { defineApp, Protocols } from "@dinilmusick/krnl-core";
|
|
82
|
-
import { App } from "./krnl/backend/entities/App/App.js";
|
|
4
|
+
import * as fs3 from "fs";
|
|
5
|
+
import * as path3 from "path";
|
|
6
|
+
import { KrnlPackageReconciler } from "@ultrst-armada/krnl-core";
|
|
83
7
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
8
|
+
// src/templates/configTemplates.ts
|
|
9
|
+
function getBasePackageJson(projectName2) {
|
|
10
|
+
return JSON.stringify(
|
|
11
|
+
{
|
|
12
|
+
name: projectName2,
|
|
13
|
+
version: "1.0.0",
|
|
14
|
+
description: "Full-stack application powered by Krnl symmetric architecture",
|
|
15
|
+
type: "module",
|
|
16
|
+
main: "dist/index.js",
|
|
17
|
+
scripts: {
|
|
18
|
+
dev: "krnl dev",
|
|
19
|
+
build: "krnl build",
|
|
20
|
+
validate: "krnl validate",
|
|
21
|
+
test: "vitest run",
|
|
22
|
+
sync: "krnl sync"
|
|
23
|
+
},
|
|
24
|
+
dependencies: {
|
|
25
|
+
"@ultrst-armada/krnl": "^1.0.0",
|
|
26
|
+
"@ultrst-armada/krnl-core": "^1.0.0",
|
|
27
|
+
"react": "^18.3.1"
|
|
28
|
+
},
|
|
29
|
+
devDependencies: {
|
|
30
|
+
"@types/node": "^22.0.0",
|
|
31
|
+
"@types/react": "^18.3.1",
|
|
32
|
+
"@ultrst-armada/krnl-cli": "^1.0.0",
|
|
33
|
+
"@ultrst-armada/krnl-validate": "^1.0.0",
|
|
34
|
+
typescript: "^5.7.3",
|
|
35
|
+
vitest: "^1.6.0"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
null,
|
|
39
|
+
2
|
|
40
|
+
);
|
|
110
41
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
42
|
+
function getTsConfig(projectName2) {
|
|
43
|
+
return JSON.stringify(
|
|
44
|
+
{
|
|
45
|
+
compilerOptions: {
|
|
46
|
+
target: "ESNext",
|
|
47
|
+
module: "NodeNext",
|
|
48
|
+
moduleResolution: "NodeNext",
|
|
49
|
+
lib: ["ESNext", "DOM"],
|
|
50
|
+
jsx: "react-jsx",
|
|
51
|
+
strict: true,
|
|
52
|
+
outDir: "./dist",
|
|
53
|
+
skipLibCheck: true,
|
|
54
|
+
resolveJsonModule: true,
|
|
55
|
+
paths: {
|
|
56
|
+
"@/*": ["./krnl/*"]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
include: ["krnl/**/*", `${projectName2}.ts`, "krnl-magnetic.d.ts"],
|
|
60
|
+
exclude: ["node_modules", "dist"]
|
|
61
|
+
},
|
|
62
|
+
null,
|
|
63
|
+
2
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function getAppEntrypoint(projectName2) {
|
|
67
|
+
const safeIdentifier = projectName2.replace(/[^a-zA-Z0-9_$]/g, "_");
|
|
68
|
+
return `import { AppServiceFacade } from "./krnl/backend/services/App/AppServiceFacade.js";
|
|
117
69
|
|
|
118
|
-
|
|
70
|
+
export const services = {
|
|
71
|
+
app: AppServiceFacade,
|
|
72
|
+
};
|
|
119
73
|
|
|
120
|
-
export
|
|
121
|
-
|
|
74
|
+
export const ${safeIdentifier}Backend = {
|
|
75
|
+
services,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default AppServiceFacade;
|
|
79
|
+
`;
|
|
122
80
|
}
|
|
123
|
-
`);
|
|
124
|
-
fs.writeFileSync(path.join(bLibDir, "manifest.json"), JSON.stringify({
|
|
125
|
-
name: "AppConcepts",
|
|
126
|
-
description: "Core utility concept library for App",
|
|
127
|
-
dependencies: {}
|
|
128
|
-
}, null, 2));
|
|
129
|
-
fs.writeFileSync(path.join(bLibDir, "tests", "AppConcepts.test.ts"), `import { describe, it, expect } from "vitest";
|
|
130
|
-
import { pureTransform } from "../functions.js";
|
|
131
81
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
82
|
+
// src/templates/backendTemplates.ts
|
|
83
|
+
import * as fs from "fs";
|
|
84
|
+
import * as path from "path";
|
|
85
|
+
function scaffoldBackend(targetDir2) {
|
|
86
|
+
const bServiceDir = path.join(targetDir2, "krnl", "backend", "services", "App");
|
|
87
|
+
const bLibDir = path.join(bServiceDir, "libraries", "AppConcepts");
|
|
88
|
+
const bOrchDir = path.join(bServiceDir, "orchestrations", "App");
|
|
89
|
+
const bFuncDir = path.join(bServiceDir, "functionalities", "Hello");
|
|
90
|
+
fs.mkdirSync(path.join(bLibDir, "tests"), { recursive: true });
|
|
91
|
+
fs.mkdirSync(path.join(bOrchDir, "tests"), { recursive: true });
|
|
92
|
+
fs.mkdirSync(path.join(bServiceDir, "tests"), { recursive: true });
|
|
93
|
+
fs.mkdirSync(path.join(bFuncDir, "main_function"), { recursive: true });
|
|
94
|
+
fs.mkdirSync(path.join(bFuncDir, "helper_functions"), { recursive: true });
|
|
95
|
+
fs.mkdirSync(path.join(bFuncDir, "events"), { recursive: true });
|
|
96
|
+
fs.mkdirSync(path.join(bFuncDir, "tests"), { recursive: true });
|
|
97
|
+
fs.writeFileSync(
|
|
98
|
+
path.join(bLibDir, "definitions.ts"),
|
|
99
|
+
`export interface AppTransformOptions { normalize?: boolean; }
|
|
100
|
+
`
|
|
101
|
+
);
|
|
102
|
+
fs.writeFileSync(
|
|
103
|
+
path.join(bLibDir, "functions.ts"),
|
|
104
|
+
`import type { AppTransformOptions } from "./definitions.js";
|
|
105
|
+
export function appPureTransform<T>(data: T, _options?: AppTransformOptions): T { return data; }
|
|
106
|
+
`
|
|
107
|
+
);
|
|
108
|
+
fs.writeFileSync(
|
|
109
|
+
path.join(bLibDir, "index.ts"),
|
|
110
|
+
`export * from "./definitions.js";
|
|
111
|
+
export * from "./functions.js";
|
|
112
|
+
`
|
|
113
|
+
);
|
|
114
|
+
fs.writeFileSync(
|
|
115
|
+
path.join(bLibDir, "manifest.json"),
|
|
116
|
+
JSON.stringify({ name: "AppConcepts", service: "App", description: "Core utility concept library for App", dependencies: {} }, null, 2)
|
|
117
|
+
);
|
|
118
|
+
fs.writeFileSync(
|
|
119
|
+
path.join(bLibDir, "tests", "AppConcepts.test.ts"),
|
|
120
|
+
`import { describe, it, expect } from "vitest";
|
|
121
|
+
import { appPureTransform } from "../functions.js";
|
|
122
|
+
describe("AppConcepts", () => { it("transforms data", () => { expect(appPureTransform(42)).toBe(42); }); });
|
|
123
|
+
`
|
|
124
|
+
);
|
|
125
|
+
fs.writeFileSync(
|
|
126
|
+
path.join(bOrchDir, "AppFunctionalityOrchestration.ts"),
|
|
127
|
+
`import { FunctionalityOrchestration } from "@ultrst-armada/krnl-core";
|
|
139
128
|
|
|
140
129
|
/**
|
|
141
|
-
* @role
|
|
130
|
+
* @role functionality-orchestration
|
|
131
|
+
* Declarative FunctionalityOrchestration flow for App.
|
|
142
132
|
*/
|
|
143
|
-
export class
|
|
133
|
+
export class AppFunctionalityOrchestration extends FunctionalityOrchestration {
|
|
144
134
|
constructor() {
|
|
145
135
|
super({
|
|
146
|
-
id: "
|
|
136
|
+
id: "AppFunctionalityOrchestration",
|
|
137
|
+
name: "App",
|
|
147
138
|
version: "1.0.0",
|
|
148
|
-
description: "Root
|
|
139
|
+
description: "Root service functionality orchestration flow",
|
|
149
140
|
});
|
|
150
|
-
}
|
|
151
141
|
|
|
152
|
-
|
|
153
|
-
|
|
142
|
+
this.flow("default")
|
|
143
|
+
.thenFunctionality("Hello")
|
|
144
|
+
.register({ visibility: "public" });
|
|
154
145
|
}
|
|
155
146
|
}
|
|
156
147
|
|
|
157
|
-
export default
|
|
158
|
-
`
|
|
159
|
-
|
|
148
|
+
export default AppFunctionalityOrchestration;
|
|
149
|
+
`
|
|
150
|
+
);
|
|
151
|
+
fs.writeFileSync(
|
|
152
|
+
path.join(bOrchDir, "tests", "AppFunctionalityOrchestration.test.ts"),
|
|
153
|
+
`import { describe, it, expect } from "vitest";
|
|
154
|
+
import { AppFunctionalityOrchestration } from "../AppFunctionalityOrchestration.js";
|
|
155
|
+
describe("AppFunctionalityOrchestration", () => { it("initializes flow correctly", () => { expect(new AppFunctionalityOrchestration().id).toBe("AppFunctionalityOrchestration"); }); });
|
|
156
|
+
`
|
|
157
|
+
);
|
|
158
|
+
fs.writeFileSync(
|
|
159
|
+
path.join(bServiceDir, "AppServiceFacade.ts"),
|
|
160
|
+
`import { ServiceFacade } from "@ultrst-armada/krnl-core";
|
|
161
|
+
import { AppFunctionalityOrchestration } from "./orchestrations/App/AppFunctionalityOrchestration.js";
|
|
162
|
+
import * as appConcepts from "./libraries/AppConcepts/index.js";
|
|
160
163
|
|
|
161
|
-
export
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
export const AppServiceFacade = new ServiceFacade({
|
|
165
|
+
id: "app.service",
|
|
166
|
+
name: "AppService",
|
|
167
|
+
version: "1.0.0",
|
|
168
|
+
description: "Primary application service facade",
|
|
169
|
+
functionalityOrchestrations: {
|
|
170
|
+
App: new AppFunctionalityOrchestration(),
|
|
171
|
+
},
|
|
172
|
+
libraries: {
|
|
173
|
+
AppConcepts: appConcepts,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
169
176
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
177
|
+
export default AppServiceFacade;
|
|
178
|
+
`
|
|
179
|
+
);
|
|
180
|
+
fs.writeFileSync(
|
|
181
|
+
path.join(bServiceDir, "tests", "AppServiceFacade.test.ts"),
|
|
182
|
+
`import { describe, it, expect } from "vitest";
|
|
183
|
+
import { AppServiceFacade } from "../AppServiceFacade.js";
|
|
184
|
+
describe("AppServiceFacade", () => {
|
|
185
|
+
it("exposes orchestrations and libraries correctly", () => {
|
|
186
|
+
expect(AppServiceFacade.id).toBe("app.service");
|
|
187
|
+
expect(AppServiceFacade.functionalityOrchestrations.App).toBeDefined();
|
|
188
|
+
expect(AppServiceFacade.libraries.AppConcepts).toBeDefined();
|
|
189
|
+
expect(typeof AppServiceFacade.libraries.AppConcepts.appPureTransform).toBe("function");
|
|
174
190
|
});
|
|
175
191
|
});
|
|
176
|
-
`
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
export interface HelloOutput {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
fs.writeFileSync(path.join(bFuncDir, "main_function", "logic.ts"), `import type { HelloInput, HelloOutput } from "../HelloAtom.js";
|
|
192
|
+
`
|
|
193
|
+
);
|
|
194
|
+
fs.writeFileSync(
|
|
195
|
+
path.join(bFuncDir, "HelloAtom.ts"),
|
|
196
|
+
`export interface HelloInput { name?: string; }
|
|
197
|
+
export interface HelloOutput { greeting: string; timestamp: number; }
|
|
198
|
+
`
|
|
199
|
+
);
|
|
200
|
+
fs.writeFileSync(
|
|
201
|
+
path.join(bFuncDir, "manifest.json"),
|
|
202
|
+
JSON.stringify({ name: "Hello", service: "App", description: "Greeting quad-unit functionality", dependencies: {} }, null, 2)
|
|
203
|
+
);
|
|
204
|
+
fs.writeFileSync(
|
|
205
|
+
path.join(bFuncDir, "main_function", "logic.ts"),
|
|
206
|
+
`import type { HelloInput, HelloOutput } from "../HelloAtom.js";
|
|
192
207
|
import { formatGreeting } from "../helper_functions/formatGreeting.js";
|
|
193
|
-
|
|
194
|
-
export const main = async (input: HelloInput, { state }: any): Promise<HelloOutput> => {
|
|
208
|
+
export const main = async (input: HelloInput, _ctx: any): Promise<HelloOutput> => {
|
|
195
209
|
const greeting = formatGreeting(input.name || "World");
|
|
196
|
-
|
|
197
|
-
return {
|
|
198
|
-
greeting,
|
|
199
|
-
timestamp: Date.now()
|
|
200
|
-
};
|
|
210
|
+
return { greeting, timestamp: Date.now() };
|
|
201
211
|
};
|
|
202
|
-
`
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
export async function onTeardown() {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
`
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return "Hello, " + name + "! Welcome to Krnl.";
|
|
224
|
-
}
|
|
225
|
-
`);
|
|
226
|
-
fs.writeFileSync(path.join(bFuncDir, "events", "helloEvents.ts"), `/**
|
|
227
|
-
* @role component
|
|
228
|
-
*/
|
|
229
|
-
export interface HelloGreetedEvent {
|
|
230
|
-
name: string;
|
|
231
|
-
timestamp: number;
|
|
232
|
-
}
|
|
233
|
-
`);
|
|
234
|
-
fs.writeFileSync(path.join(bFuncDir, "tests", "Hello.test.ts"), `import { describe, it, expect } from "vitest";
|
|
212
|
+
`
|
|
213
|
+
);
|
|
214
|
+
fs.writeFileSync(
|
|
215
|
+
path.join(bFuncDir, "main_function", "lifecycle.ts"),
|
|
216
|
+
`export async function onMount() {}
|
|
217
|
+
export async function onTeardown() {}
|
|
218
|
+
`
|
|
219
|
+
);
|
|
220
|
+
fs.writeFileSync(
|
|
221
|
+
path.join(bFuncDir, "helper_functions", "formatGreeting.ts"),
|
|
222
|
+
`export function formatGreeting(name: string): string { return "Hello, " + name + "! Welcome to Krnl."; }
|
|
223
|
+
`
|
|
224
|
+
);
|
|
225
|
+
fs.writeFileSync(
|
|
226
|
+
path.join(bFuncDir, "events", "helloEvents.ts"),
|
|
227
|
+
`export interface HelloGreetedEvent { name: string; timestamp: number; }
|
|
228
|
+
`
|
|
229
|
+
);
|
|
230
|
+
fs.writeFileSync(
|
|
231
|
+
path.join(bFuncDir, "tests", "Hello.test.ts"),
|
|
232
|
+
`import { describe, it, expect } from "vitest";
|
|
235
233
|
import { formatGreeting } from "../helper_functions/formatGreeting.js";
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
expect(formatGreeting("Alice")).toContain("Alice");
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
`);
|
|
243
|
-
fs.writeFileSync(path.join(fLibDir, "definitions.ts"), `export type ButtonVariant = "primary" | "secondary" | "danger" | "ghost";
|
|
244
|
-
|
|
245
|
-
export interface ButtonProps {
|
|
246
|
-
label: string;
|
|
247
|
-
variant?: ButtonVariant;
|
|
248
|
-
disabled?: boolean;
|
|
249
|
-
onClick?: () => void;
|
|
234
|
+
describe("Hello functionality", () => { it("formats greeting", () => { expect(formatGreeting("Alice")).toContain("Alice"); }); });
|
|
235
|
+
`
|
|
236
|
+
);
|
|
250
237
|
}
|
|
251
|
-
|
|
252
|
-
|
|
238
|
+
|
|
239
|
+
// src/templates/frontendTemplates.ts
|
|
240
|
+
import * as fs2 from "fs";
|
|
241
|
+
import * as path2 from "path";
|
|
242
|
+
function scaffoldFrontend(targetDir2, projectName2) {
|
|
243
|
+
const fLibDir = path2.join(targetDir2, "krnl", "frontend", "libraries", "ButtonConcepts");
|
|
244
|
+
const fOrchDir = path2.join(targetDir2, "krnl", "frontend", "orchestrations", "App");
|
|
245
|
+
const fFuncDir = path2.join(targetDir2, "krnl", "frontend", "functionalities", "Hello");
|
|
246
|
+
fs2.mkdirSync(path2.join(fLibDir, "tests"), { recursive: true });
|
|
247
|
+
fs2.mkdirSync(path2.join(fOrchDir, "tests"), { recursive: true });
|
|
248
|
+
fs2.mkdirSync(path2.join(fFuncDir, "tests"), { recursive: true });
|
|
249
|
+
fs2.mkdirSync(path2.join(targetDir2, "docs"), { recursive: true });
|
|
250
|
+
fs2.mkdirSync(path2.join(targetDir2, ".krnl"), { recursive: true });
|
|
251
|
+
fs2.writeFileSync(
|
|
252
|
+
path2.join(fLibDir, "definitions.ts"),
|
|
253
|
+
`export type ButtonVariant = "primary" | "secondary";
|
|
254
|
+
export interface ButtonProps { label: string; variant?: ButtonVariant; disabled?: boolean; onClick?: () => void; }
|
|
255
|
+
`
|
|
256
|
+
);
|
|
257
|
+
fs2.writeFileSync(
|
|
258
|
+
path2.join(fLibDir, "components.tsx"),
|
|
259
|
+
`import React from "react";
|
|
253
260
|
import type { ButtonProps } from "./definitions.js";
|
|
254
261
|
import "./styles.css";
|
|
255
|
-
|
|
256
262
|
export const Button: React.FC<ButtonProps> = ({ label, variant = "primary", disabled, onClick }) => {
|
|
257
|
-
return
|
|
258
|
-
<button className={"krnl-btn krnl-btn--" + variant} disabled={disabled} onClick={onClick}>
|
|
259
|
-
{label}
|
|
260
|
-
</button>
|
|
261
|
-
);
|
|
263
|
+
return <button className={"krnl-btn krnl-btn--" + variant} disabled={disabled} onClick={onClick}>{label}</button>;
|
|
262
264
|
};
|
|
263
|
-
`
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
describe("Button component", () => {
|
|
286
|
-
it("defined correctly", () => {
|
|
287
|
-
expect(true).toBe(true);
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
`);
|
|
291
|
-
fs.writeFileSync(path.join(fEntityDir, "App0.tsx"), `import React from "react";
|
|
265
|
+
`
|
|
266
|
+
);
|
|
267
|
+
fs2.writeFileSync(
|
|
268
|
+
path2.join(fLibDir, "styles.css"),
|
|
269
|
+
`.krnl-btn { padding: 8px 16px; border-radius: 4px; font-weight: 600; cursor: pointer; }
|
|
270
|
+
.krnl-btn--primary { background: #38bdf8; color: #0f172a; }
|
|
271
|
+
`
|
|
272
|
+
);
|
|
273
|
+
fs2.writeFileSync(
|
|
274
|
+
path2.join(fLibDir, "manifest.json"),
|
|
275
|
+
JSON.stringify({ name: "ButtonConcepts", dependencies: { react: "^18.3.1" } }, null, 2)
|
|
276
|
+
);
|
|
277
|
+
fs2.writeFileSync(
|
|
278
|
+
path2.join(fLibDir, "tests", "Button.test.tsx"),
|
|
279
|
+
`import { describe, it, expect } from "vitest";
|
|
280
|
+
describe("Button component", () => { it("defined correctly", () => { expect(true).toBe(true); }); });
|
|
281
|
+
`
|
|
282
|
+
);
|
|
283
|
+
fs2.writeFileSync(
|
|
284
|
+
path2.join(fOrchDir, "App0.tsx"),
|
|
285
|
+
`import React from "react";
|
|
292
286
|
import { Button } from "../../libraries/ButtonConcepts/components.js";
|
|
293
|
-
|
|
294
287
|
export const App0: React.FC = () => {
|
|
295
288
|
return (
|
|
296
|
-
<div className="krnl-
|
|
289
|
+
<div className="krnl-app-view">
|
|
297
290
|
<h1>App View (Variant 0)</h1>
|
|
298
291
|
<Button label="Click Me" onClick={() => alert("Welcome to Krnl!")} />
|
|
299
292
|
</div>
|
|
300
293
|
);
|
|
301
294
|
};
|
|
302
|
-
|
|
303
295
|
export default App0;
|
|
304
|
-
`
|
|
305
|
-
fs.writeFileSync(path.join(fEntityDir, "tests", "App0.test.tsx"), `import { describe, it, expect } from "vitest";
|
|
306
|
-
|
|
307
|
-
describe("App0 Component", () => {
|
|
308
|
-
it("mounts variant 0", () => {
|
|
309
|
-
expect(true).toBe(true);
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
`);
|
|
313
|
-
fs.writeFileSync(path.join(fFuncDir, "Hello0.tsx"), `import React from "react";
|
|
314
|
-
|
|
315
|
-
export interface HelloProps {
|
|
316
|
-
greeting?: string;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export const Hello0: React.FC<HelloProps> = ({ greeting = "Hello World!" }) => {
|
|
320
|
-
return (
|
|
321
|
-
<div className="krnl-func-hello">
|
|
322
|
-
<p>{greeting}</p>
|
|
323
|
-
</div>
|
|
296
|
+
`
|
|
324
297
|
);
|
|
298
|
+
fs2.writeFileSync(
|
|
299
|
+
path2.join(fOrchDir, "tests", "App0.test.tsx"),
|
|
300
|
+
`import { describe, it, expect } from "vitest";
|
|
301
|
+
describe("App0 Component", () => { it("mounts variant 0", () => { expect(true).toBe(true); }); });
|
|
302
|
+
`
|
|
303
|
+
);
|
|
304
|
+
fs2.writeFileSync(
|
|
305
|
+
path2.join(fFuncDir, "Hello0.tsx"),
|
|
306
|
+
`import React from "react";
|
|
307
|
+
export interface HelloProps { greeting?: string; }
|
|
308
|
+
export const Hello0: React.FC<HelloProps> = ({ greeting = "Hello World!" }) => {
|
|
309
|
+
return <div className="krnl-func-hello"><p>{greeting}</p></div>;
|
|
325
310
|
};
|
|
326
|
-
|
|
327
311
|
export default Hello0;
|
|
328
|
-
`
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
"
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
312
|
+
`
|
|
313
|
+
);
|
|
314
|
+
fs2.writeFileSync(
|
|
315
|
+
path2.join(fFuncDir, "manifest.json"),
|
|
316
|
+
JSON.stringify({ name: "HelloUI", dependencies: { react: "^18.3.1" } }, null, 2)
|
|
317
|
+
);
|
|
318
|
+
fs2.writeFileSync(
|
|
319
|
+
path2.join(fFuncDir, "tests", "Hello0.test.tsx"),
|
|
320
|
+
`import { describe, it, expect } from "vitest";
|
|
321
|
+
describe("Hello0 Component", () => { it("renders correctly", () => { expect(true).toBe(true); }); });
|
|
322
|
+
`
|
|
323
|
+
);
|
|
324
|
+
fs2.writeFileSync(
|
|
325
|
+
path2.join(targetDir2, "docs", "HISTORY.md"),
|
|
326
|
+
`# ${projectName2} - Project History
|
|
336
327
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
328
|
+
Initialized Krnl symmetric architecture.
|
|
329
|
+
`
|
|
330
|
+
);
|
|
331
|
+
fs2.writeFileSync(
|
|
332
|
+
path2.join(targetDir2, ".krnl", "agent-state.json"),
|
|
333
|
+
JSON.stringify(
|
|
334
|
+
{
|
|
335
|
+
schemaVersion: "1.0.0",
|
|
336
|
+
turnsSinceLastAudit: 0,
|
|
337
|
+
auditCadenceThreshold: 5,
|
|
338
|
+
totalTurns: 0,
|
|
339
|
+
lastAudit: {
|
|
340
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
341
|
+
status: "INITIALIZED",
|
|
342
|
+
refactorsPerformed: [],
|
|
343
|
+
checksPassed: ["symmetric_planes", "concept_folders", "manifest_reconciliation"]
|
|
344
|
+
},
|
|
345
|
+
history: []
|
|
346
|
+
},
|
|
347
|
+
null,
|
|
348
|
+
2
|
|
349
|
+
)
|
|
350
|
+
);
|
|
351
|
+
}
|
|
345
352
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
353
|
+
// src/index.ts
|
|
354
|
+
var rawArg = process.argv[2] || "my-krnl-app";
|
|
355
|
+
var targetDir = path3.resolve(process.cwd(), rawArg);
|
|
356
|
+
var projectName = path3.basename(targetDir);
|
|
357
|
+
console.log(`
|
|
358
|
+
\u{1F680} [create-krnl] Scaffolding new Krnl project in: ${targetDir}
|
|
351
359
|
`);
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
history: []
|
|
364
|
-
}, null, 2));
|
|
360
|
+
if (fs3.existsSync(targetDir)) {
|
|
361
|
+
console.error(`\u274C Directory "${projectName}" already exists.`);
|
|
362
|
+
process.exit(1);
|
|
363
|
+
}
|
|
364
|
+
fs3.mkdirSync(targetDir, { recursive: true });
|
|
365
|
+
fs3.writeFileSync(path3.join(targetDir, "package.json"), getBasePackageJson(projectName));
|
|
366
|
+
fs3.writeFileSync(path3.join(targetDir, "tsconfig.json"), getTsConfig(projectName));
|
|
367
|
+
fs3.writeFileSync(path3.join(targetDir, `${projectName}.ts`), getAppEntrypoint(projectName));
|
|
368
|
+
scaffoldBackend(targetDir);
|
|
369
|
+
scaffoldFrontend(targetDir, projectName);
|
|
370
|
+
KrnlPackageReconciler.reconcile(targetDir, true);
|
|
365
371
|
console.log(`
|
|
366
372
|
\u{1F389} Project successfully scaffolded at: ${targetDir}`);
|
|
367
373
|
console.log(`
|