Skip to content

Commit ad69aae

Browse files
Merge pull request #80 from userfrosting/feature-native-esm
Switch to plain ESM
2 parents 93c8d2c + bfc7821 commit ad69aae

28 files changed

Lines changed: 309 additions & 1119 deletions

.github/workflows/ci.yml

Lines changed: 40 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,40 @@
1-
{
2-
"name": "Continuous Integration",
3-
"on": {
4-
# Every push
5-
"push": {},
6-
"schedule": [
7-
{
8-
# Every Monday and Thursday at 12PM UTC
9-
"cron": "0 12 * * 1,4"
10-
}
11-
]
12-
},
13-
"jobs": {
14-
"test": {
15-
"strategy": {
16-
"matrix": {
17-
"os": [
18-
"ubuntu-latest",
19-
"macos-latest",
20-
"windows-latest"
21-
],
22-
"node-version": [
23-
"10.x",
24-
"12.x",
25-
"13.x"
26-
]
27-
}
28-
},
29-
"runs-on": "${{ matrix.os }}",
30-
"steps": [
31-
{
32-
"name": "Checkout",
33-
"uses": "actions/checkout@v1"
34-
},
35-
{
36-
"name": "Setup node",
37-
"uses": "actions/setup-node@v1",
38-
"with": {
39-
"node-version": "${{ matrix.node-version }}"
40-
}
41-
},
42-
{
43-
"name": "Install dependencies",
44-
"run": "npm ci"
45-
},
46-
{
47-
"name": "Run tests",
48-
"run": "./node_modules/.bin/nyc --reporter=lcovonly npm test"
49-
},
50-
{
51-
"name": "Push coverage to Codecov",
52-
"uses": "codecov/codecov-action@v1",
53-
"with": {
54-
"token": "${{ secrets.CODECOV_UPLOAD_TOKEN }}"
55-
}
56-
}
57-
]
58-
},
59-
"release-readiness": {
60-
"runs-on": "ubuntu-latest",
61-
"steps": [
62-
{
63-
"name": "Checkout",
64-
"uses": "actions/checkout@v1"
65-
},
66-
{
67-
"name": "Setup node",
68-
"uses": "actions/setup-node@v1",
69-
"with": {
70-
"node-version": "13.x"
71-
}
72-
},
73-
{
74-
"name": "Install cspell",
75-
"run": "npm i -g cspell"
76-
},
77-
{
78-
"name": "Check spelling",
79-
"run": "cspell '**'"
80-
},
81-
{
82-
"name": "Install package dependencies",
83-
"run": "npm ci"
84-
},
85-
{
86-
"name": "Build",
87-
"run": "./node_modules/.bin/tsc"
88-
},
89-
{
90-
"name": "Check for unconfirmed API changes",
91-
"run": "./node_modules/.bin/api-extractor run"
92-
}
93-
]
94-
}
95-
}
96-
}
1+
name: Continuous Integration
2+
on:
3+
# Every push
4+
push:
5+
schedule:
6+
# Every Monday and Thursday at 12PM UTC
7+
- cron: '0 12 * * 1,4'
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
platform: [ ubuntu-latest, macos-latest, windows-latest ]
14+
node-version: [ ^12.17.0, ^13.0.0, ^14.0.0 ]
15+
runs-on: ${{ matrix.platform }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- run: npm ci
22+
- run: ./node_modules/.bin/c8 --reporter=lcovonly npm test
23+
- uses: codecov/codecov-action@v1
24+
with:
25+
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
26+
release-readines:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-node@v1
31+
with:
32+
node-version: ^14.0.0
33+
- name: Install cspell
34+
run: npm i -g cspell
35+
- name: Check spelling
36+
run: cspell '**'
37+
- run: npm ci
38+
- run: ./node_modules/.bin/tsc
39+
- name: Check for unconfirmed API changes
40+
run: ./node_modules/.bin/api-extractor run

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
.nyc_output
55
coverage
66
temp
7+
pnpm-lock.yaml

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!dist/
22
.editorconfig
33
.gitattributes
4-
.nyc_output/
4+
coverage/
55
.travis.yml
66
**/*.test.d.ts
77
**/*.test.js
@@ -14,3 +14,4 @@ temp/
1414
test-data/
1515
tsconfig.json
1616
.github
17+
.dependabot

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Changed
1111
- Updated interface of `BundleOrchestrator._transform` reflecting tighter constraints in `@types/node` v14. No modification to runtime logic, method only used by NodeJS streams.
12-
13-
## [4.0.1] - 2020-04-18
12+
- Removed `esm` loader in favour of native ESM support.
13+
- Raised minimum NodeJS version from 10 to 12.17.0.
14+
- Changed exception type thrown when a configuration merge fails, consequence of changing error wrapper from `errlop` to `@jsdevtools/ono`.
1415

1516
[//]: # (spell-checker:disable)
1617

18+
### Removed
19+
- Removed deprecated export `BundleOrchastrator`.
20+
21+
## [4.0.1] - 2020-04-18
22+
1723
### Fixed
1824
- Missing bundles and files not being logged when stream completes without providing all required files.
1925

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ npm i -D @userfrosting/gulp-bundle-assets
1414

1515
## Usage
1616

17+
> **IMPORTANT**<br/>
18+
> This is an ES module package targeting NodeJS `^12.17.0 || >=13.2.0`, refer to the [NodeJS ESM docs](https://nodejs.org/api/esm.html) regarding how to correctly import.
19+
> ESM loaders like `@babel/loader` or `esm` likely won't work as expected. Using native ESM support in Gulp is recommended (once it lands [gulpjs/gulp-cli#214](https://github.com/gulpjs/gulp-cli/pull/214), [gulpjs/interpret#65](https://github.com/gulpjs/interpret/issues/65))
20+
1721
```js
18-
// gulpfile.esm.js
22+
// gulpfile.mjs
1923
import AssetBundler from "@userfrosting/gulp-bundle-assets";
20-
import { src, dest } from "gulp";
24+
import Gulp from "gulp";
2125
import cleanCss from "gulp-clean-css";
2226
import concatCss from "gulp-concat-css";
2327
import uglify from "gulp-uglify";
@@ -53,9 +57,9 @@ export function bundle() {
5357
}
5458
};
5559

56-
return src("src/**")
60+
return Gulp.src("src/**")
5761
.pipe(new AssetBundler(config, joiner))
58-
.pipe(dest("public/assets/"));
62+
.pipe(Gulp.dest("public/assets/"));
5963
}
6064
```
6165

cspell.json

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/v5.0.1-alpha.3/cspell.schema.json",
32
"version": "0.1",
3+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/v5.0.1-alpha.3/cspell.schema.json",
44
"language": "en-US",
55
"words": [
6-
"narthollis",
7-
"Zaleski",
6+
"backported",
7+
"bytecode",
88
"gregorymaertens",
9+
"jcarrivick",
10+
"jsdevtools",
11+
"lockfiles",
912
"Mele",
13+
"narthollis",
1014
"Sherland",
1115
"Soares",
12-
"jcarrivick",
13-
"bytecode",
14-
"backported",
15-
"lockfiles"
16+
"Zaleski"
1617
],
1718
"ignoreWords": [
18-
"userfrosting",
19-
"errlop",
20-
"preversion",
21-
"postversion",
19+
"automerged",
2220
"codecov",
23-
"vpath",
24-
"gulpplugin",
21+
"errlop",
2522
"gulpfile",
26-
"automerged"
23+
"gulpjs",
24+
"gulpplugin",
25+
"lcovonly",
26+
"postversion",
27+
"preversion",
28+
"userfrosting",
29+
"vpath"
2730
],
2831
"ignorePaths": [
2932
"cspell.json",

docs/api-extractor/api-report.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
```ts
66

7-
import { Logger } from 'ts-log';
87
import { Readable } from 'stream';
98
import { Stream } from 'stream';
109
import { Transform } from 'stream';
1110
import { TransformCallback } from 'stream';
11+
import TsLog from 'ts-log';
1212
import Vinyl from 'vinyl';
1313

1414
// @public
@@ -29,8 +29,6 @@ class BundleOrchestrator extends Transform {
2929
_transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): Promise<void>;
3030
}
3131

32-
export { BundleOrchestrator as BundleOrchastrator }
33-
3432
export { BundleOrchestrator }
3533

3634
export default BundleOrchestrator;
@@ -65,7 +63,7 @@ export enum CollisionReactions {
6563
export interface Config {
6664
bundle?: Bundles;
6765
cwd?: string;
68-
Logger?: Logger;
66+
Logger?: TsLog.Logger;
6967
}
7068

7169
// @public

0 commit comments

Comments
 (0)