Skip to content

Commit

Permalink
Remove notifications emitted during pnpm dev (#43801)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 7, 2022
1 parent 16cf9a8 commit aa7cdf3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 72 deletions.
5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -152,8 +152,8 @@
"glob": "7.1.6",
"gzip-size": "5.1.1",
"html-validator": "5.1.18",
"husky": "8.0.0",
"http-proxy": "1.18.1",
"husky": "8.0.0",
"image-size": "0.9.3",
"is-animated": "2.0.2",
"isomorphic-unfetch": "3.0.0",
Expand All @@ -171,7 +171,6 @@
"nanoid": "3.1.30",
"next": "workspace:*",
"node-fetch": "2.6.7",
"node-notifier": "8.0.1",
"npm-run-all": "4.1.5",
"nprogress": "0.2.0",
"pixrem": "5.0.0",
Expand Down Expand Up @@ -217,9 +216,9 @@
"typescript": "4.8.2",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
"whatwg-fetch": "3.0.0",
"webpack": "5.74.0",
"webpack-bundle-analyzer": "4.7.0",
"whatwg-fetch": "3.0.0",
"ws": "8.2.3"
},
"resolutions": {
Expand Down
35 changes: 0 additions & 35 deletions packages/next/taskfile.js
@@ -1,6 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const notifier = require('node-notifier')
// eslint-disable-next-line import/no-extraneous-dependencies
const { relative, basename, resolve, join, dirname } = require('path')
// eslint-disable-next-line import/no-extraneous-dependencies
const glob = require('glob')
Expand Down Expand Up @@ -2130,31 +2128,27 @@ export async function bin(task, opts) {
.source(opts.src || 'bin/*')
.swc('server', { stripExtension: true, dev: opts.dev })
.target('dist/bin', { mode: '0755' })
notify('Compiled binaries')
}

export async function cli(task, opts) {
await task
.source('cli/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/cli')
notify('Compiled cli files')
}

export async function lib(task, opts) {
await task
.source(opts.src || 'lib/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/lib')
notify('Compiled lib files')
}

export async function lib_esm(task, opts) {
await task
.source(opts.src || 'lib/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev, esm: true })
.target('dist/esm/lib')
notify('Compiled lib files')
}

export async function server(task, opts) {
Expand All @@ -2167,16 +2161,13 @@ export async function server(task, opts) {
join(__dirname, 'server/google-font-metrics.json'),
join(__dirname, 'dist/server/google-font-metrics.json')
)

notify('Compiled server files')
}

export async function server_esm(task, opts) {
await task
.source(opts.src || 'server/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev, esm: true })
.target('dist/esm/server')
notify('Compiled server files to ESM')
}

export async function nextbuild(task, opts) {
Expand All @@ -2186,7 +2177,6 @@ export async function nextbuild(task, opts) {
})
.swc('server', { dev: opts.dev })
.target('dist/build')
notify('Compiled build files')
}

export async function nextbuild_esm(task, opts) {
Expand All @@ -2196,7 +2186,6 @@ export async function nextbuild_esm(task, opts) {
})
.swc('server', { dev: opts.dev, esm: true })
.target('dist/esm/build')
notify('Compiled build files to ESM')
}

export async function nextbuildjest(task, opts) {
Expand All @@ -2206,23 +2195,20 @@ export async function nextbuildjest(task, opts) {
})
.swc('server', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/build/jest')
notify('Compiled build/jest files')
}

export async function client(task, opts) {
await task
.source(opts.src || 'client/**/*.+(js|ts|tsx)')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/client')
notify('Compiled client files')
}

export async function client_esm(task, opts) {
await task
.source(opts.src || 'client/**/*.+(js|ts|tsx)')
.swc('client', { dev: opts.dev, esm: true })
.target('dist/esm/client')
notify('Compiled client files to ESM')
}

// export is a reserved keyword for functions
Expand All @@ -2231,7 +2217,6 @@ export async function nextbuildstatic(task, opts) {
.source(opts.src || 'export/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
notify('Compiled export files')
}

export async function pages_app(task, opts) {
Expand Down Expand Up @@ -2300,15 +2285,13 @@ export async function telemetry(task, opts) {
.source(opts.src || 'telemetry/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
notify('Compiled telemetry files')
}

export async function trace(task, opts) {
await task
.source(opts.src || 'trace/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/trace')
notify('Compiled trace files')
}

export async function build(task, opts) {
Expand Down Expand Up @@ -2370,7 +2353,6 @@ export async function shared(task, opts) {
)
.swc('client', { dev: opts.dev })
.target('dist/shared')
notify('Compiled shared files')
}

export async function shared_esm(task, opts) {
Expand All @@ -2380,7 +2362,6 @@ export async function shared_esm(task, opts) {
)
.swc('client', { dev: opts.dev, esm: true })
.target('dist/esm/shared')
notify('Compiled shared files to ESM')
}

export async function shared_re_exported(task, opts) {
Expand All @@ -2391,7 +2372,6 @@ export async function shared_re_exported(task, opts) {
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/shared')
notify('Compiled shared re-exported files')
}

export async function shared_re_exported_esm(task, opts) {
Expand All @@ -2404,27 +2384,12 @@ export async function shared_re_exported_esm(task, opts) {
esm: true,
})
.target('dist/esm/shared')
notify('Compiled shared re-exported files as ESM')
}

export async function server_wasm(task, opts) {
await task.source(opts.src || 'server/**/*.+(wasm)').target('dist/server')
notify('Moved server wasm files')
}

export async function release(task) {
await task.clear('dist').start('build')
}

// notification helper
function notify(msg) {
try {
notifier.notify({
title: '▲ Next',
message: msg,
icon: false,
})
} catch (err) {
// notifier can fail on M1 machines
}
}
43 changes: 9 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aa7cdf3

Please sign in to comment.