@xrystal/core 3.41.0 → 3.44.0

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 (38) hide show
  1. package/README.md +28 -24
  2. package/package.json +1 -1
  3. package/x/bin/commands/project.mjs +23 -10
  4. package/x/bin/commands/sync.mjs +1 -1
  5. package/x/bin/helpers/.generated/.generated-from +1 -0
  6. package/x/bin/helpers/.generated/seed-from-tmp.mjs +115 -0
  7. package/x/bin/helpers/.generated/tmp-schema.mjs +98 -14
  8. package/x/bin/helpers/banner.mjs +27 -26
  9. package/x/bin/helpers/build-config.mjs +78 -23
  10. package/x/bin/helpers/cli-identity.mjs +1 -1
  11. package/x/bin/helpers/package-defaults.mjs +11 -5
  12. package/x/bin/helpers/project-artifacts.mjs +101 -38
  13. package/x/bin/helpers/project-root.mjs +1 -1
  14. package/x/bin/helpers/seed-from-tmp.mjs +12 -64
  15. package/x/bin/helpers/tmp-layout.mjs +8 -4
  16. package/x/bin/helpers/tmp-schema.mjs +5 -0
  17. package/x/bin/helpers/toolchain-config.mjs +3 -2
  18. package/x/bin/paths.mjs +13 -2
  19. package/x/bin/scripts/publish-guard.mjs +36 -15
  20. package/x/bin/scripts/sync-cli-defaults.mjs +10 -15
  21. package/x/dist/utils/constants/defaults.json +6 -0
  22. package/x/dist/utils/constants/index.d.ts +7 -0
  23. package/x/dist/utils/constants/index.js +1 -1
  24. package/x/dist/utils/helpers/tmp/index.d.ts +2 -1
  25. package/x/dist/utils/helpers/tmp/index.js +1 -1
  26. package/x/dist/utils/helpers/tmp/runtime-tmp.js +1 -1
  27. package/x/dist/utils/helpers/tmp/seed-from-tmp.d.ts +2 -0
  28. package/x/dist/utils/helpers/tmp/seed-from-tmp.js +1 -1
  29. package/x/dist/utils/helpers/tmp/tmp-interpolate.d.ts +1 -0
  30. package/x/dist/utils/helpers/tmp/tmp-interpolate.js +1 -0
  31. package/x/dist/utils/helpers/tmp/tmp-schema.d.ts +12 -0
  32. package/x/dist/utils/helpers/tmp/tmp-schema.js +1 -1
  33. package/x/dist/utils/helpers/tmp/toolchain-heal.d.ts +46 -0
  34. package/x/dist/utils/helpers/tmp/toolchain-heal.js +2 -0
  35. package/x/dist/utils/models/enums/index.d.ts +10 -0
  36. package/x/dist/utils/models/enums/index.js +1 -1
  37. package/x/tmp.yml +7 -1
  38. package/x/bin/helpers/defaults.json +0 -28
@@ -2,6 +2,8 @@ import { execSync } from 'node:child_process'
2
2
  import fs from 'node:fs'
3
3
  import path from 'node:path'
4
4
 
5
+ import { packageDefaults } from '../helpers/package-defaults.mjs'
6
+
5
7
  export class PublishGuardError extends Error {
6
8
  constructor(message) {
7
9
  super(message)
@@ -9,6 +11,21 @@ export class PublishGuardError extends Error {
9
11
  }
10
12
  }
11
13
 
14
+ function distRelFromPackage(pkg) {
15
+ const main = String(pkg.main ?? '').replace(/^\.\//, '')
16
+ const match = main.match(/^(.+\/dist)\//)
17
+ if (match) return match[1]
18
+ return path.posix.join(packageDefaults.packageRootFolder, packageDefaults.layoutPaths.dist)
19
+ }
20
+
21
+ function resolveMainEntry(root, pkg) {
22
+ const main = String(pkg.main ?? '').replace(/^\.\//, '')
23
+ if (!main) {
24
+ throw new PublishGuardError('package.json main is empty')
25
+ }
26
+ return path.join(root, main)
27
+ }
28
+
12
29
  export function readPackage(root = process.cwd()) {
13
30
  return JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'))
14
31
  }
@@ -26,22 +43,23 @@ export function assertFilesListNoSource(pkg) {
26
43
 
27
44
  export function assertFilesListHasDist(pkg) {
28
45
  const files = Array.isArray(pkg.files) ? pkg.files : []
46
+ const distRel = distRelFromPackage(pkg)
29
47
  if (!files.some((entry) => String(entry).replace(/^\.\//, '').includes('dist'))) {
30
- throw new PublishGuardError('package.json files must include x/dist')
48
+ throw new PublishGuardError(`package.json files must include ${distRel}`)
31
49
  }
32
50
  }
33
51
 
34
52
  export function assertMainExportsPointToDist(pkg) {
35
53
  const main = String(pkg.main ?? '')
36
54
  if (!main.includes('/dist/')) {
37
- throw new PublishGuardError(`package.json main must point to x/dist (got ${main || 'empty'})`)
55
+ throw new PublishGuardError(`package.json main must point to dist (got ${main || 'empty'})`)
38
56
  }
39
57
  const exports = pkg.exports ?? {}
40
58
  for (const [key, value] of Object.entries(exports)) {
41
59
  if (key === './tsconfig.base.json') continue
42
60
  const target = typeof value === 'string' ? value : value?.default
43
61
  if (target && !String(target).includes('/dist/')) {
44
- throw new PublishGuardError(`exports[${key}] must point to x/dist (got ${target})`)
62
+ throw new PublishGuardError(`exports[${key}] must point to dist (got ${target})`)
45
63
  }
46
64
  }
47
65
  }
@@ -52,8 +70,8 @@ export function assertSourceAbsentOnDisk(root = process.cwd()) {
52
70
  }
53
71
  }
54
72
 
55
- export function countDistJs(root = process.cwd()) {
56
- const distDir = path.join(root, 'x', 'dist')
73
+ export function countDistJs(root = process.cwd(), pkg = readPackage(root)) {
74
+ const distDir = path.join(root, distRelFromPackage(pkg))
57
75
  if (!fs.existsSync(distDir)) return 0
58
76
  let count = 0
59
77
  const walk = (dir) => {
@@ -68,22 +86,25 @@ export function countDistJs(root = process.cwd()) {
68
86
  }
69
87
 
70
88
  export function assertDistTree(root = process.cwd(), minJs = 10) {
71
- const distIndex = path.join(root, 'x/dist/index.js')
72
- if (!fs.existsSync(distIndex)) {
73
- throw new PublishGuardError('x/dist/index.js missing — run build first')
89
+ const pkg = readPackage(root)
90
+ const entry = resolveMainEntry(root, pkg)
91
+ if (!fs.existsSync(entry)) {
92
+ throw new PublishGuardError(`${path.relative(root, entry) || entry} missing — run build first`)
74
93
  }
75
- const jsCount = countDistJs(root)
94
+ const jsCount = countDistJs(root, pkg)
76
95
  if (jsCount < minJs) {
77
- throw new PublishGuardError(`x/dist incomplete (${jsCount} .js files, need >= ${minJs})`)
96
+ throw new PublishGuardError(`dist incomplete (${jsCount} .js files, need >= ${minJs})`)
78
97
  }
79
98
  }
80
99
 
81
100
  export function assertDistMinified(root = process.cwd()) {
82
- const indexJs = fs.readFileSync(path.join(root, 'x/dist/index.js'), 'utf8')
101
+ const pkg = readPackage(root)
102
+ const entry = resolveMainEntry(root, pkg)
103
+ const indexJs = fs.readFileSync(entry, 'utf8')
83
104
  const lines = indexJs.split('\n').filter((line) => line.trim().length > 0)
84
105
  const looksReadable = lines.length > 3 && indexJs.includes("from './") && !indexJs.includes('from"')
85
106
  if (looksReadable) {
86
- throw new PublishGuardError('x/dist/index.js looks unminified — enable build.minify before publish')
107
+ throw new PublishGuardError(`${path.relative(root, entry)} looks unminified — enable build.minify before publish`)
87
108
  }
88
109
  }
89
110
 
@@ -92,8 +113,8 @@ export function assertNpmPackClean(root = process.cwd()) {
92
113
  if (/source\/.*\.ts/.test(dryRun) || /npm notice.*source\//.test(dryRun)) {
93
114
  throw new PublishGuardError('npm pack tarball lists source/ — TypeScript source must not ship')
94
115
  }
95
- if (!/x\/dist\/.*\.js/.test(dryRun)) {
96
- throw new PublishGuardError('npm pack tarball must include x/dist/**/*.js')
116
+ if (!/\/dist\/.*\.js/.test(dryRun)) {
117
+ throw new PublishGuardError('npm pack tarball must include dist/**/*.js')
97
118
  }
98
119
  return dryRun
99
120
  }
@@ -109,5 +130,5 @@ export function runPublishGuards(root = process.cwd(), { strictDisk = false } =
109
130
  assertSourceAbsentOnDisk(root)
110
131
  assertDistMinified(root)
111
132
  }
112
- return { pkg, jsCount: countDistJs(root) }
133
+ return { pkg, jsCount: countDistJs(root, pkg) }
113
134
  }
@@ -1,21 +1,16 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * Publish artifact only.
4
- * Authoring source of truth: source/utils/constants/defaults.json
5
- * Local CLI prefers the authored file; npm pack needs this copy under x/bin.
6
- */
7
- import fs from 'node:fs'
8
- import path from 'node:path'
2
+ import { syncCliRuntime } from '../helpers/project-artifacts.mjs'
9
3
 
10
4
  const root = process.cwd()
11
- const src = path.join(root, 'source/utils/constants/defaults.json')
12
- const dest = path.join(root, 'x/bin/helpers/defaults.json')
5
+ const result = syncCliRuntime(root, { force: process.argv.includes('--force') })
13
6
 
14
- if (!fs.existsSync(src)) {
15
- console.error('sync-cli-defaults: source/utils/constants/defaults.json missing')
16
- process.exit(1)
7
+ if (result.defaults.synced) {
8
+ console.log(`sync-cli-defaults: ${result.defaults.reason}`)
9
+ } else {
10
+ console.log(`sync-cli-defaults: ${result.defaults.reason ?? 'ok'}`)
17
11
  }
18
12
 
19
- fs.mkdirSync(path.dirname(dest), { recursive: true })
20
- fs.copyFileSync(src, dest)
21
- console.log('sync-cli-defaults: publish copy → x/bin/helpers/defaults.json')
13
+ for (const item of result.generated.results ?? []) {
14
+ const state = item.synced ? 'built' : (item.reason ?? 'ok')
15
+ console.log(`sync-cli-defaults: ${item.source} → ${state}`)
16
+ }
@@ -12,6 +12,12 @@
12
12
  "kafkaLogsTopic": "log",
13
13
  "pathAliasKey": "@/*",
14
14
  "eslintRestrictedImportDepth": 2,
15
+ "brand": {
16
+ "primary": "xrystal",
17
+ "secondary": "core",
18
+ "tagline": "microservice runtime library",
19
+ "capabilities": "loaders \u00b7 tmp.yml \u00b7 dto \u00b7 i18n \u00b7 multi-protocol \u00b7 scaffold"
20
+ },
15
21
  "tmpWatchDefaults": {
16
22
  "intervalMs": 500,
17
23
  "minIntervalMs": 100,
@@ -23,7 +23,14 @@ export declare class Constants {
23
23
  static readonly cliName: string;
24
24
  static readonly cliBinNames: string[] & readonly string[];
25
25
  static readonly pathAliasKey: string;
26
+ static readonly brand: {
27
+ primary: string;
28
+ secondary: string;
29
+ tagline: string;
30
+ capabilities: string;
31
+ };
26
32
  static readonly mainSourceFolder: string;
33
+ static readonly framework: string;
27
34
  static readonly layoutPaths: {
28
35
  tests: string;
29
36
  environments: string;
@@ -1 +1 @@
1
- import n from"node:path";import{packageRootDir as q}from"../../utils/package-root";import b from"./defaults.json" with { type: 'json' };import{seedFromTmp as j}from"../../utils/helpers/tmp/seed-from-tmp";export const packageDefaults=Object.freeze({...b,mainSourceFolder:j.sourceFolder,framework:j.framework,layoutPaths:Object.freeze({...j.layout}),buildDefaults:Object.freeze({...b.buildDefaults}),tmpWatchDefaults:Object.freeze({...b.tmpWatchDefaults}),cliBinNames:Object.freeze([...b.cliBinNames??[b.cliName]])}),coreVersionPattern=/^\d{2}\.\d{2}\.\d{2}-v\d+$/,semverVersionPattern=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?(?:\+[0-9A-Za-z-.]+)?$/;const v=`${packageDefaults.tmpBaseName}${packageDefaults.tmpExtension}`;export class Constants{static packageName=packageDefaults.packageName;static packageRootFolder=packageDefaults.packageRootFolder;static tmpBaseName=packageDefaults.tmpBaseName;static tmpExtension=packageDefaults.tmpExtension;static publicFolderName=packageDefaults.publicFolderName;static kafkaLogsTopic=packageDefaults.kafkaLogsTopic;static templateRepoUri=packageDefaults.templateRepoUri;static cliName=packageDefaults.cliName;static cliBinNames=packageDefaults.cliBinNames;static pathAliasKey=packageDefaults.pathAliasKey;static mainSourceFolder=packageDefaults.mainSourceFolder;static layoutPaths=packageDefaults.layoutPaths;static bundledCoreTmpPath=n.join(q,packageDefaults.packageRootFolder,v)}export{seedFromTmp,loadSeedFromBundledTmp}from"../../utils/helpers/tmp/seed-from-tmp";
1
+ import n from"node:path";import{packageRootDir as q}from"../../utils/package-root";import b from"./defaults.json" with { type: 'json' };import{seedFromTmp as j}from"../../utils/helpers/tmp/seed-from-tmp";export const packageDefaults=Object.freeze({...b,mainSourceFolder:j.sourceFolder,framework:j.framework,layoutPaths:Object.freeze({...j.layout}),brand:Object.freeze({...b.brand}),buildDefaults:Object.freeze({...b.buildDefaults}),tmpWatchDefaults:Object.freeze({...b.tmpWatchDefaults}),cliBinNames:Object.freeze([...b.cliBinNames??[b.cliName]])}),coreVersionPattern=/^\d{2}\.\d{2}\.\d{2}-v\d+$/,semverVersionPattern=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?(?:\+[0-9A-Za-z-.]+)?$/;const v=`${packageDefaults.tmpBaseName}${packageDefaults.tmpExtension}`;export class Constants{static packageName=packageDefaults.packageName;static packageRootFolder=packageDefaults.packageRootFolder;static tmpBaseName=packageDefaults.tmpBaseName;static tmpExtension=packageDefaults.tmpExtension;static publicFolderName=packageDefaults.publicFolderName;static kafkaLogsTopic=packageDefaults.kafkaLogsTopic;static templateRepoUri=packageDefaults.templateRepoUri;static cliName=packageDefaults.cliName;static cliBinNames=packageDefaults.cliBinNames;static pathAliasKey=packageDefaults.pathAliasKey;static brand=packageDefaults.brand;static mainSourceFolder=packageDefaults.mainSourceFolder;static framework=packageDefaults.framework;static layoutPaths=packageDefaults.layoutPaths;static bundledCoreTmpPath=n.join(q,packageDefaults.packageRootFolder,v)}export{seedFromTmp,loadSeedFromBundledTmp}from"../../utils/helpers/tmp/seed-from-tmp";
@@ -2,6 +2,7 @@ export { setRuntimeTmpConfigs, getRuntimeTmpConfigs, onRuntimeTmpChange, notifyR
2
2
  export { getTmpLoader, getTmpLoaderPath, getTmpSnapshot, onTmpReload, resetTmpLoaderForTests, stopTmpLoader, } from '../../../utils/helpers/tmp/tmp-loader';
3
3
  export { bindLoaderTmpSync, type ITmpSyncLoader, } from '../../../utils/helpers/tmp/loader-tmp-sync';
4
4
  export { resolveTmpWatchIntervalMs } from '../../../utils/helpers/tmp/tmp-watch';
5
- export { normalizeTmpDocument, normalizeRootFolder, normalizeSourceFolder, readTmpCoreBlock, readTmpServiceBlock, resolveServiceLayoutPaths, resolveTmpRuntimeConfigs, } from '../../../utils/helpers/tmp/tmp-schema';
5
+ export { normalizeTmpDocument, normalizeRootFolder, normalizeSourceFolder, normalizeRuntime, normalizeBundler, resolveEffectiveBundler, readTmpCoreBlock, readTmpServiceBlock, readTmpGlobalBlock, applyTmpGlobalVars, resolveServiceLayoutPaths, resolveTmpRuntimeConfigs, } from '../../../utils/helpers/tmp/tmp-schema';
6
6
  export { loadSeedFromBundledTmp, seedFromTmp, type SeedFromTmp, type SeedLayoutPaths, } from '../../../utils/helpers/tmp/seed-from-tmp';
7
7
  export { normalizeLayoutPaths, type LayoutPaths, } from '../../../utils/helpers/tmp/path-normalize';
8
+ export { healToolchainIfLayoutNeedsSync, layoutFingerprint, layoutOptionsFromRuntimeConfigs, resetToolchainHealState, writeTsconfigFromLayout, auditTsconfigAgainstLayout, type ToolchainHealResult, type ToolchainLayoutOptions, } from '../../../utils/helpers/tmp/toolchain-heal';
@@ -1 +1 @@
1
- export{setRuntimeTmpConfigs,getRuntimeTmpConfigs,onRuntimeTmpChange,notifyRuntimeTmpChange,clearRuntimeTmpConfigs}from"../../../utils/helpers/tmp/runtime-tmp";export{getTmpLoader,getTmpLoaderPath,getTmpSnapshot,onTmpReload,resetTmpLoaderForTests,stopTmpLoader}from"../../../utils/helpers/tmp/tmp-loader";export{bindLoaderTmpSync}from"../../../utils/helpers/tmp/loader-tmp-sync";export{resolveTmpWatchIntervalMs}from"../../../utils/helpers/tmp/tmp-watch";export{normalizeTmpDocument,normalizeRootFolder,normalizeSourceFolder,readTmpCoreBlock,readTmpServiceBlock,resolveServiceLayoutPaths,resolveTmpRuntimeConfigs}from"../../../utils/helpers/tmp/tmp-schema";export{loadSeedFromBundledTmp,seedFromTmp}from"../../../utils/helpers/tmp/seed-from-tmp";export{normalizeLayoutPaths}from"../../../utils/helpers/tmp/path-normalize";
1
+ export{setRuntimeTmpConfigs,getRuntimeTmpConfigs,onRuntimeTmpChange,notifyRuntimeTmpChange,clearRuntimeTmpConfigs}from"../../../utils/helpers/tmp/runtime-tmp";export{getTmpLoader,getTmpLoaderPath,getTmpSnapshot,onTmpReload,resetTmpLoaderForTests,stopTmpLoader}from"../../../utils/helpers/tmp/tmp-loader";export{bindLoaderTmpSync}from"../../../utils/helpers/tmp/loader-tmp-sync";export{resolveTmpWatchIntervalMs}from"../../../utils/helpers/tmp/tmp-watch";export{normalizeTmpDocument,normalizeRootFolder,normalizeSourceFolder,normalizeRuntime,normalizeBundler,resolveEffectiveBundler,readTmpCoreBlock,readTmpServiceBlock,readTmpGlobalBlock,applyTmpGlobalVars,resolveServiceLayoutPaths,resolveTmpRuntimeConfigs}from"../../../utils/helpers/tmp/tmp-schema";export{loadSeedFromBundledTmp,seedFromTmp}from"../../../utils/helpers/tmp/seed-from-tmp";export{normalizeLayoutPaths}from"../../../utils/helpers/tmp/path-normalize";export{healToolchainIfLayoutNeedsSync,layoutFingerprint,layoutOptionsFromRuntimeConfigs,resetToolchainHealState,writeTsconfigFromLayout,auditTsconfigAgainstLayout}from"../../../utils/helpers/tmp/toolchain-heal";
@@ -1 +1 @@
1
- let e;const i=[];export function setRuntimeTmpConfigs(n){e=n}export function getRuntimeTmpConfigs(){return e}export function onRuntimeTmpChange(n){i.push(n);return()=>{const t=i.indexOf(n);if(t>=0)i.splice(t,1)}}export async function notifyRuntimeTmpChange(n){if(n)e=n;const t=e;if(!t)return;for(const o of i)await o(t)}export function clearRuntimeTmpConfigs(){e=void 0;i.length=0}
1
+ import{healToolchainIfLayoutNeedsSync as z,resetToolchainHealState as A}from"../../../utils/helpers/tmp/toolchain-heal";let q;const v=[];export function setRuntimeTmpConfigs(j){q=j}export function getRuntimeTmpConfigs(){return q}export function onRuntimeTmpChange(j){v.push(j);return()=>{const b=v.indexOf(j);if(b>=0)v.splice(b,1)}}export async function notifyRuntimeTmpChange(j){if(j)q=j;const b=q;if(!b)return;if(b.rootFolderPath&&b.service?.paths)try{z(process.cwd(),b)}catch(k){const w=k instanceof Error?k.message:String(k);console.warn(`[xrystal] toolchain auto-sync skipped: ${w}`)}for(const k of v)await k(b)}export function clearRuntimeTmpConfigs(){q=void 0;v.length=0;A()}
@@ -1,4 +1,6 @@
1
+ import defaults from '../../../utils/constants/defaults.json';
1
2
  import { type LayoutPaths } from '../../../utils/helpers/tmp/path-normalize';
3
+ export { defaults as packageIdentityDefaults };
2
4
  export type SeedLayoutPaths = LayoutPaths;
3
5
  export type SeedFromTmp = {
4
6
  rootFolder: string;
@@ -1 +1 @@
1
- import K from"node:fs";import J from"node:path";import{fileURLToPath as V}from"node:url";import W from"yaml";import D from"../../../utils/constants/defaults.json" with { type: 'json' };import{normalizeRootFolder as X,normalizeSourceFolder as Y}from"../../../utils/helpers/tmp/path-normalize";const O=J.dirname(V(import.meta.url)),Q=`${D.tmpBaseName}${D.tmpExtension}`;function I(j,A){if(typeof j!=="string"||!j.trim())throw Error(`${D.packageName}: bundled tmp.yml missing ${A}`);return j.trim()}function Z(j){const A=j&&typeof j==="object"&&!Array.isArray(j)?j:{};return{tests:I(A.tests,"configs.service.paths.special.tests"),environments:I(A.environments,"configs.service.paths.special.environments"),dist:I(A.dist,"configs.service.paths.special.dist")}}function _(j){if(j){if(!K.existsSync(j))throw Error(`${D.packageName}: bundled tmp.yml missing at ${j}`);return j}const A=[O,process.cwd()];for(const H of A){let C=J.resolve(H);for(;;){const E=J.join(C,D.packageRootFolder,Q);if(K.existsSync(E))return E;const G=J.dirname(C);if(G===C)break;C=G}}throw Error(`${D.packageName}: bundled ${D.packageRootFolder}/${Q} not found from ${O}`)}export function loadSeedFromBundledTmp(j){const A=_(j),H=W.parse(K.readFileSync(A,"utf8")),C=H?.configs&&typeof H.configs==="object"?H.configs:{},E=C.service&&typeof C.service==="object"?C.service:{},G=E.paths&&typeof E.paths==="object"?E.paths:{},M=I(G.source,"configs.service.paths.source");return{rootFolder:X(G.root,D.packageRootFolder),sourceFolder:Y(M,M),framework:I(E.framework,"configs.service.framework"),layout:Z(G.special)}}export const seedFromTmp=loadSeedFromBundledTmp();
1
+ import J from"node:fs";import I from"node:path";import{fileURLToPath as Q}from"node:url";import V from"yaml";import defaults from"../../../utils/constants/defaults.json" with { type: 'json' };import{normalizeRootFolder as W,normalizeSourceFolder as X}from"../../../utils/helpers/tmp/path-normalize";export{defaults as packageIdentityDefaults};const M=I.dirname(Q(import.meta.url)),O=`${defaults.tmpBaseName}${defaults.tmpExtension}`;function H(j,A){if(typeof j!=="string"||!j.trim())throw Error(`${defaults.packageName}: bundled tmp.yml missing ${A}`);return j.trim()}function Y(j){const A=j&&typeof j==="object"&&!Array.isArray(j)?j:{};return{tests:H(A.tests,"configs.service.paths.special.tests"),environments:H(A.environments,"configs.service.paths.special.environments"),dist:H(A.dist,"configs.service.paths.special.dist")}}function Z(j){if(j){if(!J.existsSync(j))throw Error(`${defaults.packageName}: bundled tmp.yml missing at ${j}`);return j}const A=[M,process.cwd()];for(const G of A){let C=I.resolve(G);for(;;){const D=I.join(C,defaults.packageRootFolder,O);if(J.existsSync(D))return D;const E=I.dirname(C);if(E===C)break;C=E}}throw Error(`${defaults.packageName}: bundled ${defaults.packageRootFolder}/${O} not found from ${M}`)}export function loadSeedFromBundledTmp(j){const A=Z(j),G=V.parse(J.readFileSync(A,"utf8")),C=G?.configs&&typeof G.configs==="object"?G.configs:{},D=C.service&&typeof C.service==="object"?C.service:{},E=D.paths&&typeof D.paths==="object"?D.paths:{},K=H(E.source,"configs.service.paths.source");return{rootFolder:W(E.root,defaults.packageRootFolder),sourceFolder:X(K,K),framework:H(D.framework,"configs.service.framework"),layout:Y(E.special)}}export const seedFromTmp=loadSeedFromBundledTmp();
@@ -0,0 +1 @@
1
+ export declare function interpolateWithContext<T>(value: T, context: Record<string, unknown>): T;
@@ -0,0 +1 @@
1
+ import f from"handlebars";function e(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)}export function interpolateWithContext(r,n){if(typeof r==="string"){if(!r.includes("{{"))return r;return f.compile(r)(n)}if(Array.isArray(r))return r.map((t)=>interpolateWithContext(t,n));if(e(r)){const t={};for(const[i,o]of Object.entries(r))t[i]=interpolateWithContext(o,n);return t}return r}
@@ -1,3 +1,4 @@
1
+ import { BundlerEnum, RuntimeEnum } from '../../../utils/models/enums';
1
2
  export type TmpServiceSpecialPaths = {
2
3
  tests?: string;
3
4
  environments?: string;
@@ -21,12 +22,17 @@ export type TmpCoreBlock = {
21
22
  fileWatchIntervalMs?: number | string;
22
23
  };
23
24
  };
25
+ export type TmpGlobalBlock = {
26
+ runtime: RuntimeEnum;
27
+ vars: Record<string, unknown>;
28
+ };
24
29
  export type TmpLayoutPathsFlat = {
25
30
  tests: string;
26
31
  environments: string;
27
32
  dist: string;
28
33
  };
29
34
  export type TmpRuntimeConfigs = {
35
+ global: TmpGlobalBlock;
30
36
  service: TmpServiceBlock & {
31
37
  paths: Required<Pick<TmpServicePathsBlock, 'root' | 'source'>> & {
32
38
  special: TmpLayoutPathsFlat;
@@ -35,10 +41,16 @@ export type TmpRuntimeConfigs = {
35
41
  core: TmpCoreBlock;
36
42
  rootFolderPath: string;
37
43
  };
44
+ export declare function normalizeRuntime(value: unknown): RuntimeEnum;
45
+ export declare function normalizeBundler(value: unknown): BundlerEnum;
46
+ export declare function resolveEffectiveBundler(bundler: BundlerEnum, runtime: RuntimeEnum): Exclude<BundlerEnum, BundlerEnum.AUTO>;
38
47
  export declare function normalizeRootFolder(value?: string): string;
39
48
  export declare function normalizeSourceFolder(value?: string): string;
49
+ export declare function readTmpGlobalBlock(configs?: Record<string, unknown>): TmpGlobalBlock;
40
50
  export declare function readTmpCoreBlock(configs?: Record<string, unknown>): TmpCoreBlock;
41
51
  export declare function readTmpServiceBlock(configs?: Record<string, unknown>): TmpServiceBlock;
42
52
  export declare function resolveServiceLayoutPaths(service: TmpServiceBlock): TmpLayoutPathsFlat;
53
+ export declare function buildTmpVarContext(global: TmpGlobalBlock): Record<string, unknown>;
54
+ export declare function applyTmpGlobalVars(tmp: Record<string, unknown>): Record<string, unknown>;
43
55
  export declare function resolveTmpRuntimeConfigs(tmp?: Record<string, unknown> | null): TmpRuntimeConfigs;
44
56
  export declare function normalizeTmpDocument(tmp: Record<string, unknown>): Record<string, unknown>;
@@ -1 +1 @@
1
- import K from"../../../utils/constants/defaults.json" with { type: 'json' };import{seedFromTmp as G}from"../../../utils/helpers/tmp/seed-from-tmp";import{normalizeLayoutPaths as O,normalizeRootFolder as Q,normalizeSourceFolder as U}from"../../../utils/helpers/tmp/path-normalize";function A(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function X(j){if(typeof j==="number"||typeof j==="string")return j;return}export function normalizeRootFolder(j){return Q(j,K.packageRootFolder)}export function normalizeSourceFolder(j){return U(j,G.sourceFolder)}export function readTmpCoreBlock(j){const q=A(j?.core)?j.core:{},x=A(q.tmp)?q.tmp:{};return{tmp:{fileWatchIntervalMs:X(x.fileWatchIntervalMs)}}}export function readTmpServiceBlock(j){const q=A(j?.service)?j.service:{},x=A(q.paths)?q.paths:{},D=A(x.special)?x.special:{};let E=A(q.loaders)?{...q.loaders}:void 0,H=A(q.build)?q.build:void 0;if(E&&A(E.build)){const{build:J,...M}=E;E=M;if(!H&&A(J))H=J}return{name:typeof q.name==="string"?q.name:void 0,framework:typeof q.framework==="string"?q.framework:void 0,paths:{root:typeof x.root==="string"?x.root:void 0,source:typeof x.source==="string"?x.source:void 0,special:{tests:typeof D.tests==="string"?D.tests:void 0,environments:typeof D.environments==="string"?D.environments:void 0,dist:typeof D.dist==="string"?D.dist:void 0}},protocols:q.protocols,loaders:E,build:H}}export function resolveServiceLayoutPaths(j){return O(j.paths?.special,G.layout)}function Y(j){const q=resolveServiceLayoutPaths(j);return{name:j.name,framework:j.framework??G.framework,paths:{root:j.paths?.root??K.packageRootFolder,source:j.paths?.source??G.sourceFolder,special:q},protocols:j.protocols,loaders:j.loaders,build:j.build}}function Z(j){return{tmp:{fileWatchIntervalMs:j.tmp?.fileWatchIntervalMs}}}export function resolveTmpRuntimeConfigs(j){const q=A(j?.configs)?j.configs:{},x=readTmpServiceBlock(q),D=readTmpCoreBlock(q),E=Y(x);return{service:E,core:Z(D),rootFolderPath:normalizeRootFolder(E.paths.root)}}export function normalizeTmpDocument(j){return{...j,configs:resolveTmpRuntimeConfigs(j)}}
1
+ import X from"../../../utils/constants/defaults.json" with { type: 'json' };import{BundlerEnum as H,RuntimeEnum as O}from"../../../utils/models/enums";import{seedFromTmp as Q}from"../../../utils/helpers/tmp/seed-from-tmp";import{interpolateWithContext as Z}from"../../../utils/helpers/tmp/tmp-interpolate";import{normalizeLayoutPaths as _,normalizeRootFolder as $,normalizeSourceFolder as I}from"../../../utils/helpers/tmp/path-normalize";function D(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function x(j){if(typeof j==="number"||typeof j==="string")return j;return}export function normalizeRuntime(j){const q=typeof j==="string"?j.trim().toLowerCase():"";if(q===O.NODE)return O.NODE;if(q===O.BUN)return O.BUN;return O.BUN}export function normalizeBundler(j){const q=typeof j==="string"?j.trim().toLowerCase():"";if(q===H.TSC)return H.TSC;if(q===H.ESBUILD)return H.ESBUILD;if(q===H.BUN)return H.BUN;if(q===H.AUTO)return H.AUTO;return H.AUTO}export function resolveEffectiveBundler(j,q){if(j!==H.AUTO)return j;return q===O.NODE?H.TSC:H.BUN}export function normalizeRootFolder(j){return $(j,X.packageRootFolder)}export function normalizeSourceFolder(j){return I(j,Q.sourceFolder)}export function readTmpGlobalBlock(j){const q=D(j?.global)?j.global:{},A=D(q.vars)?q.vars:{};return{runtime:normalizeRuntime(q.runtime),vars:{...A}}}export function readTmpCoreBlock(j){const q=D(j?.core)?j.core:{},A=D(q.tmp)?q.tmp:{};return{tmp:{fileWatchIntervalMs:x(A.fileWatchIntervalMs)}}}export function readTmpServiceBlock(j){const q=D(j?.service)?j.service:{},A=D(q.paths)?q.paths:{},J=D(A.special)?A.special:{};let K=D(q.loaders)?{...q.loaders}:void 0,M=D(q.build)?q.build:void 0;if(K&&D(K.build)){const{build:U,...Y}=K;K=Y;if(!M&&D(U))M=U}return{name:typeof q.name==="string"?q.name:void 0,framework:typeof q.framework==="string"?q.framework:void 0,paths:{root:typeof A.root==="string"?A.root:void 0,source:typeof A.source==="string"?A.source:void 0,special:{tests:typeof J.tests==="string"?J.tests:void 0,environments:typeof J.environments==="string"?J.environments:void 0,dist:typeof J.dist==="string"?J.dist:void 0}},protocols:q.protocols,loaders:K,build:M}}export function resolveServiceLayoutPaths(j){return _(j.paths?.special,Q.layout)}function L(j){const q=resolveServiceLayoutPaths(j);return{name:j.name,framework:j.framework??Q.framework,paths:{root:j.paths?.root??X.packageRootFolder,source:j.paths?.source??Q.sourceFolder,special:q},protocols:j.protocols,loaders:j.loaders,build:j.build}}function N(j){return{tmp:{fileWatchIntervalMs:j.tmp?.fileWatchIntervalMs}}}export function buildTmpVarContext(j){return{...j.vars,runtime:j.runtime,global:j}}export function applyTmpGlobalVars(j){const q=D(j.configs)?j.configs:{},A=readTmpGlobalBlock(q);return Z(j,buildTmpVarContext(A))}export function resolveTmpRuntimeConfigs(j){const q=D(j?.configs)?j.configs:{},A=readTmpGlobalBlock(q),J=readTmpServiceBlock(q),K=readTmpCoreBlock(q),M=L(J);return{global:A,service:M,core:N(K),rootFolderPath:normalizeRootFolder(M.paths.root)}}export function normalizeTmpDocument(j){const q=applyTmpGlobalVars(j);return{...q,configs:resolveTmpRuntimeConfigs(q)}}
@@ -0,0 +1,46 @@
1
+ import type { TmpRuntimeConfigs } from '../../../utils/helpers/tmp/tmp-schema';
2
+ export type ToolchainLayoutOptions = {
3
+ rootFolderPath: string;
4
+ mainFolderPath: string;
5
+ pathsDist: string;
6
+ pathsTests: string;
7
+ };
8
+ export type ToolchainHealResult = {
9
+ healed: boolean;
10
+ reason?: 'bootstrap' | 'layout-changed';
11
+ tsconfigRel: string;
12
+ fingerprint: string;
13
+ };
14
+ export declare function layoutOptionsFromRuntimeConfigs(configs: TmpRuntimeConfigs): ToolchainLayoutOptions;
15
+ export declare function layoutFingerprint(options: ToolchainLayoutOptions): string;
16
+ export declare function resolveRecommendedTsconfig(options: ToolchainLayoutOptions): {
17
+ include: string[];
18
+ exclude: string[];
19
+ compilerOptions: {
20
+ baseUrl: string;
21
+ paths: {
22
+ [x: string]: string[];
23
+ };
24
+ rootDir: string;
25
+ outDir: string;
26
+ };
27
+ };
28
+ export declare function auditTsconfigAgainstLayout(root: string, options: ToolchainLayoutOptions, tsconfigRel?: string): {
29
+ ok: boolean;
30
+ missing: boolean;
31
+ notes: string[];
32
+ };
33
+ export declare function writeTsconfigFromLayout(root: string, options: ToolchainLayoutOptions, tsconfigRel?: string): {
34
+ wrote: boolean;
35
+ created: boolean;
36
+ abs: string;
37
+ };
38
+ /** Test/reset helper — clears in-memory layout fingerprint. */
39
+ export declare function resetToolchainHealState(): void;
40
+ /**
41
+ * Live pulse: sync tsconfig only when layout paths change, or once on bootstrap if already drifted.
42
+ * Non-path tmp edits do not rewrite toolchain files.
43
+ */
44
+ export declare function healToolchainIfLayoutNeedsSync(root: string, configs: TmpRuntimeConfigs, options?: {
45
+ quiet?: boolean;
46
+ }): ToolchainHealResult;
@@ -0,0 +1,2 @@
1
+ import N from"node:fs";import X from"node:path";import{packageDefaults as J}from"../../../utils/constants";import{normalizeSourceFolder as $}from"../../../utils/helpers/tmp/path-normalize";function Y(j){return String(j).replace(/^\.\//,"")}export function layoutOptionsFromRuntimeConfigs(j){const q=j.service?.paths,B=q?.special;return{rootFolderPath:j.rootFolderPath||J.packageRootFolder,mainFolderPath:$(q?.source,J.mainSourceFolder),pathsDist:B?.dist||J.layoutPaths.dist,pathsTests:B?.tests||J.layoutPaths.tests}}export function layoutFingerprint(j){return[j.rootFolderPath,Y(j.mainFolderPath),j.pathsDist,j.pathsTests].join("\x00")}export function resolveRecommendedTsconfig(j){const q=Y(j.mainFolderPath),B=j.rootFolderPath,H=J.pathAliasKey;return{include:[q],exclude:[`${B}/${j.pathsTests}`],compilerOptions:{baseUrl:".",paths:{[H]:[`${q}/*`]},rootDir:`./${q}`,outDir:`./${B}/${j.pathsDist}`}}}function A(j){const q=X.join(j,"package.json");if(!N.existsSync(q))return`${J.packageName}/tsconfig.base.json`;try{if(JSON.parse(N.readFileSync(q,"utf8")).name===J.packageName)return"./tsconfig.base.json"}catch{}return`${J.packageName}/tsconfig.base.json`}function C(j,q,B){const H=q.compilerOptions??{};return{...q,extends:q.extends??B,include:j.include,exclude:j.exclude,compilerOptions:{...H,baseUrl:j.compilerOptions.baseUrl,paths:j.compilerOptions.paths,rootDir:j.compilerOptions.rootDir,outDir:j.compilerOptions.outDir}}}export function auditTsconfigAgainstLayout(j,q,B=J.buildDefaults?.tsconfig??"tsconfig.json"){const H=X.join(j,B);if(!N.existsSync(H))return{ok:!1,missing:!0,notes:[`${B} missing`]};let I;try{I=JSON.parse(N.readFileSync(H,"utf8"))}catch{return{ok:!1,missing:!1,notes:[`${B} unreadable`]}}const G=resolveRecommendedTsconfig(q),M=[],U=I.compilerOptions??{},V=J.pathAliasKey;if(U.outDir!==G.compilerOptions.outDir)M.push("outDir drift");if(!(Array.isArray(I.include)?I.include.map(String):[]).some((_)=>Y(_)===G.include[0]))M.push("include drift");const Z=U.paths?.[V];if(JSON.stringify(Z)!==JSON.stringify(G.compilerOptions.paths[V]))M.push(`paths ${V} drift`);return{ok:M.length===0,missing:!1,notes:M}}export function writeTsconfigFromLayout(j,q,B=J.buildDefaults?.tsconfig??"tsconfig.json"){const H=X.join(j,B),I=!N.existsSync(H);let G={};if(!I)try{G=JSON.parse(N.readFileSync(H,"utf8"))}catch{G={}}const M=resolveRecommendedTsconfig(q),U=C(M,G,A(j));N.writeFileSync(H,`${JSON.stringify(U,null,2)}
2
+ `,"utf8");return{wrote:!0,created:I,abs:H}}let Q=null;export function resetToolchainHealState(){Q=null}export function healToolchainIfLayoutNeedsSync(j,q,B={}){const H=layoutOptionsFromRuntimeConfigs(q),I=layoutFingerprint(H),G=J.buildDefaults?.tsconfig??"tsconfig.json",M=auditTsconfigAgainstLayout(j,H,G);if(Q===null){Q=I;if(M.ok)return{healed:!1,tsconfigRel:G,fingerprint:I};writeTsconfigFromLayout(j,H,G);if(!B.quiet)console.info(`[${J.packageName}] toolchain auto-synced (${G}) — bootstrap layout drift`);return{healed:!0,reason:"bootstrap",tsconfigRel:G,fingerprint:I}}if(I===Q)return{healed:!1,tsconfigRel:G,fingerprint:I};Q=I;writeTsconfigFromLayout(j,H,G);if(!B.quiet)console.info(`[${J.packageName}] toolchain auto-synced (${G}) — tmp layout paths changed`);return{healed:!0,reason:"layout-changed",tsconfigRel:G,fingerprint:I}}
@@ -18,6 +18,16 @@ export declare enum FrameworkEnum {
18
18
  WEBSOCKET = "websocket",
19
19
  SOCKETIO = "socketio"
20
20
  }
21
+ export declare enum RuntimeEnum {
22
+ BUN = "bun",
23
+ NODE = "node"
24
+ }
25
+ export declare enum BundlerEnum {
26
+ AUTO = "auto",
27
+ BUN = "bun",
28
+ TSC = "tsc",
29
+ ESBUILD = "esbuild"
30
+ }
21
31
  export declare enum PolarityTypeEnum {
22
32
  NOTR = 0,
23
33
  POSITIVE = 1,
@@ -1 +1 @@
1
- export var NodeEnvEnum;(function(N){N.DEV="dev";N.TEST="test";N.PROD="prod"})(NodeEnvEnum||(NodeEnvEnum={}));export var ProtocolEnum;(function(N){N.HTTP="http";N.HTTPS="https";N.WEBSOCKET="ws";N.SOCKETIO="socketio";N.NONE="none"})(ProtocolEnum||(ProtocolEnum={}));export var FrameworkEnum;(function(N){N.EXPRESS="express";N.ELYSIA="elysia";N.NODE="node";N.FETCH="fetch";N.WEBSOCKET="websocket";N.SOCKETIO="socketio"})(FrameworkEnum||(FrameworkEnum={}));export var PolarityTypeEnum;(function(N){N[N.NOTR=0]="NOTR";N[N.POSITIVE=1]="POSITIVE";N[N.NEGATIVE=-1]="NEGATIVE"})(PolarityTypeEnum||(PolarityTypeEnum={}));export var LoggerLayerEnum;(function(N){N[N.CRITICAL=0]="CRITICAL";N[N.ERROR=1]="ERROR";N[N.WARN=2]="WARN";N[N.INFO=3]="INFO";N[N.HTTP=4]="HTTP";N[N.DEBUG=5]="DEBUG"})(LoggerLayerEnum||(LoggerLayerEnum={}));export var CountryCodeEnum;(function(N){N.EN="en";N.TR="tr"})(CountryCodeEnum||(CountryCodeEnum={}));export var CurrencyCodeEnum;(function(N){N.USD="usd";N.EUR="eur";N.TRY="try"})(CurrencyCodeEnum||(CurrencyCodeEnum={}));export var HttpMethodEnum;(function(N){N.POST="post";N.GET="get";N.PUT="put";N.DELETE="delete"})(HttpMethodEnum||(HttpMethodEnum={}));export var ContentTypeEnum;(function(N){N.applicationJson="application/json";N.applicationXWwwFormUrlencoded="application/x-www-form-urlencoded"})(ContentTypeEnum||(ContentTypeEnum={}));export var DeviceStatusEnum;(function(N){N[N.PENDING=0]="PENDING";N[N.OFFLINE=1]="OFFLINE";N[N.ONLINE=2]="ONLINE";N[N.CONNECTING=3]="CONNECTING";N[N.CONNECTED=4]="CONNECTED"})(DeviceStatusEnum||(DeviceStatusEnum={}));export var DevicePlatformEnum;(function(N){N.WEB="web";N.NATIVE="native";N.OTHER="other"})(DevicePlatformEnum||(DevicePlatformEnum={}));export var DeviceOSEnum;(function(N){N.ANDROID="android";N.IOS="ios";N.WINDOWS="windows";N.MACOS="macos";N.MACOSX="macosx";N.OTHER="other"})(DeviceOSEnum||(DeviceOSEnum={}));export var PriorityEnum;(function(N){N[N.HIGH=0]="HIGH";N[N.MEDIUM=1]="MEDIUM";N[N.LOW=2]="LOW"})(PriorityEnum||(PriorityEnum={}));export var PrivacyEnum;(function(N){N[N.PRIVATE=0]="PRIVATE";N[N.PUBLIC=1]="PUBLIC";N[N.ONLY_FRIENDS=2]="ONLY_FRIENDS"})(PrivacyEnum||(PrivacyEnum={}));export var TimezoneEnum;(function(N){N.UTC="UTC";N.EtcUTC="Etc/UTC";N.EtcGMT="Etc/GMT"})(TimezoneEnum||(TimezoneEnum={}));export var ModeEnum;(function(N){N.MONOLITIC="monolitic";N.MICRO_SERVICE="micro_service"})(ModeEnum||(ModeEnum={}));export var TokensEnum;(function(N){N.INTERNAL_API_TOKEN="internal_api_key";N.CSRF_TOKEN="csrf_token";N.ACCESS_TOKEN="access_token";N.REFRESH_TOKEN="refresh_token";N.REFERENCE_TOKEN="reference_token";N.PERSONAL_ACCESS_TOKEN="personal_access_token"})(TokensEnum||(TokensEnum={}));export var CoreClientsEnum;(function(N){N.BASE_API_CLIENT="base_client_name";N.SOAP_API_CLIENT="soap_api_client"})(CoreClientsEnum||(CoreClientsEnum={}));export var GStoreScopeEnum;(function(N){N.GLOBAL="global";N.RUN="run";N.CONTROLLER="controller"})(GStoreScopeEnum||(GStoreScopeEnum={}));export var EndpointResourceEnum;(function(N){N.EXAMPLE="example";N.FULL="full";N.SYSTEM="system";N.CLIENTS="clients";N.AUTH="auth";N.ACCOUNTS="accounts";N.USERS="users";N.TRANSACTIONS="transactions";N.NOTIFICATIONS="notifications";N.ADDRESSES="addresses";N.PAYMENTS="payments";N.COMMISSIONS_AND_TAXES="commissions-and-taxes";N.SUPPORTS="supports";N.INVOICES="invoices";N.FILES="files";N.TOKENS="tokens";N.WEBHOOKS="webhooks";N.OTHERS="others"})(EndpointResourceEnum||(EndpointResourceEnum={}));
1
+ export var NodeEnvEnum;(function(N){N.DEV="dev";N.TEST="test";N.PROD="prod"})(NodeEnvEnum||(NodeEnvEnum={}));export var ProtocolEnum;(function(N){N.HTTP="http";N.HTTPS="https";N.WEBSOCKET="ws";N.SOCKETIO="socketio";N.NONE="none"})(ProtocolEnum||(ProtocolEnum={}));export var FrameworkEnum;(function(N){N.EXPRESS="express";N.ELYSIA="elysia";N.NODE="node";N.FETCH="fetch";N.WEBSOCKET="websocket";N.SOCKETIO="socketio"})(FrameworkEnum||(FrameworkEnum={}));export var RuntimeEnum;(function(N){N.BUN="bun";N.NODE="node"})(RuntimeEnum||(RuntimeEnum={}));export var BundlerEnum;(function(N){N.AUTO="auto";N.BUN="bun";N.TSC="tsc";N.ESBUILD="esbuild"})(BundlerEnum||(BundlerEnum={}));export var PolarityTypeEnum;(function(N){N[N.NOTR=0]="NOTR";N[N.POSITIVE=1]="POSITIVE";N[N.NEGATIVE=-1]="NEGATIVE"})(PolarityTypeEnum||(PolarityTypeEnum={}));export var LoggerLayerEnum;(function(N){N[N.CRITICAL=0]="CRITICAL";N[N.ERROR=1]="ERROR";N[N.WARN=2]="WARN";N[N.INFO=3]="INFO";N[N.HTTP=4]="HTTP";N[N.DEBUG=5]="DEBUG"})(LoggerLayerEnum||(LoggerLayerEnum={}));export var CountryCodeEnum;(function(N){N.EN="en";N.TR="tr"})(CountryCodeEnum||(CountryCodeEnum={}));export var CurrencyCodeEnum;(function(N){N.USD="usd";N.EUR="eur";N.TRY="try"})(CurrencyCodeEnum||(CurrencyCodeEnum={}));export var HttpMethodEnum;(function(N){N.POST="post";N.GET="get";N.PUT="put";N.DELETE="delete"})(HttpMethodEnum||(HttpMethodEnum={}));export var ContentTypeEnum;(function(N){N.applicationJson="application/json";N.applicationXWwwFormUrlencoded="application/x-www-form-urlencoded"})(ContentTypeEnum||(ContentTypeEnum={}));export var DeviceStatusEnum;(function(N){N[N.PENDING=0]="PENDING";N[N.OFFLINE=1]="OFFLINE";N[N.ONLINE=2]="ONLINE";N[N.CONNECTING=3]="CONNECTING";N[N.CONNECTED=4]="CONNECTED"})(DeviceStatusEnum||(DeviceStatusEnum={}));export var DevicePlatformEnum;(function(N){N.WEB="web";N.NATIVE="native";N.OTHER="other"})(DevicePlatformEnum||(DevicePlatformEnum={}));export var DeviceOSEnum;(function(N){N.ANDROID="android";N.IOS="ios";N.WINDOWS="windows";N.MACOS="macos";N.MACOSX="macosx";N.OTHER="other"})(DeviceOSEnum||(DeviceOSEnum={}));export var PriorityEnum;(function(N){N[N.HIGH=0]="HIGH";N[N.MEDIUM=1]="MEDIUM";N[N.LOW=2]="LOW"})(PriorityEnum||(PriorityEnum={}));export var PrivacyEnum;(function(N){N[N.PRIVATE=0]="PRIVATE";N[N.PUBLIC=1]="PUBLIC";N[N.ONLY_FRIENDS=2]="ONLY_FRIENDS"})(PrivacyEnum||(PrivacyEnum={}));export var TimezoneEnum;(function(N){N.UTC="UTC";N.EtcUTC="Etc/UTC";N.EtcGMT="Etc/GMT"})(TimezoneEnum||(TimezoneEnum={}));export var ModeEnum;(function(N){N.MONOLITIC="monolitic";N.MICRO_SERVICE="micro_service"})(ModeEnum||(ModeEnum={}));export var TokensEnum;(function(N){N.INTERNAL_API_TOKEN="internal_api_key";N.CSRF_TOKEN="csrf_token";N.ACCESS_TOKEN="access_token";N.REFRESH_TOKEN="refresh_token";N.REFERENCE_TOKEN="reference_token";N.PERSONAL_ACCESS_TOKEN="personal_access_token"})(TokensEnum||(TokensEnum={}));export var CoreClientsEnum;(function(N){N.BASE_API_CLIENT="base_client_name";N.SOAP_API_CLIENT="soap_api_client"})(CoreClientsEnum||(CoreClientsEnum={}));export var GStoreScopeEnum;(function(N){N.GLOBAL="global";N.RUN="run";N.CONTROLLER="controller"})(GStoreScopeEnum||(GStoreScopeEnum={}));export var EndpointResourceEnum;(function(N){N.EXAMPLE="example";N.FULL="full";N.SYSTEM="system";N.CLIENTS="clients";N.AUTH="auth";N.ACCOUNTS="accounts";N.USERS="users";N.TRANSACTIONS="transactions";N.NOTIFICATIONS="notifications";N.ADDRESSES="addresses";N.PAYMENTS="payments";N.COMMISSIONS_AND_TAXES="commissions-and-taxes";N.SUPPORTS="supports";N.INVOICES="invoices";N.FILES="files";N.TOKENS="tokens";N.WEBHOOKS="webhooks";N.OTHERS="others"})(EndpointResourceEnum||(EndpointResourceEnum={}));
package/x/tmp.yml CHANGED
@@ -2,8 +2,13 @@ project:
2
2
  name: x
3
3
 
4
4
  configs:
5
+ global:
6
+ runtime: bun
7
+ vars:
8
+ xry: xry
9
+
5
10
  service:
6
- name: example-service
11
+ name: "{{xry}}-service"
7
12
  framework: elysia
8
13
 
9
14
  paths:
@@ -47,6 +52,7 @@ configs:
47
52
  controller:
48
53
 
49
54
  build:
55
+ bundler: auto
50
56
  typecheck: true
51
57
  minify: true
52
58
 
@@ -1,28 +0,0 @@
1
- {
2
- "packageName": "@xrystal/core",
3
- "packageRootFolder": "x",
4
- "cliName": "xry",
5
- "cliBinNames": [
6
- "xry"
7
- ],
8
- "tmpBaseName": "tmp",
9
- "tmpExtension": ".yml",
10
- "templateRepoUri": "https://github.com/xdloper/api-gpt-svc",
11
- "publicFolderName": "public",
12
- "kafkaLogsTopic": "log",
13
- "pathAliasKey": "@/*",
14
- "eslintRestrictedImportDepth": 2,
15
- "tmpWatchDefaults": {
16
- "intervalMs": 500,
17
- "minIntervalMs": 100,
18
- "maxIntervalMs": 10000
19
- },
20
- "buildDefaults": {
21
- "tsconfig": "tsconfig.json",
22
- "typecheck": false,
23
- "tscLenient": false,
24
- "declarations": false,
25
- "sourcemap": false,
26
- "minify": false
27
- }
28
- }