From f2f3b6d7f8f74081f03b9947648fd9576c595455 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 1 Sep 2024 10:43:54 +0100 Subject: [PATCH] Move all files to `source/` and `test/` directories --- package.json | 8 +++----- index.js => source/index.js | 0 iterable.js => source/iterable.js | 0 pipe.js => source/pipe.js | 0 windows.js => source/windows.js | 0 {fixtures => test/fixtures}/()[]%0!`.cmd | 0 {fixtures => test/fixtures}/echo-file.js | 0 {fixtures => test/fixtures}/echo.js | 0 {fixtures => test/fixtures}/node-flags-path.js | 2 +- {fixtures => test/fixtures}/node-flags.js | 2 +- {fixtures => test/fixtures}/node-version.js | 2 +- {fixtures => test/fixtures}/shebang.js | 0 {fixtures => test/fixtures}/spawnecho.cmd | 0 {fixtures => test/fixtures}/test.js | 0 {fixtures => test/fixtures}/test.txt | 0 test.js => test/index.js | 4 ++-- 16 files changed, 8 insertions(+), 10 deletions(-) rename index.js => source/index.js (100%) rename iterable.js => source/iterable.js (100%) rename pipe.js => source/pipe.js (100%) rename windows.js => source/windows.js (100%) rename {fixtures => test/fixtures}/()[]%0!`.cmd (100%) rename {fixtures => test/fixtures}/echo-file.js (100%) rename {fixtures => test/fixtures}/echo.js (100%) rename {fixtures => test/fixtures}/node-flags-path.js (75%) rename {fixtures => test/fixtures}/node-flags.js (66%) rename {fixtures => test/fixtures}/node-version.js (63%) rename {fixtures => test/fixtures}/shebang.js (100%) rename {fixtures => test/fixtures}/spawnecho.cmd (100%) rename {fixtures => test/fixtures}/test.js (100%) rename {fixtures => test/fixtures}/test.txt (100%) rename test.js => test/index.js (99%) 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 0cf0136..bbbc2f3 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'; @@ -1103,7 +1103,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) {