tsnite 0.1.4 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +6 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -38,7 +38,8 @@ process.on('SIGTERM', function () {
38
38
  cleanup('SIGTERM');
39
39
  });
40
40
  function spawn(entry, nodeArgs) {
41
- const child = fork(join(import.meta.dirname, '..', entry), {
41
+ const entryPath = isAbsolute(entry) ? entry : resolve(process.cwd(), entry);
42
+ const child = fork(entryPath, {
42
43
  stdio: 'inherit',
43
44
  execArgv: [
44
45
  '--enable-source-maps',
@@ -130,6 +131,7 @@ function createWatchConfig(options) {
130
131
  };
131
132
  }
132
133
  async function handler(entry, options, nodeArgs, isWatch) {
134
+ const runtimeEntry = isAbsolute(entry) ? entry : resolve(process.cwd(), entry);
133
135
  async function restart(reason) {
134
136
  process.stdout.write('\x1Bc');
135
137
  if (reason) {
@@ -154,14 +156,14 @@ async function handler(entry, options, nodeArgs, isWatch) {
154
156
  }
155
157
  }
156
158
  clearResolveCache();
157
- spawn(entry, nodeArgs);
159
+ spawn(runtimeEntry, nodeArgs);
158
160
  }
159
161
  const restartDebounced = debounce(restart, WATCH_DEBOUNCE_MS);
160
162
  process.stdout.write('\x1Bc');
161
163
  if (isWatch) {
162
164
  console.log(yellow('Watching for changes...'));
163
165
  }
164
- spawn(entry, nodeArgs);
166
+ spawn(runtimeEntry, nodeArgs);
165
167
  if (!isWatch)
166
168
  return;
167
169
  const { ignored, paths } = createWatchConfig(options);
@@ -176,7 +178,7 @@ async function handler(entry, options, nodeArgs, isWatch) {
176
178
  eventName !== 'unlink') {
177
179
  return;
178
180
  }
179
- await invalidateFileCaches(isAbsolute(changedPath) ? changedPath : (resolve(import.meta.dirname, '..', changedPath)));
181
+ await invalidateFileCaches(isAbsolute(changedPath) ? changedPath : (resolve(process.cwd(), changedPath)));
180
182
  restartDebounced(`Change detected (${eventName}): ${changedPath}`);
181
183
  });
182
184
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tsnite",
3
3
  "description": "TypeScript at full throttle—fast, safe, unstoppable. 🚀",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "keywords": [
6
6
  "cli",
7
7
  "esm",