diff --git a/lib/index.js b/lib/index.js index adcbac6..e75270a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -56,7 +56,6 @@ class PackageJson { 'bundleDependencies', 'bundleDependenciesDeleteFalse', 'gypfile', - 'serverjs', 'scriptpath', 'authors', 'readme', diff --git a/lib/normalize.js b/lib/normalize.js index 0388220..217e0e7 100644 --- a/lib/normalize.js +++ b/lib/normalize.js @@ -401,18 +401,6 @@ async function asyncSteps (pkg, { steps, root, changes }) { } } - // add "start" attribute if "server.js" exists - if (steps.includes('serverjs') && !scripts.start) { - try { - await fs.access(path.join(pkg.path, 'server.js')) - scripts.start = 'node server.js' - data.scripts = scripts - changes?.push('"scripts.start" was set to "node server.js"') - } catch { - // do nothing - } - } - // populate "authors" attribute if (steps.includes('authors') && !data.contributors) { try { diff --git a/test/prepare.js b/test/prepare.js index 4003b6f..08ed378 100644 --- a/test/prepare.js +++ b/test/prepare.js @@ -348,28 +348,6 @@ for (const [name, testPrepare] of Object.entries(testMethods)) { t.end() }) - t.test('server.js', t => { - t.test('adds if missing', async t => { - const { content } = await testPrepare(t, ({ - 'package.json': JSON.stringify({}), - 'server.js': 'a file that exists', - })) - t.strictSame(content.scripts, { start: 'node server.js' }) - }) - t.test('keeps existing', async t => { - const { content } = await testPrepare(t, ({ - 'package.json': JSON.stringify({ - scripts: { - start: 'something else', - }, - }), - 'server.js': 'a file that exists', - })) - t.strictSame(content.scripts, { start: 'something else' }) - }) - t.end() - }) - t.test('gypfile', t => { t.test('with install', async t => { const { content } = await testPrepare(t, ({