@putout/bundler 1.1.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog CHANGED
@@ -1,3 +1,20 @@
1
+ 2025.03.25, v2.0.0
2
+
3
+ feature:
4
+ - 368afc8 @putout/bundler: supertape v11.0.4
5
+ - abee8e2 @putout/bundler: putout v39.0.13
6
+ - 950cfda @putout/bundler: madrun v11.0.0
7
+ - 3a97c1e @putout/bundler: ignore v7.0.3
8
+ - e23988f @putout/bundler: estree-to-babel v10.5.0
9
+ - ae37f85 @putout/bundler: eslint-plugin-putout v26.1.0
10
+ - ed3ddfd @putout/bundler: c8 v10.1.3
11
+ - 84f9f50 @putout/bundler: @putout/test v13.0.0
12
+ - 030cac2 @putout/bundler: @putout/processor-filesystem v6.0.0
13
+ - 903d934 @putout/bundler: @putout/plugin-nodejs v15.2.0
14
+ - b133bbe @putout/bundler: @putout/plugin-filesystem v9.0.0
15
+ - d752bec @putout/bundler: @putout/operator-filesystem v7.0.0
16
+ - d72d23a @putout/bundler: @putout/engine-runner v24.0.2
17
+
1
18
  2024.04.09, v1.1.1
2
19
 
3
20
  feature:
@@ -11,12 +11,12 @@ const {
11
11
  } = operator;
12
12
 
13
13
  const {
14
- Identifier,
15
- VariableDeclarator,
16
- VariableDeclaration,
17
- StringLiteral,
18
- ObjectProperty,
19
- ObjectExpression,
14
+ objectExpression,
15
+ objectProperty,
16
+ stringLiteral,
17
+ variableDeclaration,
18
+ variableDeclarator,
19
+ identifier,
20
20
  } = types;
21
21
 
22
22
  const createFunction = template('(exports, require, module) => {BODY}');
@@ -33,19 +33,19 @@ const createIIFEE = template(`
33
33
  export const report = () => '';
34
34
 
35
35
  export const fix = (root, {entry, filenames, trackFile}) => {
36
- const object = ObjectExpression([]);
36
+ const object = objectExpression([]);
37
37
 
38
38
  for (const file of trackFile(root, filenames)) {
39
39
  const content = readFileContent(file);
40
40
  const filename = getFilename(file);
41
- const property = ObjectProperty(StringLiteral(filename), createFunction({
41
+ const property = objectProperty(stringLiteral(filename), createFunction({
42
42
  BODY: template.ast(content),
43
43
  }));
44
44
 
45
45
  object.properties.push(property);
46
46
  }
47
47
 
48
- const filesystem = VariableDeclaration('const', [VariableDeclarator(Identifier('__filesystem'), object)]);
48
+ const filesystem = variableDeclaration('const', [variableDeclarator(identifier('__filesystem'), object)]);
49
49
 
50
50
  replaceWith(root.parentPath, createIIFEE({
51
51
  FILESYSTEM: filesystem,
package/lib/bundler.js CHANGED
@@ -6,24 +6,26 @@ import {
6
6
  print,
7
7
  findPlaces,
8
8
  } from 'putout';
9
- import * as pluginParseFilenames from './parse-filenames/index.js';
10
- import * as pluginResolveFilenames from './resolve-filenames/index.js';
11
- import * as pluginBundleFiles from './bundle-files/index.js';
12
9
  import {
13
10
  branch as originalBranch,
14
11
  merge as originalMerge,
15
12
  } from '@putout/processor-filesystem';
13
+ import * as pluginParseFilenames from './parse-filenames/index.js';
14
+ import * as pluginResolveFilenames from './resolve-filenames/index.js';
15
+ import * as pluginBundleFiles from './bundle-files/index.js';
16
16
 
17
17
  const [, replaceCwd] = pluginFilesystem.rules['replace-cwd'];
18
18
  const [, readAllFiles] = pluginFilesystem.rules['read-all-files'];
19
19
 
20
20
  const getMessage = (a) => a.message;
21
21
 
22
- export const bundle = (from, entry, filesystem, {
23
- progress = createProgress(),
24
- branch = originalBranch,
25
- merge = originalMerge,
26
- } = {}) => {
22
+ export const bundle = (from, entry, filesystem, overrides = {}) => {
23
+ const {
24
+ progress = createProgress(),
25
+ branch = originalBranch,
26
+ merge = originalMerge,
27
+ } = overrides;
28
+
27
29
  const [{source}] = branch(filesystem);
28
30
  const ast = parse(source);
29
31
 
@@ -1,5 +1,5 @@
1
- import putout from 'putout';
2
1
  import {dirname} from 'node:path';
2
+ import putout from 'putout';
3
3
  import * as convertEsmToCommonjs from '@putout/plugin-nodejs/convert-esm-to-commonjs';
4
4
  import * as parseRequire from './parse-require/index.js';
5
5
 
@@ -18,7 +18,11 @@ const readExternalStub = returns('');
18
18
  export const report = (root, {file}) => file;
19
19
  export const fix = () => {};
20
20
  export const scan = (root, {push, options}) => {
21
- const {entry = '/index.js', readExternal = readExternalStub} = options;
21
+ const {
22
+ entry = '/index.js',
23
+ readExternal = readExternalStub,
24
+ } = options;
25
+
22
26
  const files = new Set();
23
27
  const processingNames = new Set([entry]);
24
28
 
@@ -1,7 +1,7 @@
1
- import putout, {operator} from 'putout';
2
1
  import {dirname} from 'node:path';
3
- import * as resolveRequire from './resolve-require/index.js';
2
+ import putout, {operator} from 'putout';
4
3
  import * as convertEsmToCommonjs from '@putout/plugin-nodejs/convert-esm-to-commonjs';
4
+ import * as resolveRequire from './resolve-require/index.js';
5
5
 
6
6
  const {
7
7
  writeFileContent,
package/package.json CHANGED
@@ -1,20 +1,17 @@
1
1
  {
2
2
  "name": "@putout/bundler",
3
- "version": "1.1.1",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Lint Filesystem with 🐊Putout",
7
7
  "homepage": "https://github.com/putoutjs/bundler#readme",
8
8
  "main": "./lib/bundler.js",
9
- "bin": {
10
- "bundler": "bin/bundler.js"
11
- },
12
9
  "exports": {
13
10
  ".": "./lib/bundler.js"
14
11
  },
15
12
  "repository": {
16
13
  "type": "git",
17
- "url": "git://github.com/putoutjs/bundler.git"
14
+ "url": "git+https://github.com/putoutjs/bundler.git"
18
15
  },
19
16
  "scripts": {
20
17
  "wisdom": "madrun wisdom",
@@ -32,18 +29,18 @@
32
29
  "dependencies": {
33
30
  "@putout/cli-choose": "^2.0.0",
34
31
  "@putout/cli-filesystem": "^2.0.1",
35
- "@putout/engine-runner": "^21.0.0",
36
- "@putout/operator-filesystem": "^4.0.1",
32
+ "@putout/engine-runner": "^24.0.2",
33
+ "@putout/operator-filesystem": "^7.0.0",
37
34
  "@putout/operator-json": "^2.0.0",
38
- "@putout/plugin-filesystem": "^5.0.0",
39
- "@putout/plugin-nodejs": "^11.0.0",
40
- "@putout/processor-filesystem": "^4.0.0",
35
+ "@putout/plugin-filesystem": "^9.0.0",
36
+ "@putout/plugin-nodejs": "^15.2.0",
37
+ "@putout/processor-filesystem": "^6.0.0",
41
38
  "chalk": "^5.3.0",
42
39
  "enquirer": "^2.4.1",
43
40
  "fullstore": "^3.0.0",
44
- "ignore": "^5.2.4",
41
+ "ignore": "^7.0.3",
45
42
  "ora": "^8.0.1",
46
- "putout": "^35.0.0",
43
+ "putout": "^39.0.13",
47
44
  "strip-ansi": "^7.1.0",
48
45
  "try-to-catch": "^3.0.1"
49
46
  },
@@ -57,16 +54,16 @@
57
54
  "generate"
58
55
  ],
59
56
  "devDependencies": {
60
- "@putout/test": "^9.0.0",
61
- "c8": "^9.1.0",
57
+ "@putout/test": "^13.0.0",
58
+ "c8": "^10.1.3",
62
59
  "eslint": "^9.0.0",
63
- "eslint-plugin-putout": "^22.0.0",
64
- "estree-to-babel": "^9.0.0",
60
+ "eslint-plugin-putout": "^26.1.0",
61
+ "estree-to-babel": "^10.5.0",
65
62
  "just-kebab-case": "^4.2.0",
66
- "madrun": "^10.0.0",
63
+ "madrun": "^11.0.0",
67
64
  "montag": "^1.0.0",
68
65
  "nodemon": "^3.0.1",
69
- "supertape": "^10.0.0",
66
+ "supertape": "^11.0.4",
70
67
  "try-catch": "^3.0.0"
71
68
  },
72
69
  "license": "MIT",
package/bundle.js DELETED
@@ -1,26 +0,0 @@
1
- (() => {
2
- const __filesystem = {
3
- '/example/one.js': (exports, require, module) => {
4
- module.exports = 'hello';
5
- },
6
- '/example/entry.js': (exports, require, module) => {
7
- const one = require('/example/one.js');
8
- console.log(one);
9
- },
10
- };
11
- const __modules = {};
12
- const require = (name) => {
13
- const exports = {};
14
- const module = {
15
- exports,
16
- };
17
- if (__modules[name])
18
- return __modules[name];
19
-
20
- __filesystem[name](exports, require, module);
21
- __modules[name] = module.exports;
22
- return module.exports;
23
- };
24
-
25
- require('/example/entry.js');
26
- })();