Skip to content

Commit 22d7887

Browse files
committed
Switching to esbuild (wip)
1 parent dcde426 commit 22d7887

File tree

95 files changed

+160
-1688
lines changed

Some content is hidden

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

95 files changed

+160
-1688
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ jobs:
77
strategy:
88
matrix:
99
node-version:
10-
- 10.x
1110
- 12.x
11+
- 14.x
12+
- 16.x
1213
steps:
1314
- uses: actions/checkout@v1
1415
- uses: actions/setup-node@v1

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@ faucet-pipeline-js version history
22
==================================
33

44

5+
v3.0.0
6+
------
7+
8+
_unreleased_
9+
10+
* Switch from rollup to esbuild
11+
* Support for TypeScript, JSX and minification built-in (no plugin required)
12+
* ESM is the default output format
13+
* `--compact` defaults to minify, mangle remains opt-in
14+
* Drop support for:
15+
* transpilation to pre-ES6 code
16+
* UMD, CJS and IIFE output format (only ESM is supported)
17+
18+
519
v2.1.6
620
------
721

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ Contributing
1919
Release Process
2020
---------------
2121

22-
1. ensure dependencies are up to date (→ `./bin/update-pkg`)
23-
2. ensure all meta-packages use the same version number (i.e.
24-
`pkg/*/package.json`, both WRT `version` field and faucet-js `dependencies`)
25-
3. `./bin/release`, skipping dependencies' installation (due to meta-packages;
26-
thus the manual first step)
22+
Run `./release`
2723

2824

2925
License

bin/release

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

bin/update-pkg

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

bin/validate-dependencies

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

greenkeeper.json

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

lib/bundle.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use strict";
2+
3+
let esbuild = require("esbuild");
4+
let { abort } = require("faucet-pipeline-core/lib/util");
5+
6+
module.exports = class Bundle {
7+
constructor(entryPoint, target, { format, fingerprint, compact, jsx }) {
8+
if(format && format !== "esm") {
9+
abort(`Unsupported format ${format}`);
10+
}
11+
12+
this.target = target;
13+
this.fingerprint = fingerprint;
14+
15+
this.config = {
16+
entryPoints: [entryPoint],
17+
bundle: true,
18+
format: "esm",
19+
write: false,
20+
charset: "utf8",
21+
metafile: true,
22+
minifyWhitespace: !!compact,
23+
minifyIdentifiers: compact === "mangle",
24+
outdir: "out",
25+
jsxFactory: jsx && jsx.pragma,
26+
jsxFragment: jsx && jsx.fragment
27+
};
28+
}
29+
30+
// TODO: skip if files are not relevant
31+
// via: Object.keys(res.metafile.inputs);
32+
async compile(filepaths) {
33+
let result = esbuild.buildSync(this.config);
34+
35+
// TODO: write error if error occurred
36+
// TODO: outputFiles is an array of all files that would have been written
37+
return {
38+
code: result.outputFiles[0].text
39+
};
40+
}
41+
};

lib/bundle/babel.js

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

lib/bundle/basic.js

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

0 commit comments

Comments
 (0)