-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use prettier defaults other than tabWidth
- Loading branch information
Showing
8 changed files
with
118 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
packages/rollup-plugin/src/__tests__/fixtures/plugin/Component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
packages/rollup-plugin/src/__tests__/fixtures/plugin/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import Test from './Component'; | ||
import Test from "./Component"; | ||
|
||
export default { | ||
name: 'myPlugin', | ||
name: "myPlugin", | ||
actions: { | ||
setValues(payload) { | ||
return { | ||
type: 'MYPLUGIN_SET_VALUES', | ||
payload | ||
type: "MYPLUGIN_SET_VALUES", | ||
payload, | ||
}; | ||
} | ||
}, | ||
}, | ||
reducer(state, action) { | ||
switch (action.type) { | ||
case 'MYPLUGIN_SET_VALUES': | ||
case "MYPLUGIN_SET_VALUES": | ||
return { values: action.payload }; | ||
default: | ||
return state || { values: [] }; | ||
} | ||
}, | ||
components: { | ||
Test | ||
} | ||
Test, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/rollup-plugin/src/__tests__/fixtures/project/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import app from '@wq/app'; | ||
import material from '@wq/material'; | ||
import mapgl from '@wq/map-gl'; | ||
import myPlugin from './plugin.js'; | ||
import app from "@wq/app"; | ||
import material from "@wq/material"; | ||
import mapgl from "@wq/map-gl"; | ||
import myPlugin from "./plugin.js"; | ||
|
||
app.use([material, mapgl, myPlugin]); |
10 changes: 5 additions & 5 deletions
10
packages/rollup-plugin/src/__tests__/fixtures/project/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { modules } from './wq.js'; | ||
import myPlugin from './plugin.js'; | ||
import { modules } from "./wq.js"; | ||
import myPlugin from "./plugin.js"; | ||
|
||
const { '@wq/app': app } = modules; | ||
const { "@wq/app": app } = modules; | ||
|
||
const { '@wq/material': material } = modules; | ||
const { "@wq/material": material } = modules; | ||
const materialPlugin = material.default; | ||
|
||
const { '@wq/map-gl': mapgl } = modules; | ||
const { "@wq/map-gl": mapgl } = modules; | ||
const mapglPlugin = mapgl.default; | ||
|
||
app.use([materialPlugin, mapglPlugin, myPlugin]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
import { rollup } from 'rollup'; | ||
import wqBundle from '../index.js'; | ||
import babel from '@rollup/plugin-babel'; | ||
import prettier from 'rollup-plugin-prettier'; | ||
import util from 'util'; | ||
import fs from 'fs'; | ||
import { rollup } from "rollup"; | ||
import wqBundle from "../index.js"; | ||
import babel from "@rollup/plugin-babel"; | ||
import prettier from "rollup-plugin-prettier"; | ||
import util from "util"; | ||
import fs from "fs"; | ||
|
||
const readFile = util.promisify(fs.readFile); | ||
|
||
process.chdir(__dirname); | ||
|
||
test('plugin', async () => { | ||
test("plugin", async () => { | ||
const bundle = await rollup({ | ||
input: 'fixtures/plugin/input.js', | ||
input: "fixtures/plugin/input.js", | ||
treeshake: { | ||
propertyReadSideEffects: false | ||
propertyReadSideEffects: false, | ||
}, | ||
plugins: [ | ||
wqBundle(), | ||
babel({ | ||
plugins: ['@babel/transform-react-jsx'], | ||
babelHelpers: 'inline' | ||
plugins: ["@babel/transform-react-jsx"], | ||
babelHelpers: "inline", | ||
}), | ||
prettier() | ||
] | ||
prettier(), | ||
], | ||
}), | ||
output = await bundle.generate({ | ||
file: 'output.js', | ||
format: 'esm' | ||
file: "output.js", | ||
format: "esm", | ||
}), | ||
expected = await readFile('fixtures/plugin/output.js', 'utf8'); | ||
expected = await readFile("fixtures/plugin/output.js", "utf8"); | ||
|
||
expect(output.output[0].code).toBe(expected); | ||
}); | ||
|
||
test('project', async () => { | ||
test("project", async () => { | ||
const bundle = await rollup({ | ||
input: 'fixtures/project/input.js', | ||
input: "fixtures/project/input.js", | ||
treeshake: { | ||
propertyReadSideEffects: false | ||
propertyReadSideEffects: false, | ||
}, | ||
external: ['./plugin.js'], | ||
external: ["./plugin.js"], | ||
plugins: [ | ||
wqBundle(), | ||
babel({ | ||
plugins: ['@babel/transform-react-jsx'], | ||
babelHelpers: 'inline' | ||
plugins: ["@babel/transform-react-jsx"], | ||
babelHelpers: "inline", | ||
}), | ||
prettier() | ||
] | ||
prettier(), | ||
], | ||
}), | ||
output = await bundle.generate({ | ||
file: 'output.js', | ||
format: 'esm' | ||
file: "output.js", | ||
format: "esm", | ||
}), | ||
expected = await readFile('fixtures/project/output.js', 'utf8'); | ||
expected = await readFile("fixtures/project/output.js", "utf8"); | ||
|
||
expect(output.output[0].code).toBe(expected); | ||
}); |
Oops, something went wrong.