svelte2tsx 0.7.15 → 0.7.16

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/index.d.ts CHANGED
@@ -108,6 +108,10 @@ export interface EmitDtsConfig {
108
108
  * set to `src/lib` by default.
109
109
  */
110
110
  libRoot?: string;
111
+ /**
112
+ * Name of your tsconfig file, if it's not the standard `tsconfig.json` or `jsconfig.json`
113
+ */
114
+ tsconfig?: string;
111
115
  }
112
116
 
113
117
  // to make typo fix non-breaking, continue to export the old name but mark it as deprecated
package/index.js CHANGED
@@ -5310,7 +5310,10 @@ class Scripts {
5310
5310
  // should be 2 at most, one each, so using forEach is safe
5311
5311
  this.topLevelScripts.forEach((tag) => {
5312
5312
  if (tag.attributes &&
5313
- tag.attributes.find((a) => a.name == 'context' && a.value.length == 1 && a.value[0].raw == 'module')) {
5313
+ tag.attributes.find((a) => (a.name == 'context' &&
5314
+ a.value.length == 1 &&
5315
+ a.value[0].raw == 'module') ||
5316
+ a.name === 'module')) {
5314
5317
  moduleScriptTag = tag;
5315
5318
  }
5316
5319
  else {
@@ -6993,7 +6996,7 @@ function loadTsconfig(config, svelteMap) {
6993
6996
  var _a;
6994
6997
  const libRoot = config.libRoot || process.cwd();
6995
6998
  const jsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists, 'jsconfig.json');
6996
- let tsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists);
6999
+ let tsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists, config.tsconfig);
6997
7000
  if (!tsconfigFile && !jsconfigFile) {
6998
7001
  throw new Error('Failed to locate tsconfig or jsconfig');
6999
7002
  }
package/index.mjs CHANGED
@@ -5290,7 +5290,10 @@ class Scripts {
5290
5290
  // should be 2 at most, one each, so using forEach is safe
5291
5291
  this.topLevelScripts.forEach((tag) => {
5292
5292
  if (tag.attributes &&
5293
- tag.attributes.find((a) => a.name == 'context' && a.value.length == 1 && a.value[0].raw == 'module')) {
5293
+ tag.attributes.find((a) => (a.name == 'context' &&
5294
+ a.value.length == 1 &&
5295
+ a.value[0].raw == 'module') ||
5296
+ a.name === 'module')) {
5294
5297
  moduleScriptTag = tag;
5295
5298
  }
5296
5299
  else {
@@ -6973,7 +6976,7 @@ function loadTsconfig(config, svelteMap) {
6973
6976
  var _a;
6974
6977
  const libRoot = config.libRoot || process.cwd();
6975
6978
  const jsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists, 'jsconfig.json');
6976
- let tsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists);
6979
+ let tsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists, config.tsconfig);
6977
6980
  if (!tsconfigFile && !jsconfigFile) {
6978
6981
  throw new Error('Failed to locate tsconfig or jsconfig');
6979
6982
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte2tsx",
3
- "version": "0.7.15",
3
+ "version": "0.7.16",
4
4
  "description": "Convert Svelte components to TSX for type checking",
5
5
  "author": "David Pershouse",
6
6
  "license": "MIT",