Skip to content

Commit

Permalink
refactor: additional script cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser committed Jul 6, 2021
1 parent 1e00564 commit b2b2a97
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
9 changes: 5 additions & 4 deletions __snapshots__/packages-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ exports['packages can copy files from package.json 1'] = {
"tmp": {
"packages": {
"coffee": {
"package.json": "{\"main\":\"src/main.js\", \"name\": \"foo\", \"files\": [\"lib\"]}",
"lib": {
"foo.js": "{}"
},
"src": {
"main.js": "console.log()"
},
"lib": {
"foo.js": "{}"
}
"package.json": "{\n \"main\": \"src/main.js\",\n \"name\": \"foo\",\n \"files\": [\n \"lib\"\n ]\n}\n"
}
}
}
}


exports['transformRequires can find and replace symlink requires 1'] = {
"[cwd]": {
"build": {
Expand Down
13 changes: 13 additions & 0 deletions scripts/after-pack-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs-extra')
const { join } = require('path')
const globby = require('globby')
const os = require('os')
const path = require('path')

module.exports = async function (params) {
console.log('****************************')
Expand Down Expand Up @@ -36,5 +37,17 @@ module.exports = async function (params) {
await fs.copy(sourceFolder, destinationFolder)
}

const distNodeModules = path.join(params.packager.info._appDir, 'node_modules')
const appNodeModules = path.join(outputFolder, 'node_modules')

console.log('copying ', distNodeModules, ' to', appNodeModules)

await fs.copy(distNodeModules, appNodeModules)

// const packages = await globby('packages/*/node_modules', {
// cwd: params.packager.info._appDir,
// onlyFiles: false,
// })

console.log('all node_modules subfolders copied to', outputFolder)
}
7 changes: 1 addition & 6 deletions scripts/binary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ const deploy = {

parseOptions (argv) {
const opts = minimist(argv, {
boolean: ['skip-clean'],
default: {
'skip-clean': false,
},
alias: {
skipClean: 'skip-clean',
zip: ['zipFile', 'zip-file', 'filename'],
},
})
Expand Down Expand Up @@ -238,7 +233,7 @@ const deploy = {
.then(() => {
debug('building binary: platform %s version %s', options.platform, options.version)

return build(options.platform, options.version, options)
return build.buildCypressApp(options)
})
},

Expand Down
3 changes: 1 addition & 2 deletions scripts/unit/binary/util/packages-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ describe('packages', () => {
.resolves(['./packages/coffee'])

globbyStub
.withArgs(['package.json', 'lib', 'src/main.js'])
.withArgs(['lib', 'src/main.js'])
.resolves([
'package.json',
'lib/foo.js',
'src/main.js',
])
Expand Down

0 comments on commit b2b2a97

Please sign in to comment.