Skip to content

Commit 35474d7

Browse files
committed
feature: @putout/esm: add
1 parent 9887352 commit 35474d7

File tree

164 files changed

+466
-1114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+466
-1114
lines changed

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,12 +2114,6 @@ It has a lot of plugins divided by groups:
21142114
| [`@putout/plugin-apply-overrides`](/packages/plugin-apply-overrides#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-apply-overrides.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-apply-overrides) |
21152115
| [`@putout/plugin-apply-shorthand-properties`](/packages/plugin-apply-shorthand-properties#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-apply-shorthand-properties.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-apply-shorthand-properties) |
21162116

2117-
### Sorters
2118-
2119-
| Package | Version |
2120-
|--------|-------|
2121-
| [`@putout/plugin-sort-imports-by-specifiers`](/packages/plugin-sort-imports-by-specifiers#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-sort-imports-by-specifiers.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-sort-imports-by-specifiers) |
2122-
21232117
### Splitters
21242118

21252119
| Package | Version |
@@ -2133,7 +2127,6 @@ It has a lot of plugins divided by groups:
21332127
| Package | Version |
21342128
|--------|-------|
21352129
| [`@putout/plugin-merge-destructuring-properties`](/packages/plugin-merge-destructuring-properties#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-merge-destructuring-properties.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-merge-destructuring-properties) |
2136-
| [`@putout/plugin-merge-duplicate-imports`](/packages/plugin-merge-duplicate-imports#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-merge-duplicate-imports.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-merge-duplicate-imports) |
21372130
| [`@putout/plugin-merge-duplicate-functions`](/packages/plugin-merge-duplicate-functions#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-merge-duplicate-functions.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-merge-duplicate-functions) |
21382131

21392132
### Converters
@@ -2190,7 +2183,6 @@ It has a lot of plugins divided by groups:
21902183
| [`@putout/plugin-remove-console`](/packages/plugin-remove-console#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-remove-console.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-remove-console) |
21912184
| [`@putout/plugin-remove-empty`](/packages/plugin-remove-empty#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-remove-empty.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-remove-empty) |
21922185
| [`@putout/plugin-remove-nested-blocks`](/packages/plugin-remove-nested-blocks#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-remove-nested-blocks.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-remove-nested-blocks) |
2193-
| [`@putout/plugin-remove-quotes-from-import-assertions`](/packages/plugin-remove-quotes-from-import-assertions#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-remove-quotes-from-import-assertions.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-remove-quotes-from-import-assertions) |
21942186

21952187
### Simplifiers
21962188

@@ -2205,16 +2197,16 @@ It has a lot of plugins divided by groups:
22052197
| Package | Version |
22062198
|--------|-------|
22072199
| [`@putout/plugin-declare`](/packages/plugin-declare#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-declare.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-declare) |
2208-
| [`@putout/plugin-declare-imports-first`](/packages/plugin-declare-imports-first#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-declare-imports-first.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-declare-imports-first) |
22092200
| [`@putout/plugin-declare-before-reference`](/packages/plugin-declare-before-reference#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-declare-before-reference.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-declare-before-reference) |
22102201

22112202
### Groups
22122203

22132204
| Package | Version |
22142205
|--------|-------|
2206+
| [`@putout/plugin-conditions`](/packages/plugin-conditions#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-conditions.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-conditions) |
2207+
| [`@putout/plugin-esm`](/packages/plugin-esm#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-esm.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-esm) |
22152208
| [`@putout/plugin-filesystem`](/packages/plugin-filesystem#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-filesystem.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-filesystem) |
22162209
| [`@putout/plugin-for-of`](/packages/plugin-for-of#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-for-of.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-for-of) |
2217-
| [`@putout/plugin-conditions`](/packages/plugin-conditions#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-conditions.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-conditions) |
22182210
| [`@putout/plugin-types`](/packages/plugin-types#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-types.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-types) |
22192211
| [`@putout/plugin-labels`](/packages/plugin-labels#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-labels.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-labels) |
22202212
| [`@putout/plugin-math`](/packages/plugin-math#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-math.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-math) |
@@ -2261,12 +2253,6 @@ It has a lot of plugins divided by groups:
22612253
|--------|-------|
22622254
| [`@putout/plugin-add-parens`](/packages/plugin-add-parens#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-add-parens.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-add-parens) |
22632255

2264-
### Groupers
2265-
2266-
| Package | Version |
2267-
|--------|-------|
2268-
| [`@putout/plugin-group-imports-by-source`](/packages/plugin-group-imports-by-source#readme) | [![npm](https://img.shields.io/npm/v/@putout/plugin-group-imports-by-source.svg?maxAge=86400)](https://www.npmjs.com/package/@putout/plugin-group-imports-by-source) |
2269-
22702256
### Not bundled
22712257

22722258
Next packages not bundled with 🐊**Putout** but can be installed separately.

packages/engine-runner/test/replace.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,12 @@ test('putout: runner: replace: watermark after remove', (t) => {
858858

859859
const {code} = putout(source, {
860860
runPlugins,
861+
rules: {
862+
'esm': 'off',
863+
'esm/merge-duplicate-imports': 'on',
864+
},
861865
plugins: [
862-
'merge-duplicate-imports',
866+
'esm',
863867
['remove', remove],
864868
],
865869
});

packages/engine-runner/test/runner.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test('putout: runner: run plugins', (t) => {
2727
runPlugins,
2828
plugins: [
2929
'remove-unused-variables',
30-
'remove-empty',
30+
'esm',
3131
],
3232
});
3333

@@ -871,7 +871,11 @@ test('putout: runner: fix: crawl', (t) => {
871871

872872
const {code} = putout(source, {
873873
runPlugins,
874-
plugins: ['declare', 'merge-duplicate-imports'],
874+
rules: {
875+
'esm': 'off',
876+
'esm/merge-duplicate-imports': 'on',
877+
},
878+
plugins: ['declare', 'esm'],
875879
});
876880

877881
const expected = montag`

packages/operator-declare/lib/declare.spec.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,13 @@ test('putout: operator: declare: cache', (t) => {
116116
`;
117117

118118
const {code: secondAttempt} = putout(source, {
119+
rules: {
120+
'esm': 'off',
121+
'esm/merge-duplicate-imports': 'on',
122+
},
119123
plugins: [
120124
['declare', declare(declarations)],
121-
'merge-duplicate-imports',
125+
'esm',
122126
],
123127
});
124128

@@ -153,9 +157,13 @@ test('putout: operator: declare: strict mode', (t) => {
153157
`;
154158

155159
const {code: secondAttempt} = putout(source, {
160+
rules: {
161+
'esm': 'off',
162+
'esm/merge-duplicate-imports': 'on',
163+
},
156164
plugins: [
157165
['declare', declare(declarations)],
158-
'merge-duplicate-imports',
166+
'esm',
159167
],
160168
});
161169

packages/operator-declare/lib/recast.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ test('putout: operator: declare: recast: strict mode', (t) => {
2525
const {code: secondAttempt} = putout(source, {
2626
printer: 'recast',
2727
plugins: [
28+
'esm',
29+
'strict-mode',
2830
['declare', declare(declarations)],
29-
'merge-duplicate-imports',
3031
],
3132
});
3233

3334
const expected = montag`
34-
'use strict';
3535
import {test, stub} from 'supertape';
3636
3737
test('', (t) => {

packages/plugin-declare-imports-first/.eslintrc.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/plugin-declare-imports-first/.madrun.mjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/plugin-declare-imports-first/.putout.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/plugin-declare-imports-first/README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

packages/plugin-declare-imports-first/package.json

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)