@sdk-it/core 0.46.7 → 0.46.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/lib/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,wBAkCjD;AACD,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,cAc9C;AACD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,qCAOhE;AACD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,IAAI,EAAE,MAAM,GACX,IAAI,IAAI,EAAE,CAAC,cAAc,CAO3B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAMtD"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/lib/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,wBAkCjD;AACD,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,cAoB9C;AACD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,qCAOhE;AACD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,IAAI,EAAE,MAAM,GACX,IAAI,IAAI,EAAE,CAAC,cAAc,CAO3B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAMtD"}
@@ -40,6 +40,12 @@ function getProgram(tsconfigPath) {
40
40
  return ts.createProgram({
41
41
  options: {
42
42
  ...tsConfigParseResult.options,
43
+ // Packages may expose their implementation for static analysis while
44
+ // keeping ordinary consumers on declarations and compiled JavaScript.
45
+ customConditions: [
46
+ "@sdk-it/source",
47
+ ...tsConfigParseResult.options.customConditions ?? []
48
+ ],
43
49
  noEmit: true,
44
50
  incremental: true,
45
51
  tsBuildInfoFile: join(dirname(tsconfigPath), "./.tsbuildinfo")
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/lib/program.ts"],
4
- "sourcesContent": ["import debug from 'debug';\nimport { dirname, join } from 'node:path';\nimport ts from 'typescript';\n\nconst logger = debug('january:client');\n\nexport function parseTsConfig(tsconfigPath: string) {\n logger(`Using TypeScript version: ${ts.version}`);\n const configContent = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n\n if (configContent.error) {\n console.error(\n `Failed to read tsconfig file:`,\n ts.formatDiagnosticsWithColorAndContext([configContent.error], {\n getCanonicalFileName: (path) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n }),\n );\n throw new Error('Failed to parse tsconfig.json');\n }\n\n const parsed = ts.parseJsonConfigFileContent(\n configContent.config,\n ts.sys,\n dirname(tsconfigPath),\n );\n\n if (parsed.errors.length > 0) {\n console.error(\n `Errors found in tsconfig.json:`,\n ts.formatDiagnosticsWithColorAndContext(parsed.errors, {\n getCanonicalFileName: (path) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n }),\n );\n throw new Error('Failed to parse tsconfig.json');\n }\n return parsed;\n}\nexport function getProgram(tsconfigPath: string) {\n const tsConfigParseResult = parseTsConfig(tsconfigPath);\n logger(`Parsing tsconfig`);\n return ts.createProgram({\n options: {\n ...tsConfigParseResult.options,\n noEmit: true,\n incremental: true,\n tsBuildInfoFile: join(dirname(tsconfigPath), './.tsbuildinfo'), // not working atm\n },\n rootNames: tsConfigParseResult.fileNames,\n projectReferences: tsConfigParseResult.projectReferences,\n configFileParsingDiagnostics: tsConfigParseResult.errors,\n });\n}\nexport function getPropertyAssignment(node: ts.Node, name: string) {\n if (ts.isObjectLiteralExpression(node)) {\n return node.properties\n .filter((prop) => ts.isPropertyAssignment(prop))\n .find((prop) => prop.name!.getText() === name);\n }\n return undefined;\n}\nexport function isCallExpression(\n node: ts.Node,\n name: string,\n): node is ts.CallExpression {\n return (\n ts.isCallExpression(node) &&\n node.expression &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === name\n );\n}\n\nexport function isInterfaceType(type: ts.Type): boolean {\n if (type.isClassOrInterface()) {\n // Check if it's an interface\n return !!(type.symbol.flags & ts.SymbolFlags.Interface);\n }\n return false;\n}\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,SAAS,YAAY;AAC9B,OAAO,QAAQ;AAEf,MAAM,SAAS,MAAM,gBAAgB;AAE9B,SAAS,cAAc,cAAsB;AAClD,SAAO,6BAA6B,GAAG,OAAO,EAAE;AAChD,QAAM,gBAAgB,GAAG,eAAe,cAAc,GAAG,IAAI,QAAQ;AAErE,MAAI,cAAc,OAAO;AACvB,YAAQ;AAAA,MACN;AAAA,MACA,GAAG,qCAAqC,CAAC,cAAc,KAAK,GAAG;AAAA,QAC7D,sBAAsB,CAAC,SAAS;AAAA,QAChC,qBAAqB,GAAG,IAAI;AAAA,QAC5B,YAAY,MAAM,GAAG,IAAI;AAAA,MAC3B,CAAC;AAAA,IACH;AACA,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AAEA,QAAM,SAAS,GAAG;AAAA,IAChB,cAAc;AAAA,IACd,GAAG;AAAA,IACH,QAAQ,YAAY;AAAA,EACtB;AAEA,MAAI,OAAO,OAAO,SAAS,GAAG;AAC5B,YAAQ;AAAA,MACN;AAAA,MACA,GAAG,qCAAqC,OAAO,QAAQ;AAAA,QACrD,sBAAsB,CAAC,SAAS;AAAA,QAChC,qBAAqB,GAAG,IAAI;AAAA,QAC5B,YAAY,MAAM,GAAG,IAAI;AAAA,MAC3B,CAAC;AAAA,IACH;AACA,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AACA,SAAO;AACT;AACO,SAAS,WAAW,cAAsB;AAC/C,QAAM,sBAAsB,cAAc,YAAY;AACtD,SAAO,kBAAkB;AACzB,SAAO,GAAG,cAAc;AAAA,IACtB,SAAS;AAAA,MACP,GAAG,oBAAoB;AAAA,MACvB,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,iBAAiB,KAAK,QAAQ,YAAY,GAAG,gBAAgB;AAAA;AAAA,IAC/D;AAAA,IACA,WAAW,oBAAoB;AAAA,IAC/B,mBAAmB,oBAAoB;AAAA,IACvC,8BAA8B,oBAAoB;AAAA,EACpD,CAAC;AACH;AACO,SAAS,sBAAsB,MAAe,MAAc;AACjE,MAAI,GAAG,0BAA0B,IAAI,GAAG;AACtC,WAAO,KAAK,WACT,OAAO,CAAC,SAAS,GAAG,qBAAqB,IAAI,CAAC,EAC9C,KAAK,CAAC,SAAS,KAAK,KAAM,QAAQ,MAAM,IAAI;AAAA,EACjD;AACA,SAAO;AACT;AACO,SAAS,iBACd,MACA,MAC2B;AAC3B,SACE,GAAG,iBAAiB,IAAI,KACxB,KAAK,cACL,GAAG,aAAa,KAAK,UAAU,KAC/B,KAAK,WAAW,SAAS;AAE7B;AAEO,SAAS,gBAAgB,MAAwB;AACtD,MAAI,KAAK,mBAAmB,GAAG;AAE7B,WAAO,CAAC,EAAE,KAAK,OAAO,QAAQ,GAAG,YAAY;AAAA,EAC/C;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import debug from 'debug';\nimport { dirname, join } from 'node:path';\nimport ts from 'typescript';\n\nconst logger = debug('january:client');\n\nexport function parseTsConfig(tsconfigPath: string) {\n logger(`Using TypeScript version: ${ts.version}`);\n const configContent = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n\n if (configContent.error) {\n console.error(\n `Failed to read tsconfig file:`,\n ts.formatDiagnosticsWithColorAndContext([configContent.error], {\n getCanonicalFileName: (path) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n }),\n );\n throw new Error('Failed to parse tsconfig.json');\n }\n\n const parsed = ts.parseJsonConfigFileContent(\n configContent.config,\n ts.sys,\n dirname(tsconfigPath),\n );\n\n if (parsed.errors.length > 0) {\n console.error(\n `Errors found in tsconfig.json:`,\n ts.formatDiagnosticsWithColorAndContext(parsed.errors, {\n getCanonicalFileName: (path) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n }),\n );\n throw new Error('Failed to parse tsconfig.json');\n }\n return parsed;\n}\nexport function getProgram(tsconfigPath: string) {\n const tsConfigParseResult = parseTsConfig(tsconfigPath);\n logger(`Parsing tsconfig`);\n return ts.createProgram({\n options: {\n ...tsConfigParseResult.options,\n // Packages may expose their implementation for static analysis while\n // keeping ordinary consumers on declarations and compiled JavaScript.\n customConditions: [\n '@sdk-it/source',\n ...(tsConfigParseResult.options.customConditions ?? []),\n ],\n noEmit: true,\n incremental: true,\n tsBuildInfoFile: join(dirname(tsconfigPath), './.tsbuildinfo'), // not working atm\n },\n rootNames: tsConfigParseResult.fileNames,\n projectReferences: tsConfigParseResult.projectReferences,\n configFileParsingDiagnostics: tsConfigParseResult.errors,\n });\n}\nexport function getPropertyAssignment(node: ts.Node, name: string) {\n if (ts.isObjectLiteralExpression(node)) {\n return node.properties\n .filter((prop) => ts.isPropertyAssignment(prop))\n .find((prop) => prop.name!.getText() === name);\n }\n return undefined;\n}\nexport function isCallExpression(\n node: ts.Node,\n name: string,\n): node is ts.CallExpression {\n return (\n ts.isCallExpression(node) &&\n node.expression &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === name\n );\n}\n\nexport function isInterfaceType(type: ts.Type): boolean {\n if (type.isClassOrInterface()) {\n // Check if it's an interface\n return !!(type.symbol.flags & ts.SymbolFlags.Interface);\n }\n return false;\n}\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,SAAS,YAAY;AAC9B,OAAO,QAA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AAAA,IACvC,8BAA8B,oBAAoB;AAAA,EACpD,CAAC;AACH;AACO,SAAS,sBAAsB,MAAe,MAAc;AACjE,MAAI,GAAG,0BAA0B,IAAI,GAAG;AACtC,WAAO,KAAK,WACT,OAAO,CAAC,SAAS,GAAG,qBAAqB,IAAI,CAAC,EAC9C,KAAK,CAAC,SAAS,KAAK,KAAM,QAAQ,MAAM,IAAI;AAAA,EACjD;AACA,SAAO;AACT;AACO,SAAS,iBACd,MACA,MAC2B;AAC3B,SACE,GAAG,iBAAiB,IAAI,KACxB,KAAK,cACL,GAAG,aAAa,KAAK,UAAU,KAC/B,KAAK,WAAW,SAAS;AAE7B;AAEO,SAAS,gBAAgB,MAAwB;AACtD,MAAI,KAAK,mBAAmB,GAAG;AAE7B,WAAO,CAAC,EAAE,KAAK,OAAO,QAAQ,GAAG,YAAY;AAAA,EAC/C;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdk-it/core",
3
- "version": "0.46.7",
3
+ "version": "0.46.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",