@valkyrjaio/sindri 26.0.1 → 26.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valkyrjaio/sindri",
3
- "version": "26.0.1",
3
+ "version": "26.1.3",
4
4
  "description": "The Valkyrja Sindri build tool.",
5
5
  "homepage": "https://www.valkyrja.io/sindri",
6
6
  "keywords": [
@@ -8,6 +8,13 @@
8
8
  "sindri",
9
9
  "valkyrja"
10
10
  ],
11
+ "bugs": {
12
+ "url": "https://github.com/valkyrjaio/sindri-ts/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/valkyrjaio/sindri-ts.git"
17
+ },
11
18
  "license": "MIT",
12
19
  "author": {
13
20
  "name": "Melech Mizrachi",
@@ -21,7 +28,7 @@
21
28
  }
22
29
  },
23
30
  "bin": {
24
- "sindri": "dist/bin/sindri.js"
31
+ "sindri": "dist/bin/sindri.cjs"
25
32
  },
26
33
  "files": [
27
34
  "dist",
@@ -35,6 +42,8 @@
35
42
  "ts-morph": "^28.0.0"
36
43
  },
37
44
  "scripts": {
45
+ "build": "esbuild bin/sindri.ts --bundle --platform=node --format=cjs --outfile=dist/bin/sindri.cjs --banner:js='#!/usr/bin/env node'",
46
+ "prepublishOnly": "npm run build",
38
47
  "typescript": "cd .github/ci/typescript && npm run check",
39
48
  "typescript-outdated-check": "cd .github/ci/typescript && npm install && npm outdated",
40
49
  "typescript-outdated-check-major-release": "cd .github/ci/typescript && npm install && npm outdated",
@@ -59,5 +68,8 @@
59
68
  "root-and-suggested-outdated-check": "cd .github/ci/root-and-suggested && npm install && npm outdated",
60
69
  "root-and-suggested-outdated-check-major-release": "cd .github/ci/root-and-suggested && npm install && npm outdated",
61
70
  "root-and-suggested-npm-update": "cd .github/ci/root-and-suggested && npm update"
71
+ },
72
+ "devDependencies": {
73
+ "esbuild": "^0.28.1"
62
74
  }
63
75
  }
@@ -627,7 +627,7 @@ export abstract class AstReader {
627
627
 
628
628
  const fqn = fqnColonCase.substring(0, pos);
629
629
  const caseName = fqnColonCase.substring(pos + 2);
630
- const className = fqn.split('\\').pop() ?? fqn;
630
+ const className = fqn.slice(fqn.lastIndexOf('\\') + 1);
631
631
 
632
632
  return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(className), caseName);
633
633
  }
@@ -636,7 +636,7 @@ export abstract class AstReader {
636
636
  * Build a `ClassName.methodName` property access from a HandlerData.
637
637
  */
638
638
  protected buildHandlerExpr(handler: HandlerData): ts.PropertyAccessExpression {
639
- const className = handler.class.split('\\').pop() ?? handler.class;
639
+ const className = handler.class.slice(handler.class.lastIndexOf('\\') + 1);
640
640
 
641
641
  return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(className), handler.method);
642
642
  }
@@ -647,7 +647,7 @@ export abstract class AstReader {
647
647
  }
648
648
 
649
649
  protected buildNewExpr(className: string, args: ts.Expression[]): ts.NewExpression {
650
- const shortName = className.split('\\').pop() ?? className;
650
+ const shortName = className.slice(className.lastIndexOf('\\') + 1);
651
651
 
652
652
  return ts.factory.createNewExpression(ts.factory.createIdentifier(shortName), undefined, args);
653
653
  }
@@ -671,7 +671,7 @@ export abstract class AstReader {
671
671
  }
672
672
 
673
673
  protected buildClassIdentifierArrayExpr(classes: readonly string[]): ts.ArrayLiteralExpression {
674
- const elements = classes.map((c) => ts.factory.createIdentifier(c.split('\\').pop() ?? c));
674
+ const elements = classes.map((c) => ts.factory.createIdentifier(c.slice(c.lastIndexOf('\\') + 1)));
675
675
  return ts.factory.createArrayLiteralExpression(elements);
676
676
  }
677
677
 
@@ -65,7 +65,7 @@ export class ConfigReader extends AstReader implements ConfigReaderContract {
65
65
  if (ts.isExpressionStatement(stmt) && ts.isCallExpression(stmt.expression)) {
66
66
  const call = stmt.expression;
67
67
 
68
- if (ts.isIdentifier(call.expression) && call.expression.text === 'super') {
68
+ if (call.expression.kind === ts.SyntaxKind.SuperKeyword) {
69
69
  return call.arguments;
70
70
  }
71
71
  }
@@ -133,13 +133,14 @@ export class ConfigReader extends AstReader implements ConfigReaderContract {
133
133
  return arg.text;
134
134
  }
135
135
 
136
- // process.cwd() → use the file directory as a proxy
136
+ // process.cwd() resolves to the current working directory, which is the application root
137
+ // that sindri is run from (the same directory the application itself runs from).
137
138
  if (ts.isCallExpression(arg) && ts.isPropertyAccessExpression(arg.expression)) {
138
139
  const obj = arg.expression.expression;
139
140
  const prop = arg.expression.name;
140
141
 
141
142
  if (ts.isIdentifier(obj) && obj.text === 'process' && ts.isIdentifier(prop) && prop.text === 'cwd') {
142
- return fileDir;
143
+ return process.cwd();
143
144
  }
144
145
  }
145
146
 
@@ -150,9 +151,8 @@ export class ConfigReader extends AstReader implements ConfigReaderContract {
150
151
 
151
152
  if (
152
153
  ts.isPropertyAccessExpression(arg) &&
153
- ts.isPropertyAccessExpression(arg.expression) &&
154
- ts.isMetaProperty(arg.expression.expression) &&
155
- arg.expression.expression.name.text === 'meta'
154
+ ts.isMetaProperty(arg.expression) &&
155
+ arg.expression.name.text === 'meta'
156
156
  ) {
157
157
  return fileDir;
158
158
  }
@@ -8,8 +8,8 @@
8
8
  */
9
9
 
10
10
  export class SindriInfo {
11
- static readonly VERSION = '26.0.1' as const;
12
- static readonly VERSION_BUILD_DATE_TIME = 'June 17 2026 20:43:19 MST' as const;
11
+ static readonly VERSION = '26.1.3' as const;
12
+ static readonly VERSION_BUILD_DATE_TIME = 'June 21 2026 11:20:36 MST' as const;
13
13
  static readonly ICON = `\
14
14
  ██████████
15
15
  ████ ████
@@ -189,6 +189,12 @@ export abstract class GenerateDataFromAst {
189
189
  }
190
190
 
191
191
  for (const entry of entries) {
192
+ // Never descend into dependency directories — application source never lives there,
193
+ // and a matching class name in node_modules must not shadow the real one.
194
+ if (entry.isDirectory() && entry.name === 'node_modules') {
195
+ continue;
196
+ }
197
+
192
198
  const fullPath = path.join(dir, entry.name);
193
199
 
194
200
  if (entry.isDirectory()) {
@@ -26,7 +26,7 @@ export abstract class AstFileGenerator {
26
26
 
27
27
  const fqn = fqnColonCase.substring(0, pos);
28
28
  const caseName = fqnColonCase.substring(pos + 2);
29
- const className = fqn.split('\\').pop() ?? fqn;
29
+ const className = fqn.slice(fqn.lastIndexOf('\\') + 1);
30
30
 
31
31
  return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(className), caseName);
32
32
  }
@@ -70,7 +70,7 @@ export class AstContainerDataFileGenerator extends AstFileGenerator implements C
70
70
  const keyExpr = this.buildEnumCaseExpr(serviceId);
71
71
  const printedKey = this.printer.printNode(ts.EmitHint.Unspecified, keyExpr, this.dummySourceFile);
72
72
 
73
- const shortProviderClass = providerClass.split('\\').pop() ?? providerClass;
73
+ const shortProviderClass = providerClass.slice(providerClass.lastIndexOf('\\') + 1);
74
74
 
75
75
  const formattedKey = serviceId.includes('::') ? `[${printedKey}]` : `['${printedKey}']`;
76
76