Skip to content

Commit

Permalink
chore: add rollup 3x to peerDeps (#39)
Browse files Browse the repository at this point in the history
* chore: add rollup 3x to peerDeps

* chore: upgrade rollup devDeps to version 3x

* chore: fix typo error

* chore: remove redundant import

* fix: adding wait
  • Loading branch information
hung-cybo committed Aug 13, 2023
1 parent 2514e86 commit c09f05c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
19 changes: 10 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"acorn": "^8.7.1"
},
"peerDependencies": {
"rollup": "^2.16.1"
"rollup": "^2.16.1 || ^3.x"
},
"devDependencies": {
"@cybozu/eslint-config": "^17.0.1",
Expand All @@ -45,7 +45,7 @@
"jest": "^28.1.0",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"rollup": "^2.74.0",
"rollup": "^3.28.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
}
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/__snapshots__/format.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`format should omit a source code if the error line is over 100 characters 1`] = `
"const is a reverved word
"const is a reserved word
[1:110] aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = () => {}; // bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
`;

exports[`format should return a formatted message 1`] = `
"const is a reverved word
"const is a reserved word
[2:0] const foo = () => {}"
`;

exports[`format should return a formatted message if loc is not defined 1`] = `"const is a reverved word"`;
exports[`format should return a formatted message if loc is not defined 1`] = `"const is a reserved word"`;
6 changes: 3 additions & 3 deletions src/__tests__/format.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe("format", () => {
it("should return a formatted message", () => {
const source = "var a = true;\nconst foo = () => {}";
const error = {
message: "const is a reverved word",
message: "const is a reserved word",
loc: {
line: 2,
column: 0,
Expand All @@ -15,14 +15,14 @@ describe("format", () => {
it("should return a formatted message if loc is not defined", () => {
const source = "var a = true;\nconst foo = () => {}";
const error = {
message: "const is a reverved word",
message: "const is a reserved word",
};
expect(format(error, source)).toMatchSnapshot();
});
it("should omit a source code if the error line is over 100 characters", () => {
const source = `var ${"a".repeat(100)} = () => {}; // ${"b".repeat(200)}`;
const error = {
message: "const is a reverved word",
message: "const is a reserved word",
loc: {
line: 1,
column: 110,
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ describe("index", () => {
};
const outputOptions = {};
const bundle = await rollup(inputOptions);
expect(bundle.generate(outputOptions)).resolves.not.toThrow();
await expect(bundle.generate(outputOptions)).resolves.not.toThrow();
});
});
2 changes: 0 additions & 2 deletions src/format.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { RollupError } from "rollup";

export const format = (
error: { message: string; loc?: { line: number; column: number } },
source: string
Expand Down

0 comments on commit c09f05c

Please sign in to comment.