Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class PackageJson {
'bundleDependencies',
'bundleDependenciesDeleteFalse',
'gypfile',
'serverjs',
'scriptpath',
'authors',
'readme',
Expand Down
12 changes: 0 additions & 12 deletions lib/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 0 additions & 22 deletions test/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, ({
Expand Down
Loading