Skip to content

Commit

Permalink
remove sander
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Dec 27, 2021
1 parent 3feb343 commit 8c9bd6d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
2 changes: 1 addition & 1 deletion cli/run/watch-cli.ts
Expand Up @@ -26,7 +26,7 @@ export async function watch(command: Record<string, any>): Promise<void> {
const configFile = command.config ? getConfigPath(command.config) : null;

onExit(close);
process.on('uncaughtException' as any, close);
process.on('uncaughtException', close);
if (!process.stdin.isTTY) {
process.stdin.on('end', close);
process.stdin.resume();
Expand Down
31 changes: 0 additions & 31 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -108,7 +108,6 @@
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-thatworks": "^1.0.4",
"sander": "^0.6.0",
"shx": "^0.3.3",
"signal-exit": "^3.0.6",
"source-map": "^0.7.3",
Expand Down
4 changes: 2 additions & 2 deletions src/watch/watch.ts
@@ -1,4 +1,4 @@
import * as path from 'path';
import { resolve } from 'path';
import { createFilter } from '@rollup/pluginutils';
import { rollupInternal } from '../rollup/rollup';
import {
Expand Down Expand Up @@ -140,7 +140,7 @@ export class Task {
this.options = mergeOptions(config);
this.outputs = this.options.output;
this.outputFiles = this.outputs.map(output => {
if (output.file || output.dir) return path.resolve(output.file || output.dir!);
if (output.file || output.dir) return resolve(output.file || output.dir!);
return undefined as never;
});

Expand Down
11 changes: 5 additions & 6 deletions test/watch/index.js
Expand Up @@ -3,7 +3,6 @@ const { promises } = require('fs');
const { resolve } = require('path');
const process = require('process');
const { copy, pathExists, remove } = require('fs-extra');
const sander = require('sander');
const rollup = require('../../dist/rollup');

const cwd = process.cwd();
Expand Down Expand Up @@ -1090,7 +1089,7 @@ describe('rollup.watch', () => {
it('runs transforms again on previously erroring files that were changed back', () => {
const brokenFiles = new Set();
const INITIAL_CONTENT = 'export default 42;';
sander.writeFileSync('test/_tmp/input/main.js', INITIAL_CONTENT);
await promises.writeFile('test/_tmp/input/main.js', INITIAL_CONTENT);
watcher = rollup.watch({
input: 'test/_tmp/input/main.js',
plugins: {
Expand Down Expand Up @@ -1119,15 +1118,15 @@ describe('rollup.watch', () => {
'BUNDLE_START',
'BUNDLE_END',
'END',
() => {
async () => {
assert.strictEqual(run('../_tmp/output/bundle.js'), 42);
sander.writeFileSync('test/_tmp/input/main.js', 'export default "broken";');
await promises.writeFile('test/_tmp/input/main.js', 'export default "broken";');
},
'START',
'BUNDLE_START',
'ERROR',
() => {
sander.writeFileSync('test/_tmp/input/main.js', INITIAL_CONTENT);
async () => {
await promises.writeFile('test/_tmp/input/main.js', INITIAL_CONTENT);
},
'START',
'BUNDLE_START',
Expand Down

0 comments on commit 8c9bd6d

Please sign in to comment.