@soulbatical/tetra-core 0.2.4 → 0.2.6
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.
Potentially problematic release.
This version of @soulbatical/tetra-core might be problematic. Click here for more details.
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/shared/crypto/credentials.d.ts +17 -0
- package/dist/shared/crypto/credentials.d.ts.map +1 -1
- package/dist/shared/crypto/credentials.js +66 -0
- package/dist/shared/crypto/credentials.js.map +1 -1
- package/dist/shared/crypto/index.d.ts +1 -1
- package/dist/shared/crypto/index.d.ts.map +1 -1
- package/dist/shared/crypto/index.js +1 -1
- package/dist/shared/crypto/index.js.map +1 -1
- package/dist/shared/factories/QueryServiceFactory.d.ts +55 -30
- package/dist/shared/factories/QueryServiceFactory.d.ts.map +1 -1
- package/dist/shared/factories/QueryServiceFactory.js +51 -30
- package/dist/shared/factories/QueryServiceFactory.js.map +1 -1
- package/dist/shared/mcp/index.d.ts +1 -0
- package/dist/shared/mcp/index.d.ts.map +1 -1
- package/dist/shared/mcp/index.js.map +1 -1
- package/dist/shared/mcp/mcp-routes.d.ts +1 -1
- package/dist/shared/mcp/mcp-routes.js +1 -1
- package/dist/shared/mcp/tenant-context.d.ts +20 -5
- package/dist/shared/mcp/tenant-context.d.ts.map +1 -1
- package/dist/shared/mcp/tenant-context.js +30 -11
- package/dist/shared/mcp/tenant-context.js.map +1 -1
- package/dist/shared/mcp/types.d.ts +4 -0
- package/dist/shared/mcp/types.d.ts.map +1 -1
- package/dist/shared/meta-api/index.d.ts +20 -0
- package/dist/shared/meta-api/index.d.ts.map +1 -0
- package/dist/shared/meta-api/index.js +47 -0
- package/dist/shared/meta-api/index.js.map +1 -0
- package/dist/shared/services/TableQueryService.d.ts +4 -0
- package/dist/shared/services/TableQueryService.d.ts.map +1 -1
- package/dist/shared/services/TableQueryService.js +27 -0
- package/dist/shared/services/TableQueryService.js.map +1 -1
- package/dist/shared/storage/creative-urls.d.ts +14 -0
- package/dist/shared/storage/creative-urls.d.ts.map +1 -0
- package/dist/shared/storage/creative-urls.js +30 -0
- package/dist/shared/storage/creative-urls.js.map +1 -0
- package/dist/shared/storage/index.d.ts +1 -0
- package/dist/shared/storage/index.d.ts.map +1 -1
- package/dist/shared/storage/index.js +2 -0
- package/dist/shared/storage/index.js.map +1 -1
- package/dist/storage.d.ts +1 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -0
- package/dist/storage.js.map +1 -1
- package/package.json +3 -1
- package/scripts/postinstall.js +79 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tetra Core — Postinstall
|
|
5
|
+
*
|
|
6
|
+
* Automatically sets up quality infrastructure when tetra-core is installed
|
|
7
|
+
* in a consumer project. Runs tetra-setup (hooks, ci, config) so every
|
|
8
|
+
* Tetra project gets the full quality gate from day one.
|
|
9
|
+
*
|
|
10
|
+
* Skips in:
|
|
11
|
+
* - CI environments (CI=true, GITHUB_ACTIONS, etc.)
|
|
12
|
+
* - Docker builds (/.dockerenv)
|
|
13
|
+
* - The tetra monorepo itself
|
|
14
|
+
* - npm pack / npm publish
|
|
15
|
+
* - Non-interactive environments without a project
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { existsSync } from 'fs'
|
|
19
|
+
import { execSync } from 'child_process'
|
|
20
|
+
import { join, dirname } from 'path'
|
|
21
|
+
import { fileURLToPath } from 'url'
|
|
22
|
+
|
|
23
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
24
|
+
|
|
25
|
+
// ── Skip conditions ──
|
|
26
|
+
|
|
27
|
+
// CI environment
|
|
28
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI ||
|
|
29
|
+
process.env.JENKINS_HOME || process.env.CODEBUILD_BUILD_ID) {
|
|
30
|
+
process.exit(0)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Docker
|
|
34
|
+
if (existsSync('/.dockerenv')) {
|
|
35
|
+
process.exit(0)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// npm pack / publish (no project context)
|
|
39
|
+
if (process.env.npm_command === 'pack' || process.env.npm_command === 'publish') {
|
|
40
|
+
process.exit(0)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Inside the tetra monorepo itself
|
|
44
|
+
const projectRoot = process.env.INIT_CWD || process.cwd()
|
|
45
|
+
if (projectRoot.includes('/tetra/packages/') || projectRoot.endsWith('/tetra')) {
|
|
46
|
+
process.exit(0)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// No package.json = not a real project
|
|
50
|
+
if (!existsSync(join(projectRoot, 'package.json'))) {
|
|
51
|
+
process.exit(0)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── Run tetra-setup ──
|
|
55
|
+
|
|
56
|
+
// Check if tetra-setup is available
|
|
57
|
+
try {
|
|
58
|
+
const tetraSetupPath = join(projectRoot, 'node_modules', '.bin', 'tetra-setup')
|
|
59
|
+
if (!existsSync(tetraSetupPath)) {
|
|
60
|
+
// dev-toolkit not installed yet — will run on next install
|
|
61
|
+
process.exit(0)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log('')
|
|
65
|
+
console.log('🔧 Tetra Core — setting up quality infrastructure...')
|
|
66
|
+
console.log('')
|
|
67
|
+
|
|
68
|
+
// Run tetra-setup (hooks + ci + config), non-interactive
|
|
69
|
+
// Don't use --force to preserve existing customizations
|
|
70
|
+
execSync(`node "${tetraSetupPath}"`, {
|
|
71
|
+
cwd: projectRoot,
|
|
72
|
+
stdio: 'inherit',
|
|
73
|
+
timeout: 30000,
|
|
74
|
+
})
|
|
75
|
+
} catch (err) {
|
|
76
|
+
// Non-blocking — setup failure shouldn't break npm install
|
|
77
|
+
console.log('⚠️ Tetra setup encountered an issue (non-blocking)')
|
|
78
|
+
console.log(` Run 'npx tetra-setup' manually to complete setup`)
|
|
79
|
+
}
|