Skip to content

Commit

Permalink
Remove dual-publish plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 23, 2023
1 parent 6a3d9f3 commit 99308fa
Show file tree
Hide file tree
Showing 19 changed files with 14 additions and 267 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,17 +472,13 @@ Plugins:
about your library is of this size to show the cost of all your
dependencies.
* `@size-limit/time` uses headless Chrome to track time to execute JS.
* `@size-limit/dual-publish` compiles files to ES modules with [`dual-publish`]
to check size after tree-shaking.

Plugin presets:

* `@size-limit/preset-app` contains `file` and `time` plugins.
* `@size-limit/preset-big-lib` contains `webpack`, `file`, and `time` plugins.
* `@size-limit/preset-small-lib` contains `esbuild` and `file` plugins.

[`dual-publish`]: https://github.com/ai/dual-publish


#### Third-Party Plugins

Expand Down
2 changes: 1 addition & 1 deletion fixtures/combine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ const a = 1

const b = 'hfdjhwqndshdsonbavashskd;a[spdkdjsba;sx[cabsdfddf'

module.exports = { a, b }
export { a, b }
2 changes: 0 additions & 2 deletions fixtures/combine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"name": "combine",
"private": true,
"devDependencies": {
"@size-limit/dual-publish": ">= 0.0.0",
"@size-limit/preset-small-lib": ">= 0.0.0",
"dual-publish": ">= 0.0.0",
"size-limit": ">= 0.0.0",
"redux": ">= 0.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions fixtures/integration-esm/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
let { VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING, method } = require('./lib')
import { VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING, method } from './lib'

module.exports = { VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING, method }
export { VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING, method }
6 changes: 2 additions & 4 deletions fixtures/integration-esm/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING = 1
export const VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING = 1

function method() {
export function method() {
console.log('1111111111111111')
}

module.exports = { VERY_LONG_NAME_FOR_CONST_TO_TEST_TREE_SHAKING, method }
2 changes: 0 additions & 2 deletions fixtures/integration-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"private": true,
"devDependencies": {
"@size-limit/preset-small-lib": ">= 0.0.0",
"@size-limit/dual-publish": ">= 0.0.0",
"dual-publish": ">= 0.0.0",
"size-limit": ">= 0.0.0"
},
"size-limit": [
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"devDependencies": {
"@logux/eslint-config": "^52.0.1",
"@size-limit/dual-publish": "workspace:^",
"@size-limit/esbuild": "workspace:^",
"@size-limit/esbuild-why": "workspace:^",
"@size-limit/file": "workspace:^",
Expand All @@ -22,7 +21,6 @@
"@vitest/coverage-v8": "^0.34.6",
"clean-publish": "^4.2.0",
"cross-spawn": "^7.0.3",
"dual-publish": "^3.0.1",
"eslint": "^8.52.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/dual-publish/.npmignore

This file was deleted.

20 changes: 0 additions & 20 deletions packages/dual-publish/LICENSE

This file was deleted.

12 changes: 0 additions & 12 deletions packages/dual-publish/README.md

This file was deleted.

62 changes: 0 additions & 62 deletions packages/dual-publish/index.js

This file was deleted.

32 changes: 0 additions & 32 deletions packages/dual-publish/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dual-publish/test/fixtures/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/dual-publish/test/fixtures/package.json

This file was deleted.

59 changes: 0 additions & 59 deletions packages/dual-publish/test/index.test.js

This file was deleted.

16 changes: 6 additions & 10 deletions packages/size-limit/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ export default async function calc(plugins, config, createSpinner) {
if (plugin['wait' + number] && createSpinner) {
spinner = createSpinner(plugin['wait' + number]).start()
}
if (plugin['step' + number] || plugin['all' + number]) {
if (plugin['step' + number]) {
try {
if (plugin['all' + number]) {
await plugin['all' + number](config)
} else {
await Promise.all(
config.checks.map(i => {
return plugin['step' + number](config, i)
})
)
}
await Promise.all(
config.checks.map(i => {
return plugin['step' + number](config, i)
})
)
} catch (e) {
if (spinner) spinner.error()
throw e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`has error for CLI error 1`] = `
" ERROR  cli-tool error: Module not found
@ multi ./dual-publish-tmp/index.js index[0][39m
@ multi ./tmp/index.js index[0][39m
"
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/size-limit/test/size-limit-error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ it('has error for CLI error', () => {
let err = new SizeLimitError(
'cmdError',
'cli-tool',
'Module not found\n @ multi ./dual-publish-tmp/index.js index[0]'
'Module not found\n @ multi ./tmp/index.js index[0]'
)
expect(print(err)).toMatchSnapshot()
})
Expand Down

0 comments on commit 99308fa

Please sign in to comment.