@allstak/wizard 0.1.3 → 0.1.5
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/CHANGELOG.md +53 -1
- package/LICENSE +191 -0
- package/README.md +299 -47
- package/dist/api/http.d.ts +2 -0
- package/dist/api/http.d.ts.map +1 -1
- package/dist/api/http.js +6 -0
- package/dist/api/http.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/types.d.ts +3 -3
- package/dist/api/types.js +3 -3
- package/dist/certification/fixtures.d.ts +4 -0
- package/dist/certification/fixtures.d.ts.map +1 -0
- package/dist/certification/fixtures.js +109 -0
- package/dist/certification/fixtures.js.map +1 -0
- package/dist/certification/gates.d.ts +10 -0
- package/dist/certification/gates.d.ts.map +1 -0
- package/dist/certification/gates.js +20 -0
- package/dist/certification/gates.js.map +1 -0
- package/dist/certification/index.d.ts +6 -0
- package/dist/certification/index.d.ts.map +1 -0
- package/dist/certification/index.js +5 -0
- package/dist/certification/index.js.map +1 -0
- package/dist/certification/live-backend.d.ts +50 -0
- package/dist/certification/live-backend.d.ts.map +1 -0
- package/dist/certification/live-backend.js +422 -0
- package/dist/certification/live-backend.js.map +1 -0
- package/dist/certification/packages.d.ts +3 -0
- package/dist/certification/packages.d.ts.map +1 -0
- package/dist/certification/packages.js +49 -0
- package/dist/certification/packages.js.map +1 -0
- package/dist/certification/process.d.ts +8 -0
- package/dist/certification/process.d.ts.map +1 -0
- package/dist/certification/process.js +77 -0
- package/dist/certification/process.js.map +1 -0
- package/dist/certification/report.d.ts +3 -0
- package/dist/certification/report.d.ts.map +1 -0
- package/dist/certification/report.js +38 -0
- package/dist/certification/report.js.map +1 -0
- package/dist/certification/runner.d.ts +3 -0
- package/dist/certification/runner.d.ts.map +1 -0
- package/dist/certification/runner.js +299 -0
- package/dist/certification/runner.js.map +1 -0
- package/dist/certification/runtime.d.ts +11 -0
- package/dist/certification/runtime.d.ts.map +1 -0
- package/dist/certification/runtime.js +60 -0
- package/dist/certification/runtime.js.map +1 -0
- package/dist/certification/types.d.ts +73 -0
- package/dist/certification/types.d.ts.map +1 -0
- package/dist/certification/types.js +2 -0
- package/dist/certification/types.js.map +1 -0
- package/dist/cli.js +70 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/certify.d.ts +18 -0
- package/dist/commands/certify.d.ts.map +1 -0
- package/dist/commands/certify.js +27 -0
- package/dist/commands/certify.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +5 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +9 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/security-snapshot.d.ts +24 -0
- package/dist/commands/security-snapshot.d.ts.map +1 -0
- package/dist/commands/security-snapshot.js +113 -0
- package/dist/commands/security-snapshot.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/_scaffold.d.ts +2 -1
- package/dist/integrations/_scaffold.d.ts.map +1 -1
- package/dist/integrations/_scaffold.js +36 -13
- package/dist/integrations/_scaffold.js.map +1 -1
- package/dist/integrations/_simple-scaffold.d.ts +5 -2
- package/dist/integrations/_simple-scaffold.d.ts.map +1 -1
- package/dist/integrations/_simple-scaffold.js +3 -0
- package/dist/integrations/_simple-scaffold.js.map +1 -1
- package/dist/integrations/dotnet.d.ts.map +1 -1
- package/dist/integrations/dotnet.js +3 -0
- package/dist/integrations/dotnet.js.map +1 -1
- package/dist/integrations/expo/detect.d.ts +13 -0
- package/dist/integrations/expo/detect.d.ts.map +1 -0
- package/dist/integrations/expo/detect.js +38 -0
- package/dist/integrations/expo/detect.js.map +1 -0
- package/dist/integrations/expo/doctor.d.ts +6 -0
- package/dist/integrations/expo/doctor.d.ts.map +1 -0
- package/dist/integrations/expo/doctor.js +136 -0
- package/dist/integrations/expo/doctor.js.map +1 -0
- package/dist/integrations/expo/files.d.ts +15 -0
- package/dist/integrations/expo/files.d.ts.map +1 -0
- package/dist/integrations/expo/files.js +62 -0
- package/dist/integrations/expo/files.js.map +1 -0
- package/dist/integrations/expo/index.d.ts +24 -0
- package/dist/integrations/expo/index.d.ts.map +1 -0
- package/dist/integrations/expo/index.js +68 -0
- package/dist/integrations/expo/index.js.map +1 -0
- package/dist/integrations/expo/manifest.d.ts +3 -0
- package/dist/integrations/expo/manifest.d.ts.map +1 -0
- package/dist/integrations/expo/manifest.js +39 -0
- package/dist/integrations/expo/manifest.js.map +1 -0
- package/dist/integrations/expo/patch.d.ts +13 -0
- package/dist/integrations/expo/patch.d.ts.map +1 -0
- package/dist/integrations/expo/patch.js +215 -0
- package/dist/integrations/expo/patch.js.map +1 -0
- package/dist/integrations/expo/uninstall.d.ts +4 -0
- package/dist/integrations/expo/uninstall.d.ts.map +1 -0
- package/dist/integrations/expo/uninstall.js +77 -0
- package/dist/integrations/expo/uninstall.js.map +1 -0
- package/dist/integrations/expo.d.ts +8 -1
- package/dist/integrations/expo.d.ts.map +1 -1
- package/dist/integrations/expo.js +8 -11
- package/dist/integrations/expo.js.map +1 -1
- package/dist/integrations/fastify/detect.d.ts +3 -0
- package/dist/integrations/fastify/detect.d.ts.map +1 -0
- package/dist/integrations/fastify/detect.js +12 -0
- package/dist/integrations/fastify/detect.js.map +1 -0
- package/dist/integrations/fastify/doctor.d.ts +3 -0
- package/dist/integrations/fastify/doctor.d.ts.map +1 -0
- package/dist/integrations/fastify/doctor.js +81 -0
- package/dist/integrations/fastify/doctor.js.map +1 -0
- package/dist/integrations/fastify/files.d.ts +17 -0
- package/dist/integrations/fastify/files.d.ts.map +1 -0
- package/dist/integrations/fastify/files.js +51 -0
- package/dist/integrations/fastify/files.js.map +1 -0
- package/dist/integrations/fastify/index.d.ts +3 -0
- package/dist/integrations/fastify/index.d.ts.map +1 -0
- package/dist/integrations/fastify/index.js +47 -0
- package/dist/integrations/fastify/index.js.map +1 -0
- package/dist/integrations/fastify/manifest.d.ts +3 -0
- package/dist/integrations/fastify/manifest.d.ts.map +1 -0
- package/dist/integrations/fastify/manifest.js +34 -0
- package/dist/integrations/fastify/manifest.js.map +1 -0
- package/dist/integrations/fastify/patch.d.ts +27 -0
- package/dist/integrations/fastify/patch.d.ts.map +1 -0
- package/dist/integrations/fastify/patch.js +91 -0
- package/dist/integrations/fastify/patch.js.map +1 -0
- package/dist/integrations/fastify/uninstall.d.ts +4 -0
- package/dist/integrations/fastify/uninstall.d.ts.map +1 -0
- package/dist/integrations/fastify/uninstall.js +18 -0
- package/dist/integrations/fastify/uninstall.js.map +1 -0
- package/dist/integrations/fastify.d.ts +5 -1
- package/dist/integrations/fastify.d.ts.map +1 -1
- package/dist/integrations/fastify.js +5 -9
- package/dist/integrations/fastify.js.map +1 -1
- package/dist/integrations/flutter.d.ts.map +1 -1
- package/dist/integrations/flutter.js +3 -0
- package/dist/integrations/flutter.js.map +1 -1
- package/dist/integrations/go/index.d.ts +3 -0
- package/dist/integrations/go/index.d.ts.map +1 -0
- package/dist/integrations/go/index.js +199 -0
- package/dist/integrations/go/index.js.map +1 -0
- package/dist/integrations/go.d.ts.map +1 -1
- package/dist/integrations/go.js +5 -2
- package/dist/integrations/go.js.map +1 -1
- package/dist/integrations/java/index.d.ts +3 -0
- package/dist/integrations/java/index.d.ts.map +1 -0
- package/dist/integrations/java/index.js +472 -0
- package/dist/integrations/java/index.js.map +1 -0
- package/dist/integrations/java.d.ts.map +1 -1
- package/dist/integrations/java.js +5 -2
- package/dist/integrations/java.js.map +1 -1
- package/dist/integrations/js/manifest.d.ts.map +1 -1
- package/dist/integrations/js/manifest.js +3 -0
- package/dist/integrations/js/manifest.js.map +1 -1
- package/dist/integrations/nestjs/detect.d.ts +3 -0
- package/dist/integrations/nestjs/detect.d.ts.map +1 -0
- package/dist/integrations/nestjs/detect.js +12 -0
- package/dist/integrations/nestjs/detect.js.map +1 -0
- package/dist/integrations/nestjs/doctor.d.ts +3 -0
- package/dist/integrations/nestjs/doctor.d.ts.map +1 -0
- package/dist/integrations/nestjs/doctor.js +76 -0
- package/dist/integrations/nestjs/doctor.js.map +1 -0
- package/dist/integrations/nestjs/files.d.ts +18 -0
- package/dist/integrations/nestjs/files.d.ts.map +1 -0
- package/dist/integrations/nestjs/files.js +39 -0
- package/dist/integrations/nestjs/files.js.map +1 -0
- package/dist/integrations/nestjs/index.d.ts +3 -0
- package/dist/integrations/nestjs/index.d.ts.map +1 -0
- package/dist/integrations/nestjs/index.js +43 -0
- package/dist/integrations/nestjs/index.js.map +1 -0
- package/dist/integrations/nestjs/manifest.d.ts +3 -0
- package/dist/integrations/nestjs/manifest.d.ts.map +1 -0
- package/dist/integrations/nestjs/manifest.js +32 -0
- package/dist/integrations/nestjs/manifest.js.map +1 -0
- package/dist/integrations/nestjs/patch.d.ts +25 -0
- package/dist/integrations/nestjs/patch.d.ts.map +1 -0
- package/dist/integrations/nestjs/patch.js +66 -0
- package/dist/integrations/nestjs/patch.js.map +1 -0
- package/dist/integrations/nestjs/uninstall.d.ts +4 -0
- package/dist/integrations/nestjs/uninstall.d.ts.map +1 -0
- package/dist/integrations/nestjs/uninstall.js +18 -0
- package/dist/integrations/nestjs/uninstall.js.map +1 -0
- package/dist/integrations/nestjs.d.ts +5 -1
- package/dist/integrations/nestjs.d.ts.map +1 -1
- package/dist/integrations/nestjs.js +5 -9
- package/dist/integrations/nestjs.js.map +1 -1
- package/dist/integrations/next/index.js +2 -2
- package/dist/integrations/next/index.js.map +1 -1
- package/dist/integrations/next/manifest.d.ts.map +1 -1
- package/dist/integrations/next/manifest.js +4 -1
- package/dist/integrations/next/manifest.js.map +1 -1
- package/dist/integrations/next/patch.js +8 -3
- package/dist/integrations/next/patch.js.map +1 -1
- package/dist/integrations/next/uninstall.d.ts.map +1 -1
- package/dist/integrations/next/uninstall.js +10 -1
- package/dist/integrations/next/uninstall.js.map +1 -1
- package/dist/integrations/otel.d.ts.map +1 -1
- package/dist/integrations/otel.js +4 -1
- package/dist/integrations/otel.js.map +1 -1
- package/dist/integrations/php.d.ts.map +1 -1
- package/dist/integrations/php.js +16 -3
- package/dist/integrations/php.js.map +1 -1
- package/dist/integrations/python/index.d.ts +3 -0
- package/dist/integrations/python/index.d.ts.map +1 -0
- package/dist/integrations/python/index.js +222 -0
- package/dist/integrations/python/index.js.map +1 -0
- package/dist/integrations/python.d.ts.map +1 -1
- package/dist/integrations/python.js +5 -2
- package/dist/integrations/python.js.map +1 -1
- package/dist/integrations/react/doctor.d.ts.map +1 -1
- package/dist/integrations/react/doctor.js +41 -8
- package/dist/integrations/react/doctor.js.map +1 -1
- package/dist/integrations/react/index.d.ts.map +1 -1
- package/dist/integrations/react/index.js +1 -4
- package/dist/integrations/react/index.js.map +1 -1
- package/dist/integrations/react/manifest.d.ts.map +1 -1
- package/dist/integrations/react/manifest.js +4 -1
- package/dist/integrations/react/manifest.js.map +1 -1
- package/dist/integrations/react/patch.d.ts.map +1 -1
- package/dist/integrations/react/patch.js +120 -8
- package/dist/integrations/react/patch.js.map +1 -1
- package/dist/integrations/react/uninstall.d.ts.map +1 -1
- package/dist/integrations/react/uninstall.js +20 -1
- package/dist/integrations/react/uninstall.js.map +1 -1
- package/dist/integrations/react-native.d.ts.map +1 -1
- package/dist/integrations/react-native.js +3 -0
- package/dist/integrations/react-native.js.map +1 -1
- package/dist/integrations/ruby.d.ts.map +1 -1
- package/dist/integrations/ruby.js +3 -0
- package/dist/integrations/ruby.js.map +1 -1
- package/dist/output/human.d.ts.map +1 -1
- package/dist/output/human.js +38 -7
- package/dist/output/human.js.map +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +9 -23
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest.d.ts +8 -0
- package/dist/registry/manifest.d.ts.map +1 -1
- package/dist/security-snapshot/builder.d.ts +3 -0
- package/dist/security-snapshot/builder.d.ts.map +1 -0
- package/dist/security-snapshot/builder.js +343 -0
- package/dist/security-snapshot/builder.js.map +1 -0
- package/dist/security-snapshot/client.d.ts +3 -0
- package/dist/security-snapshot/client.d.ts.map +1 -0
- package/dist/security-snapshot/client.js +38 -0
- package/dist/security-snapshot/client.js.map +1 -0
- package/dist/security-snapshot/index.d.ts +4 -0
- package/dist/security-snapshot/index.d.ts.map +1 -0
- package/dist/security-snapshot/index.js +3 -0
- package/dist/security-snapshot/index.js.map +1 -0
- package/dist/security-snapshot/types.d.ts +57 -0
- package/dist/security-snapshot/types.d.ts.map +1 -0
- package/dist/security-snapshot/types.js +2 -0
- package/dist/security-snapshot/types.js.map +1 -0
- package/dist/sourcemaps/next.js +3 -3
- package/dist/sourcemaps/next.js.map +1 -1
- package/dist/sourcemaps/vite.d.ts.map +1 -1
- package/dist/sourcemaps/vite.js +92 -9
- package/dist/sourcemaps/vite.js.map +1 -1
- package/dist/util/wizard-version.d.ts +1 -1
- package/dist/util/wizard-version.js +1 -1
- package/docs/architecture/v02-java-host-fix-spec.md +4 -8
- package/docs/architecture/v02-sourcemaps-e2e-spec.md +1 -1
- package/docs/beta/README.md +17 -0
- package/docs/beta/ci.md +122 -0
- package/docs/beta/config.md +124 -0
- package/docs/beta/doctor.md +79 -0
- package/docs/beta/expo.md +69 -0
- package/docs/beta/fastify.md +62 -0
- package/docs/beta/known-limitations.md +93 -0
- package/docs/beta/nestjs.md +69 -0
- package/docs/beta/next.md +76 -0
- package/docs/beta/node.md +60 -0
- package/docs/beta/privacy.md +99 -0
- package/docs/beta/quickstart.md +89 -0
- package/docs/beta/react.md +91 -0
- package/docs/beta/reliability.md +33 -0
- package/docs/beta/restore.md +84 -0
- package/docs/beta/troubleshooting.md +133 -0
- package/docs/errors.md +88 -0
- package/package.json +23 -5
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { locateNestEntry } from './files.js';
|
|
4
|
+
const PKG = '@allstak/nestjs';
|
|
5
|
+
export async function doctorNestjs(ctx) {
|
|
6
|
+
const checks = [];
|
|
7
|
+
const pj = ctx.detected.packageJson;
|
|
8
|
+
const installed = !!(pj?.dependencies?.[PKG] ?? pj?.devDependencies?.[PKG]);
|
|
9
|
+
checks.push({
|
|
10
|
+
name: 'sdk-installed',
|
|
11
|
+
status: installed ? 'pass' : 'fail',
|
|
12
|
+
detail: installed ? PKG : `${PKG} is not in dependencies`,
|
|
13
|
+
fix: installed ? undefined : 'Run: allstak-wizard -i nestjs',
|
|
14
|
+
});
|
|
15
|
+
const envPath = resolve(ctx.projectRoot, '.env');
|
|
16
|
+
const envOk = existsSync(envPath) && readFileSync(envPath, 'utf8').includes('ALLSTAK_API_KEY');
|
|
17
|
+
checks.push({
|
|
18
|
+
name: 'env-vars',
|
|
19
|
+
status: envOk ? 'pass' : 'warn',
|
|
20
|
+
detail: envOk ? '.env has ALLSTAK_API_KEY' : 'ALLSTAK_API_KEY not found in .env',
|
|
21
|
+
});
|
|
22
|
+
const main = pj?.scripts?.start ?? '';
|
|
23
|
+
const explicit = /node\s+([^\s&]+)/.exec(main)?.[1] ?? null;
|
|
24
|
+
const entry = locateNestEntry(ctx.projectRoot, explicit);
|
|
25
|
+
if (entry) {
|
|
26
|
+
const src = readFileSync(entry, 'utf8');
|
|
27
|
+
const hasImport = /AllStakNestExceptionFilter/.test(src);
|
|
28
|
+
const hasBlock = /allstak-wizard:/.test(src);
|
|
29
|
+
checks.push({
|
|
30
|
+
name: 'entry-import',
|
|
31
|
+
status: hasImport ? 'pass' : 'fail',
|
|
32
|
+
detail: hasImport ? entry : `${entry} does not import @allstak/nestjs`,
|
|
33
|
+
fix: hasImport ? undefined : 'Run: allstak-wizard repair -i nestjs',
|
|
34
|
+
});
|
|
35
|
+
checks.push({
|
|
36
|
+
name: 'entry-hint',
|
|
37
|
+
status: hasBlock ? 'pass' : 'warn',
|
|
38
|
+
detail: hasBlock ? 'managed-block hint present' : 'managed-block hint missing',
|
|
39
|
+
});
|
|
40
|
+
// Tell the user that the registration call itself is THEIR responsibility.
|
|
41
|
+
// Strip line comments so we don't match the managed-block hint that
|
|
42
|
+
// *demonstrates* the call inside `//` comments.
|
|
43
|
+
const liveSrc = src.replace(/^\s*\/\/.*$/gm, '');
|
|
44
|
+
const callPresent = /useGlobalFilters\([^)]*AllStakNestExceptionFilter/.test(liveSrc) ||
|
|
45
|
+
/useGlobalInterceptors\([^)]*AllStakNestInterceptor/.test(liveSrc);
|
|
46
|
+
checks.push({
|
|
47
|
+
name: 'filter-registered',
|
|
48
|
+
status: callPresent ? 'pass' : 'warn',
|
|
49
|
+
detail: callPresent
|
|
50
|
+
? 'app.useGlobalFilters / useGlobalInterceptors invokes the AllStak hooks'
|
|
51
|
+
: 'No app.useGlobalFilters(new AllStakNestExceptionFilter(...)) detected — wire it manually per the managed-block hint',
|
|
52
|
+
fix: callPresent ? undefined : 'See managed-block in your entry file or docs/beta/nestjs.md',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
checks.push({
|
|
57
|
+
name: 'entry-detected',
|
|
58
|
+
status: 'fail',
|
|
59
|
+
detail: 'No src/main.ts (or package.json:scripts.start node entry) found',
|
|
60
|
+
fix: 'Confirm this is a NestJS project; standard entry is src/main.ts',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// Source maps — explicitly NOT wired by wizard for Nest. Skip, don't fail.
|
|
64
|
+
checks.push({
|
|
65
|
+
name: 'source-maps',
|
|
66
|
+
status: 'skip',
|
|
67
|
+
detail: 'Nest source-map upload not wired by wizard in v0.1 (deferred to v0.2).',
|
|
68
|
+
});
|
|
69
|
+
const summary = checks.some((c) => c.status === 'fail')
|
|
70
|
+
? 'broken'
|
|
71
|
+
: checks.some((c) => c.status === 'warn')
|
|
72
|
+
? 'degraded'
|
|
73
|
+
: 'ok';
|
|
74
|
+
return { integration: 'nestjs', checks, summary };
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/integrations/nestjs/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAE9B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAkB;IACnD,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;IAEpC,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5E,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QACnC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,yBAAyB;QACzD,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B;KAC7D,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC/F,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE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|
1
|
+
/**
|
|
2
|
+
* Locator helpers for NestJS projects.
|
|
3
|
+
*
|
|
4
|
+
* Convention: Nest CLI scaffolds `src/main.ts` as the bootstrap entry. We
|
|
5
|
+
* accept `.js` too for projects that compile ahead of time. Pre-Nest-9
|
|
6
|
+
* projects sometimes use `src/index.ts` — we honor `package.json:main`
|
|
7
|
+
* before falling through to the conventional path.
|
|
8
|
+
*/
|
|
9
|
+
export declare function locateNestEntry(projectRoot: string, packageJsonMain?: string | null): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Read `nest-cli.json` if present so `doctor` can tell users when their
|
|
12
|
+
* Nest setup deviates from convention. Pure-data; no validation.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readNestCli(projectRoot: string): {
|
|
15
|
+
sourceRoot?: string;
|
|
16
|
+
entryFile?: string;
|
|
17
|
+
} | null;
|
|
18
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/integrations/nestjs/files.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAUnG;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQnG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Locator helpers for NestJS projects.
|
|
5
|
+
*
|
|
6
|
+
* Convention: Nest CLI scaffolds `src/main.ts` as the bootstrap entry. We
|
|
7
|
+
* accept `.js` too for projects that compile ahead of time. Pre-Nest-9
|
|
8
|
+
* projects sometimes use `src/index.ts` — we honor `package.json:main`
|
|
9
|
+
* before falling through to the conventional path.
|
|
10
|
+
*/
|
|
11
|
+
export function locateNestEntry(projectRoot, packageJsonMain) {
|
|
12
|
+
if (packageJsonMain) {
|
|
13
|
+
const explicit = resolve(projectRoot, packageJsonMain);
|
|
14
|
+
if (existsSync(explicit))
|
|
15
|
+
return explicit;
|
|
16
|
+
}
|
|
17
|
+
for (const c of ['src/main.ts', 'src/main.js', 'src/main.mts', 'src/index.ts']) {
|
|
18
|
+
const full = resolve(projectRoot, c);
|
|
19
|
+
if (existsSync(full))
|
|
20
|
+
return full;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read `nest-cli.json` if present so `doctor` can tell users when their
|
|
26
|
+
* Nest setup deviates from convention. Pure-data; no validation.
|
|
27
|
+
*/
|
|
28
|
+
export function readNestCli(projectRoot) {
|
|
29
|
+
const path = resolve(projectRoot, 'nest-cli.json');
|
|
30
|
+
if (!existsSync(path))
|
|
31
|
+
return null;
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/integrations/nestjs/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;GAOG;AAEH,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,eAA+B;IAClF,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACvD,IAAI,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,QAAQ,CAAC;IAC5C,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC;QAC/E,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACrC,IAAI,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB;IAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAgD,CAAC;IAC/F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/nestjs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAS3D,eAAO,MAAM,iBAAiB,EAAE,WA0C/B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { runPackageInstall } from '../_shared.js';
|
|
2
|
+
import { nestjsManifest } from './manifest.js';
|
|
3
|
+
import { detectNestjs } from './detect.js';
|
|
4
|
+
import { patchNestjs } from './patch.js';
|
|
5
|
+
import { uninstallNestjs } from './uninstall.js';
|
|
6
|
+
import { doctorNestjs } from './doctor.js';
|
|
7
|
+
import { locateNestEntry } from './files.js';
|
|
8
|
+
export const nestjsIntegration = {
|
|
9
|
+
id: 'nestjs',
|
|
10
|
+
manifest: nestjsManifest,
|
|
11
|
+
async detect(ctx) {
|
|
12
|
+
return detectNestjs(ctx);
|
|
13
|
+
},
|
|
14
|
+
async plan(ctx) {
|
|
15
|
+
const lines = [];
|
|
16
|
+
lines.push(`install ${nestjsManifest.sdkPackage} (${ctx.pm})`);
|
|
17
|
+
lines.push(`write ALLSTAK_* to .env`);
|
|
18
|
+
const main = ctx.detected.packageJson?.scripts?.start ?? '';
|
|
19
|
+
const explicit = /node\s+([^\s&]+)/.exec(main)?.[1] ?? null;
|
|
20
|
+
const entry = locateNestEntry(ctx.projectRoot, explicit);
|
|
21
|
+
lines.push(entry ? `patch entry: ${entry}` : `no Nest entry (src/main.ts) detected — config-only run`);
|
|
22
|
+
return lines;
|
|
23
|
+
},
|
|
24
|
+
async install(ctx) {
|
|
25
|
+
await runPackageInstall(ctx, [nestjsManifest.sdkPackage]);
|
|
26
|
+
},
|
|
27
|
+
async patch(ctx, tx) {
|
|
28
|
+
await patchNestjs(ctx, tx);
|
|
29
|
+
},
|
|
30
|
+
async validate(ctx) {
|
|
31
|
+
return doctorNestjs(ctx);
|
|
32
|
+
},
|
|
33
|
+
async uninstall(ctx, tx) {
|
|
34
|
+
await uninstallNestjs(ctx, tx);
|
|
35
|
+
},
|
|
36
|
+
async repair(ctx, tx) {
|
|
37
|
+
await patchNestjs(ctx, tx);
|
|
38
|
+
},
|
|
39
|
+
async doctor(ctx) {
|
|
40
|
+
return doctorNestjs(ctx);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/nestjs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C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EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAG;QAChB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE;QACrB,MAAM,eAAe,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE;QAClB,MAAM,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/integrations/nestjs/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,eAAO,MAAM,cAAc,EAAE,mBA+B5B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const nestjsManifest = {
|
|
2
|
+
id: 'nestjs',
|
|
3
|
+
title: 'NestJS (managed bootstrap)',
|
|
4
|
+
sdkPackage: '@allstak/nestjs',
|
|
5
|
+
additionalPackages: [],
|
|
6
|
+
stability: 'experimental',
|
|
7
|
+
runtimeStatus: 'experimental',
|
|
8
|
+
wizardAutomation: 'experimental',
|
|
9
|
+
public: false,
|
|
10
|
+
stabilityNote: 'Internal experimental only. AST-injects imports and appends a managed-block hint, but does not auto-register filters/interceptors. Runtime SDK fail-open is verified; wizard auto-wiring is not Stable.',
|
|
11
|
+
capabilities: [
|
|
12
|
+
'install-package',
|
|
13
|
+
'write-env',
|
|
14
|
+
'patch-entry',
|
|
15
|
+
],
|
|
16
|
+
unsupportedCapabilities: [
|
|
17
|
+
'wire-source-maps',
|
|
18
|
+
'live-validate-event',
|
|
19
|
+
],
|
|
20
|
+
compatibility: [
|
|
21
|
+
{ name: '@nestjs/core', minVersion: '9', maxMajorExclusive: null, required: true },
|
|
22
|
+
{ name: '@nestjs/common', minVersion: '9', maxMajorExclusive: null, required: false },
|
|
23
|
+
],
|
|
24
|
+
files: [
|
|
25
|
+
{ path: 'src/main.ts', kind: 'optional', description: 'Nest entry (managed-block hint appended)' },
|
|
26
|
+
{ path: 'src/main.js', kind: 'optional' },
|
|
27
|
+
{ path: '.env', kind: 'created' },
|
|
28
|
+
],
|
|
29
|
+
supportedPackageManagers: ['npm', 'pnpm', 'yarn', 'yarn-berry', 'bun'],
|
|
30
|
+
docsUrl: 'https://github.com/allstak-io/sdks/tree/main/allstak-wizard/docs/beta/nestjs.md',
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/integrations/nestjs/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAwB;IACjD,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,4BAA4B;IACnC,UAAU,EAAE,iBAAiB;IAC7B,kBAAkB,EAAE,EAAE;IACtB,SAAS,EAAE,cAAc;IACzB,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,cAAc;IAChC,MAAM,EAAE,KAAK;IACb,aAAa,EACX,yMAAyM;IAC3M,YAAY,EAAE;QACZ,iBAAiB;QACjB,WAAW;QACX,aAAa;KACd;IACD,uBAAuB,EAAE;QACvB,kBAAkB;QAClB,qBAAqB;KACtB;IACD,aAAa,EAAE;QACb,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClF,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;KACtF;IACD,KAAK,EAAE;QACL,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,0CAA0C,EAAE;QAClG,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE;QACzC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;KAClC;IACD,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC;IACtE,OAAO,EAAE,iFAAiF;CAC3F,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Transaction } from '../../transaction/tx.js';
|
|
2
|
+
import type { WizardContext } from '../../registry/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* NestJS patch.
|
|
5
|
+
*
|
|
6
|
+
* Two safe AST mutations:
|
|
7
|
+
* 1. AST-add `import { AllStakNestExceptionFilter, AllStakNestInterceptor }
|
|
8
|
+
* from '@allstak/nestjs'` to the entry file.
|
|
9
|
+
* 2. Append a managed-block hint guiding the user where to call
|
|
10
|
+
* `app.useGlobalFilters(new AllStakNestExceptionFilter(...))`.
|
|
11
|
+
*
|
|
12
|
+
* We deliberately do NOT auto-inject the `useGlobalFilters` call:
|
|
13
|
+
* - `NestFactory.create(AppModule)` returns a promise that's typically
|
|
14
|
+
* awaited then chained with `await app.listen(...)`. Inserting between
|
|
15
|
+
* these requires understanding the user's specific bootstrap layout
|
|
16
|
+
* (single function, factory pattern, multiple apps, etc.).
|
|
17
|
+
* - Nest 9 vs 10 vs 11 differ on whether the filter is global
|
|
18
|
+
* (`useGlobalFilters`) or applied per-module/controller. Auto-injection
|
|
19
|
+
* would lock users into one shape.
|
|
20
|
+
*
|
|
21
|
+
* Beta promise: AST-safe import + managed-block hint. Stable promise
|
|
22
|
+
* (deferred to v0.2): per-Nest-version validated `main.ts` mutation.
|
|
23
|
+
*/
|
|
24
|
+
export declare function patchNestjs(ctx: WizardContext, tx: Transaction): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../src/integrations/nestjs/patch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAS7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCpF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { writeStandardEnv } from '../_shared.js';
|
|
2
|
+
import { patchJsModule, ensureImport } from '../../patchers/js-ast.js';
|
|
3
|
+
import { appendManagedBlock } from '../../patchers/source-block.js';
|
|
4
|
+
import { log } from '../../util/log.js';
|
|
5
|
+
import { locateNestEntry } from './files.js';
|
|
6
|
+
const PKG = '@allstak/nestjs';
|
|
7
|
+
/**
|
|
8
|
+
* NestJS patch.
|
|
9
|
+
*
|
|
10
|
+
* Two safe AST mutations:
|
|
11
|
+
* 1. AST-add `import { AllStakNestExceptionFilter, AllStakNestInterceptor }
|
|
12
|
+
* from '@allstak/nestjs'` to the entry file.
|
|
13
|
+
* 2. Append a managed-block hint guiding the user where to call
|
|
14
|
+
* `app.useGlobalFilters(new AllStakNestExceptionFilter(...))`.
|
|
15
|
+
*
|
|
16
|
+
* We deliberately do NOT auto-inject the `useGlobalFilters` call:
|
|
17
|
+
* - `NestFactory.create(AppModule)` returns a promise that's typically
|
|
18
|
+
* awaited then chained with `await app.listen(...)`. Inserting between
|
|
19
|
+
* these requires understanding the user's specific bootstrap layout
|
|
20
|
+
* (single function, factory pattern, multiple apps, etc.).
|
|
21
|
+
* - Nest 9 vs 10 vs 11 differ on whether the filter is global
|
|
22
|
+
* (`useGlobalFilters`) or applied per-module/controller. Auto-injection
|
|
23
|
+
* would lock users into one shape.
|
|
24
|
+
*
|
|
25
|
+
* Beta promise: AST-safe import + managed-block hint. Stable promise
|
|
26
|
+
* (deferred to v0.2): per-Nest-version validated `main.ts` mutation.
|
|
27
|
+
*/
|
|
28
|
+
export async function patchNestjs(ctx, tx) {
|
|
29
|
+
await writeStandardEnv(ctx, tx, '.env');
|
|
30
|
+
const main = ctx.detected.packageJson?.scripts?.start ?? '';
|
|
31
|
+
const explicit = /node\s+([^\s&]+)/.exec(main)?.[1] ?? null;
|
|
32
|
+
const entry = locateNestEntry(ctx.projectRoot, explicit);
|
|
33
|
+
if (!entry) {
|
|
34
|
+
log.warn('No NestJS entry file (src/main.ts) found — entry patch skipped. Run repair after creating it.');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
await patchJsModule(tx, entry, (mod) => {
|
|
38
|
+
ensureImport(mod, {
|
|
39
|
+
from: PKG,
|
|
40
|
+
named: ['AllStakNestExceptionFilter', 'AllStakNestInterceptor'],
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
const block = [
|
|
44
|
+
`// allstak-wizard: register the AllStak filter + interceptor inside your bootstrap function.`,
|
|
45
|
+
`//`,
|
|
46
|
+
`// Example (single-app bootstrap):`,
|
|
47
|
+
`// async function bootstrap() {`,
|
|
48
|
+
`// const app = await NestFactory.create(AppModule);`,
|
|
49
|
+
`// app.useGlobalFilters(new AllStakNestExceptionFilter({`,
|
|
50
|
+
`// dsn: process.env.ALLSTAK_DSN,`,
|
|
51
|
+
`// endpoint: process.env.ALLSTAK_HOST ?? '${ctx.host}',`,
|
|
52
|
+
`// release: process.env.ALLSTAK_RELEASE,`,
|
|
53
|
+
`// environment: process.env.ALLSTAK_ENVIRONMENT ?? '${ctx.environment}',`,
|
|
54
|
+
`// }));`,
|
|
55
|
+
`// // Optional: app.useGlobalInterceptors(new AllStakNestInterceptor());`,
|
|
56
|
+
`// await app.listen(3000);`,
|
|
57
|
+
`// }`,
|
|
58
|
+
`//`,
|
|
59
|
+
`// Why hint instead of auto-injection: Nest entry shapes vary too much`,
|
|
60
|
+
`// (single app, multi-app factory, microservice transports). The wizard`,
|
|
61
|
+
`// validates that the import is in place + the managed block is up-to-date;`,
|
|
62
|
+
`// the user owns the registration call.`,
|
|
63
|
+
].join('\n');
|
|
64
|
+
await appendManagedBlock(tx, entry, block, { style: 'slash', validateJs: true });
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.js","sourceRoot":"","sources":["../../../src/integrations/nestjs/patch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAkB,EAAE,EAAe;IACnE,MAAM,gBAAgB,CAAC,GAAG,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAExC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;IAC5D,MAAM,QAAQ,GACZ,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC7C,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,GAAG,CAAC,IAAI,CAAC,+FAA+F,CAAC,CAAC;QAC1G,OAAO;IACT,CAAC;IAED,MAAM,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;QACrC,YAAY,CAAC,GAAG,EAAE;YAChB,IAAI,EAAE,GAAG;YACT,KAAK,EAAE,CAAC,4BAA4B,EAAE,wBAAwB,CAAC;SAChE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG;QACZ,8FAA8F;QAC9F,IAAI;QACJ,oCAAoC;QACpC,mCAAmC;QACnC,yDAAyD;QACzD,8DAA8D;QAC9D,wCAAwC;QACxC,mDAAmD,GAAG,CAAC,IAAI,IAAI;QAC/D,gDAAgD;QAChD,6DAA6D,GAAG,CAAC,WAAW,IAAI;QAChF,aAAa;QACb,8EAA8E;QAC9E,gCAAgC;QAChC,QAAQ;QACR,IAAI;QACJ,wEAAwE;QACxE,yEAAyE;QACzE,6EAA6E;QAC7E,yCAAyC;KAC1C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,kBAAkB,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/integrations/nestjs/uninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQ7D,wBAAsB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAYxF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { runPackageUninstall, removeStandardEnv } from '../_shared.js';
|
|
3
|
+
import { patchJsModule, removeImport } from '../../patchers/js-ast.js';
|
|
4
|
+
import { removeManagedSourceBlock } from '../../patchers/source-block.js';
|
|
5
|
+
import { locateNestEntry } from './files.js';
|
|
6
|
+
const PKG = '@allstak/nestjs';
|
|
7
|
+
export async function uninstallNestjs(ctx, tx) {
|
|
8
|
+
await removeStandardEnv(tx, resolve(ctx.projectRoot, '.env'));
|
|
9
|
+
const main = ctx.detected.packageJson?.scripts?.start ?? '';
|
|
10
|
+
const explicit = /node\s+([^\s&]+)/.exec(main)?.[1] ?? null;
|
|
11
|
+
const entry = locateNestEntry(ctx.projectRoot, explicit);
|
|
12
|
+
if (entry) {
|
|
13
|
+
await removeManagedSourceBlock(tx, entry, 'slash');
|
|
14
|
+
await patchJsModule(tx, entry, (mod) => removeImport(mod, PKG));
|
|
15
|
+
}
|
|
16
|
+
await runPackageUninstall(ctx, [PKG]);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=uninstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/integrations/nestjs/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAE9B,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAkB,EAAE,EAAe;IACvE,MAAM,iBAAiB,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9D,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;IAC5D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC5D,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,wBAAwB,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,mBAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-export the real NestJS integration. Kept for symmetry with other
|
|
3
|
+
* integration modules and so the registry import path stays stable.
|
|
4
|
+
*/
|
|
5
|
+
export { nestjsIntegration } from './nestjs/index.js';
|
|
2
6
|
//# sourceMappingURL=nestjs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestjs.d.ts","sourceRoot":"","sources":["../../src/integrations/nestjs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nestjs.d.ts","sourceRoot":"","sources":["../../src/integrations/nestjs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
stability: 'experimental',
|
|
7
|
-
supportedPackageManagers: ['npm', 'pnpm', 'yarn', 'yarn-berry', 'bun'],
|
|
8
|
-
reason: 'NestJS scaffolding installs the SDK and writes env vars but does NOT auto-wire the exception filter / interceptor. Wire-up is manual until v0.2 validates main.ts mutation across Nest 9/10/11.',
|
|
9
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* Re-export the real NestJS integration. Kept for symmetry with other
|
|
3
|
+
* integration modules and so the registry import path stays stable.
|
|
4
|
+
*/
|
|
5
|
+
export { nestjsIntegration } from './nestjs/index.js';
|
|
10
6
|
//# sourceMappingURL=nestjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestjs.js","sourceRoot":"","sources":["../../src/integrations/nestjs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"nestjs.js","sourceRoot":"","sources":["../../src/integrations/nestjs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -13,7 +13,7 @@ export const nextIntegration = {
|
|
|
13
13
|
},
|
|
14
14
|
async plan(ctx) {
|
|
15
15
|
const lines = [];
|
|
16
|
-
lines.push(`install ${nextManifest.sdkPackage}
|
|
16
|
+
lines.push(`install ${nextManifest.sdkPackage} and @allstak/js (${ctx.pm})`);
|
|
17
17
|
lines.push(`write ALLSTAK_DSN, ALLSTAK_API_KEY, ALLSTAK_HOST/ENVIRONMENT/RELEASE to .env.local`);
|
|
18
18
|
const inst = locateInstrumentation(ctx.projectRoot);
|
|
19
19
|
lines.push(inst ? `update ${inst}` : `create instrumentation.ts`);
|
|
@@ -23,7 +23,7 @@ export const nextIntegration = {
|
|
|
23
23
|
return lines;
|
|
24
24
|
},
|
|
25
25
|
async install(ctx) {
|
|
26
|
-
await runPackageInstall(ctx, [
|
|
26
|
+
await runPackageInstall(ctx, [nextManifest.sdkPackage, '@allstak/js']);
|
|
27
27
|
},
|
|
28
28
|
async patch(ctx, tx) {
|
|
29
29
|
await patchNext(ctx, tx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/next/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,YAAY;IAEtB,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAG;QACZ,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,WAAW,YAAY,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/next/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CA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AK,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE;QAClB,MAAM,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/integrations/next/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/integrations/next/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,eAAO,MAAM,YAAY,EAAE,mBA8B1B,CAAC"}
|
|
@@ -4,7 +4,10 @@ export const nextManifest = {
|
|
|
4
4
|
sdkPackage: '@allstak/next',
|
|
5
5
|
additionalPackages: ['@allstak/js'],
|
|
6
6
|
stability: 'beta',
|
|
7
|
-
|
|
7
|
+
runtimeStatus: 'beta',
|
|
8
|
+
wizardAutomation: 'assisted',
|
|
9
|
+
public: true,
|
|
10
|
+
stabilityNote: null,
|
|
8
11
|
capabilities: [
|
|
9
12
|
'install-package',
|
|
10
13
|
'write-env',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/integrations/next/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,sCAAsC;IAC7C,UAAU,EAAE,eAAe;IAC3B,kBAAkB,EAAE,CAAC,aAAa,CAAC;IACnC,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/integrations/next/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,sCAAsC;IAC7C,UAAU,EAAE,eAAe;IAC3B,kBAAkB,EAAE,CAAC,aAAa,CAAC;IACnC,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,MAAM;IACrB,gBAAgB,EAAE,UAAU;IAC5B,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE;QACZ,iBAAiB;QACjB,WAAW;QACX,wBAAwB;QACxB,wBAAwB;QACxB,kBAAkB;KACnB;IACD,uBAAuB,EAAE,CAAC,qBAAqB,CAAC;IAChD,aAAa,EAAE;QACb,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC5E;IACD,KAAK,EAAE;QACL,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;QACvC,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,mDAAmD,EAAE;QACjH,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE;QAC5C,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE;QAC7C,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE;KAC7C;IACD,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC;IACtE,OAAO,EAAE,kEAAkE;CAC5E,CAAC"}
|
|
@@ -40,9 +40,14 @@ async function ensureInstrumentationFile(ctx, tx) {
|
|
|
40
40
|
].join('\n'), { style: 'slash', validateJs: true });
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
// Wrap the wizard-generated content in a managed-block so `uninstall`'s
|
|
44
|
+
// `removeManagedSourceBlock` can detect and delete the file. Without this,
|
|
45
|
+
// the wizard would orphan the file: stripping the import leaves a dead
|
|
46
|
+
// `export function register() {}` shell on disk forever.
|
|
47
|
+
await appendManagedBlock(tx, target, initBlock, {
|
|
48
|
+
style: 'slash',
|
|
49
|
+
validateJs: true,
|
|
50
|
+
defaultEmpty: '',
|
|
46
51
|
});
|
|
47
52
|
}
|
|
48
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch.js","sourceRoot":"","sources":["../../../src/integrations/next/patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,GAAG,GAAG,eAAe,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAkB,EAAE,EAAe;IACjE,MAAM,gBAAgB,CAAC,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE;QAC5C,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,yCAAyC,EAAE;KAC9F,CAAC,CAAC;IACH,MAAM,yBAAyB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,CAAC,cAAc,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,IAAI,IAAI,C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CACtB,EAAE,EACF,MAAM,EACN;YACE,wEAAwE;YACxE,2EAA2E;YAC3E,uCAAuC,GAAG,IAAI;YAC9C,uDAAuD;SACxD,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CACrC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,wEAAwE;QACxE,2EAA2E;QAC3E,uEAAuE;QACvE,yDAAyD;QACzD,MAAM,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;YAC9C,KAAK,EAAE,OAAO;YACd,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/integrations/next/uninstall.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/integrations/next/uninstall.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAS7D,wBAAsB,aAAa,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBtF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
1
2
|
import { resolve } from 'node:path';
|
|
2
3
|
import { runPackageUninstall, removeStandardEnv } from '../_shared.js';
|
|
3
4
|
import { patchJsModule, removeImport } from '../../patchers/js-ast.js';
|
|
@@ -9,8 +10,16 @@ export async function uninstallNext(ctx, tx) {
|
|
|
9
10
|
await removeStandardEnv(tx, resolve(ctx.projectRoot, '.env.local'));
|
|
10
11
|
const inst = locateInstrumentation(ctx.projectRoot);
|
|
11
12
|
if (inst) {
|
|
13
|
+
// Order matters: strip the managed-block region FIRST. When the wizard
|
|
14
|
+
// CREATED the file, its entire content lives inside the markers, so the
|
|
15
|
+
// block-strip leaves the file empty and `removeManagedSourceBlock`
|
|
16
|
+
// deletes it. Running `patchJsModule` first would re-emit the file via
|
|
17
|
+
// magicast and could normalize the marker comments away, after which the
|
|
18
|
+
// block-strip would fail to find them and orphan the file on disk.
|
|
12
19
|
await removeManagedSourceBlock(tx, inst, 'slash');
|
|
13
|
-
|
|
20
|
+
if (existsSync(inst)) {
|
|
21
|
+
await patchJsModule(tx, inst, (mod) => removeImport(mod, PKG));
|
|
22
|
+
}
|
|
14
23
|
}
|
|
15
24
|
if (locateNextConfig(ctx.projectRoot)) {
|
|
16
25
|
const next = sourceMapRegistry.get('next');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/integrations/next/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,GAAG,GAAG,eAAe,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAkB,EAAE,EAAe;IACrE,MAAM,iBAAiB,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,qBAAqB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,IAAI,EAAE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CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,IAAI;YAAE,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,MAAM,mBAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel.d.ts","sourceRoot":"","sources":["../../src/integrations/otel.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"otel.d.ts","sourceRoot":"","sources":["../../src/integrations/otel.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,mCAW1B,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { simpleScaffold } from './_simple-scaffold.js';
|
|
2
2
|
export const otelIntegration = simpleScaffold({
|
|
3
3
|
id: 'otel',
|
|
4
|
-
title: 'OpenTelemetry exporter
|
|
4
|
+
title: 'OpenTelemetry exporter',
|
|
5
5
|
sdkPackage: '@allstak/otel',
|
|
6
6
|
stability: 'experimental',
|
|
7
|
+
runtimeStatus: 'experimental',
|
|
8
|
+
wizardAutomation: 'experimental',
|
|
9
|
+
public: false,
|
|
7
10
|
supportedPackageManagers: ['npm', 'pnpm', 'yarn', 'yarn-berry', 'bun'],
|
|
8
11
|
reason: 'OTel exporter scaffolding installs the package and writes env vars; constructing the exporter and registering it on the OTel SDK is not auto-applied in v0.1.',
|
|
9
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel.js","sourceRoot":"","sources":["../../src/integrations/otel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"otel.js","sourceRoot":"","sources":["../../src/integrations/otel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE,eAAe;IAC3B,SAAS,EAAE,cAAc;IACzB,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,cAAc;IAChC,MAAM,EAAE,KAAK;IACb,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC;IACtE,MAAM,EACJ,+JAA+J;CAClK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"php.d.ts","sourceRoot":"","sources":["../../src/integrations/php.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"php.d.ts","sourceRoot":"","sources":["../../src/integrations/php.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,mCAoBzB,CAAC"}
|