Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove notifications emitted during pnpm dev #43801

Merged
merged 8 commits into from Dec 7, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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')
jankaifer marked this conversation as resolved.
Show resolved Hide resolved
// 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
}
}