tnp-core 21.0.155 → 21.0.157

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.
Files changed (68) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/bin/start.js +1 -1
  3. package/browser/fesm2022/tnp-core-browser.mjs +74 -1
  4. package/browser/fesm2022/tnp-core-browser.mjs.map +1 -1
  5. package/browser/package.json +1 -1
  6. package/browser/types/tnp-core-browser.d.ts +24 -2
  7. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs +74 -1
  8. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs.map +1 -1
  9. package/browser-prod/package.json +1 -1
  10. package/browser-prod/types/tnp-core-browser-prod.d.ts +24 -2
  11. package/cli.backend.js +2 -2
  12. package/lib/build-info._auto-generated_.d.ts +1 -1
  13. package/lib/build-info._auto-generated_.js +1 -1
  14. package/lib/helpers.js +7 -7
  15. package/lib/helpers.js.map +1 -1
  16. package/lib/index.d.ts +1 -0
  17. package/lib/index.js +1 -0
  18. package/lib/index.js.map +1 -1
  19. package/lib/package.json +1 -1
  20. package/lib/taon-state-machine.d.ts +20 -0
  21. package/lib/taon-state-machine.js +54 -0
  22. package/lib/taon-state-machine.js.map +1 -0
  23. package/lib/taon-state-machine.test.d.ts +1 -0
  24. package/lib/utils-md-docs.d.ts +2 -0
  25. package/lib/utils-md-docs.js +25 -3
  26. package/lib/utils-md-docs.js.map +1 -1
  27. package/lib-esm/app.hosts.d.ts +2 -2
  28. package/lib-esm/app.hosts.js +4 -4
  29. package/lib-esm/app.js +1 -1
  30. package/lib-esm/app.js.map +1 -1
  31. package/lib-esm/cli.backend.d.ts +1 -1
  32. package/lib-esm/cli.backend.js +1 -1
  33. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  34. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  35. package/lib-esm/lib/helpers.js +7 -7
  36. package/lib-esm/lib/helpers.js.map +1 -1
  37. package/lib-esm/lib/index.d.ts +1 -0
  38. package/lib-esm/lib/index.js +1 -0
  39. package/lib-esm/lib/index.js.map +1 -1
  40. package/lib-esm/lib/taon-state-machine.d.ts +20 -0
  41. package/lib-esm/lib/taon-state-machine.js +50 -0
  42. package/lib-esm/lib/taon-state-machine.js.map +1 -0
  43. package/lib-esm/lib/utils-md-docs.d.ts +2 -0
  44. package/lib-esm/lib/utils-md-docs.js +25 -3
  45. package/lib-esm/lib/utils-md-docs.js.map +1 -1
  46. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  47. package/lib-prod/build-info._auto-generated_.js +1 -1
  48. package/lib-prod/helpers.js +7 -7
  49. package/lib-prod/helpers.js.map +1 -1
  50. package/lib-prod/index.d.ts +1 -0
  51. package/lib-prod/index.js +1 -0
  52. package/lib-prod/index.js.map +1 -1
  53. package/lib-prod/package.json +1 -1
  54. package/lib-prod/taon-state-machine.d.ts +20 -0
  55. package/lib-prod/taon-state-machine.js +50 -0
  56. package/lib-prod/taon-state-machine.js.map +1 -0
  57. package/lib-prod/utils-md-docs.d.ts +2 -0
  58. package/lib-prod/utils-md-docs.js +25 -3
  59. package/lib-prod/utils-md-docs.js.map +1 -1
  60. package/package.json +3 -2
  61. package/websql/fesm2022/tnp-core-websql.mjs +74 -1
  62. package/websql/fesm2022/tnp-core-websql.mjs.map +1 -1
  63. package/websql/package.json +1 -1
  64. package/websql/types/tnp-core-websql.d.ts +24 -2
  65. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs +74 -1
  66. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs.map +1 -1
  67. package/websql-prod/package.json +1 -1
  68. package/websql-prod/types/tnp-core-websql-prod.d.ts +24 -2
@@ -1,5 +1,5 @@
1
1
  {
2
- "commitHash": "37283904853b98225a936b3ce8f6218f06b0663c",
3
- "commitName": "refactor: cut tags proper full names",
4
- "commitDate": "21-08-2026 21:38:48"
2
+ "commitHash": "94558c47b9063bdde21f5f3aaae567dc739c1304",
3
+ "commitName": "feat: state machine current value observable",
4
+ "commitDate": "26-08-2026 00:33:19"
5
5
  }
package/bin/start.js CHANGED
@@ -1,4 +1,4 @@
1
- global.frameworkName = 'tnp-core';
1
+ global.frameworkName = 'tnp-core';
2
2
  Error.stackTraceLimit = 100;
3
3
  global.i0 = {
4
4
  defineInjectable: function () { }
@@ -13345,6 +13345,35 @@ var UtilsMdDocs;
13345
13345
  /* */
13346
13346
  /* */
13347
13347
  /* */
13348
+ /* */
13349
+ /* */
13350
+ /* */
13351
+ /* */
13352
+ /* */
13353
+ /* */
13354
+ /* */
13355
+ /* */
13356
+ /* */
13357
+ /* */
13358
+ /* */
13359
+ /* */
13360
+ /* */
13361
+ /* */
13362
+ /* */
13363
+ /* */
13364
+ /* */
13365
+ /* */
13366
+ /* */
13367
+ /* */
13368
+ /* */
13369
+ /* */
13370
+ /* */
13371
+ /* */
13372
+ /* */
13373
+ /* */
13374
+ /* */
13375
+ /* */
13376
+ /* */
13348
13377
  return (void 0);
13349
13378
  }
13350
13379
  UtilsMdDocs.getRenderImports = getRenderImports;
@@ -13420,6 +13449,50 @@ var UtilsMdDocs;
13420
13449
  //#endregion
13421
13450
  })(UtilsMdDocs || (UtilsMdDocs = {}));
13422
13451
 
13452
+ class TaonStateMachine {
13453
+ constructor(config) {
13454
+ this.config = config;
13455
+ this._currentValue = config.defaultValue;
13456
+ this.currentStateSubject = new BehaviorSubject(config.defaultValue);
13457
+ this.currentState$ = this.currentStateSubject.asObservable();
13458
+ }
13459
+ get debugMode() {
13460
+ return !!this.config?.debugMode;
13461
+ }
13462
+ get currentValue() {
13463
+ return this._currentValue;
13464
+ }
13465
+ canSet(nextStateRaw) {
13466
+ const nextState = this.config.modifyStateBeforeSetting?.(nextStateRaw, this._currentValue, this.debugMode) ?? nextStateRaw;
13467
+ if (!_.isMap(this.config.allowedStateMap)) {
13468
+ return true;
13469
+ }
13470
+ const allowed = this.config.allowedStateMap.get(this._currentValue) ?? [];
13471
+ return allowed.includes(nextState);
13472
+ }
13473
+ set(nextStateRaw) {
13474
+ const previousState = this._currentValue;
13475
+ const nextState = this.config.modifyStateBeforeSetting?.(nextStateRaw, previousState, this.debugMode) ?? nextStateRaw;
13476
+ if (_.isMap(this.config.allowedStateMap)) {
13477
+ const allowed = this.config.allowedStateMap.get(previousState) ?? [];
13478
+ if (!allowed.includes(nextState)) {
13479
+ const message = `Invalid state transition: ` +
13480
+ `${String(previousState)} -> ${String(nextState)}`;
13481
+ if (this.config.throwOnInvalidTransition) {
13482
+ throw new Error(message);
13483
+ }
13484
+ this.debugMode && console.warn(message);
13485
+ return false;
13486
+ }
13487
+ }
13488
+ this._currentValue = nextState;
13489
+ // Notify observers only after successful transition.
13490
+ this.currentStateSubject.next(nextState);
13491
+ void this.config.effect?.(nextState, previousState, this.debugMode);
13492
+ return true;
13493
+ }
13494
+ }
13495
+
13423
13496
  const jsoncFormattingOptions = {
13424
13497
  insertSpaces: true,
13425
13498
  tabSize: 2,
@@ -13951,5 +14024,5 @@ var index = {};
13951
14024
  * Generated bundle index. Do not edit.
13952
14025
  */
13953
14026
 
13954
- export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, ExecAsyncVscodeError, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, REGEX_REGION, TAGS, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsI18n, UtilsJson, UtilsMdDocs, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProgress, UtilsProjects, UtilsStdinStdoutLogger, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, axios, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, execAsyncVscode, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, micromatch, mkdirp, ncp, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonCutNextLineCut, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, taonSkipCut, tempFoldersName, tnpPackageName, updateJsoncContent, urlRepoTaon, urlRepoTaonContainers, win32Path };
14027
+ export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, ExecAsyncVscodeError, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, REGEX_REGION, TAGS, TaonStateMachine, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsI18n, UtilsJson, UtilsMdDocs, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProgress, UtilsProjects, UtilsStdinStdoutLogger, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, axios, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, execAsyncVscode, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, micromatch, mkdirp, ncp, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonCutNextLineCut, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, taonSkipCut, tempFoldersName, tnpPackageName, updateJsoncContent, urlRepoTaon, urlRepoTaonContainers, win32Path };
13955
14028
  //# sourceMappingURL=tnp-core-browser.mjs.map