diff --git a/package.json b/package.json index ab820dc..447c140 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "type": "module", "exports": { "types": "./index.d.ts", - "default": "./index.js" + "default": "./source/index.js" }, "sideEffects": false, "engines": { @@ -23,10 +23,8 @@ "test": "xo && ava && tsc index.d.ts" }, "files": [ - "index.js", - "index.d.ts", - "iterable.js", - "windows.js" + "source/**/*.js", + "index.d.ts" ], "keywords": [ "spawn", diff --git a/index.js b/source/index.js similarity index 100% rename from index.js rename to source/index.js diff --git a/iterable.js b/source/iterable.js similarity index 100% rename from iterable.js rename to source/iterable.js diff --git a/pipe.js b/source/pipe.js similarity index 100% rename from pipe.js rename to source/pipe.js diff --git a/windows.js b/source/windows.js similarity index 100% rename from windows.js rename to source/windows.js diff --git a/fixtures/()[]%0!`.cmd b/test/fixtures/()[]%0!`.cmd similarity index 100% rename from fixtures/()[]%0!`.cmd rename to test/fixtures/()[]%0!`.cmd diff --git a/fixtures/echo-file.js b/test/fixtures/echo-file.js similarity index 100% rename from fixtures/echo-file.js rename to test/fixtures/echo-file.js diff --git a/fixtures/echo.js b/test/fixtures/echo.js similarity index 100% rename from fixtures/echo.js rename to test/fixtures/echo.js diff --git a/fixtures/node-flags-path.js b/test/fixtures/node-flags-path.js similarity index 75% rename from fixtures/node-flags-path.js rename to test/fixtures/node-flags-path.js index 75a1867..e99d6e9 100755 --- a/fixtures/node-flags-path.js +++ b/test/fixtures/node-flags-path.js @@ -1,5 +1,5 @@ #!/usr/bin/env node import process from 'node:process'; -import nanoSpawn from '../index.js'; +import nanoSpawn from '../../source/index.js'; await nanoSpawn(process.execPath, ['-p', 'process.execArgv'], {stdout: 'inherit'}); diff --git a/fixtures/node-flags.js b/test/fixtures/node-flags.js similarity index 66% rename from fixtures/node-flags.js rename to test/fixtures/node-flags.js index ba3ea1b..c85a756 100755 --- a/fixtures/node-flags.js +++ b/test/fixtures/node-flags.js @@ -1,4 +1,4 @@ #!/usr/bin/env node -import nanoSpawn from '../index.js'; +import nanoSpawn from '../../source/index.js'; await nanoSpawn('node', ['-p', 'process.execArgv'], {stdout: 'inherit'}); diff --git a/fixtures/node-version.js b/test/fixtures/node-version.js similarity index 63% rename from fixtures/node-version.js rename to test/fixtures/node-version.js index fd36c20..3f80b76 100755 --- a/fixtures/node-version.js +++ b/test/fixtures/node-version.js @@ -1,4 +1,4 @@ #!/usr/bin/env node -import nanoSpawn from '../index.js'; +import nanoSpawn from '../../source/index.js'; await nanoSpawn('node', ['--version'], {stdout: 'inherit'}); diff --git a/fixtures/shebang.js b/test/fixtures/shebang.js similarity index 100% rename from fixtures/shebang.js rename to test/fixtures/shebang.js diff --git a/fixtures/spawnecho.cmd b/test/fixtures/spawnecho.cmd similarity index 100% rename from fixtures/spawnecho.cmd rename to test/fixtures/spawnecho.cmd diff --git a/fixtures/test.js b/test/fixtures/test.js similarity index 100% rename from fixtures/test.js rename to test/fixtures/test.js diff --git a/fixtures/test.txt b/test/fixtures/test.txt similarity index 100% rename from fixtures/test.txt rename to test/fixtures/test.txt diff --git a/test.js b/test/index.js similarity index 99% rename from test.js rename to test/index.js index 25fba2d..8359894 100644 --- a/test.js +++ b/test/index.js @@ -10,7 +10,7 @@ import getNode from 'get-node'; import pathKey from 'path-key'; import {temporaryWriteTask} from 'tempy'; import {red} from 'yoctocolors'; -import nanoSpawn from './index.js'; +import nanoSpawn from '../source/index.js'; const isLinux = process.platform === 'linux'; const isWindows = process.platform === 'win32'; @@ -1166,7 +1166,7 @@ const testLocalBinaryExec = async (t, cwd) => { }; test('options.preferLocal true runs local npm binaries', testLocalBinaryExec, undefined); -test('options.preferLocal true runs local npm binaries with options.cwd string', testLocalBinaryExec, './fixtures'); +test('options.preferLocal true runs local npm binaries with options.cwd string', testLocalBinaryExec, fixturesPath); test('options.preferLocal true runs local npm binaries with options.cwd URL', testLocalBinaryExec, FIXTURES_URL); if (!isWindows) {