Skip to content

Commit

Permalink
Merge pull request #37 from userfrosting/develop
Browse files Browse the repository at this point in the history
Gap in error logging, spelling fixes
  • Loading branch information
Silic0nS0ldier authored Apr 18, 2020
2 parents 2dbfdce + 721fe0d commit 6e55e6e
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 71 deletions.
109 changes: 84 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,84 @@
name: Continuous Integration
on:
# Every push
push:
schedule:
# Every Monday and Thursday at 12PM UTC
- cron: '0 12 * * 1,4'

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
node-version: [ 10.x, 12.x, 13.x ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: ./node_modules/.bin/nyc --reporter=lcovonly npm test
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
{
"name": "Continuous Integration",
"on": {
# Every push
"push": {},
"schedule": [
{
# Every Monday and Thursday at 12PM UTC
"cron": "0 12 * * 1,4"
}
]
},
"jobs": {
"test": {
"strategy": {
"matrix": {
"os": [
"ubuntu-latest",
"macos-latest",
"windows-latest"
],
"node-version": [
"10.x",
"12.x",
"13.x"
]
}
},
"runs-on": "${{ matrix.os }}",
"steps": [
{
"name": "Checkout",
"uses": "actions/checkout@v1"
},
{
"name": "Setup node",
"uses": "actions/setup-node@v1",
"with": {
"node-version": "${{ matrix.node-version }}"
}
},
{
"name": "Install dependencies",
"run": "npm ci"
},
{
"name": "Run tests",
"run": "./node_modules/.bin/nyc --reporter=lcovonly npm test"
},
{
"name": "Push coverage to Codecov",
"uses": "codecov/codecov-action@v1",
"with": {
"token": "${{ secrets.CODECOV_UPLOAD_TOKEN }}"
}
}
]
},
"release-readiness": {
"runs-on": "ubuntu-latest",
"steps": [
{
"name": "Checkout",
"uses": "actions/checkout@v1"
},
{
"name": "Setup node",
"uses": "actions/setup-node@v1",
"with": {
"node-version": "13.x"
}
},
{
"name": "Install cspell",
"run": "npm i -g cspell"
},
{
"name": "Check spelling",
"run": "cspell '**'"
}
]
}
}
}
19 changes: 15 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

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

### Fixed
- Missing bundles and files not being logged when stream completes without providing all required files.

### Changed
- Name of bundle class, existing symbol name preserved to maintain compatibility.
- Deprecated export `BundleOrchastrator` in favour of `BundleOrchestrator`.

[//]: # (spell-checker:enable)

## [4.0.0] - 2020-03-14

## [4.0.0-rc.1] - 2020-02-22
Expand Down Expand Up @@ -36,7 +47,7 @@ This release focuses on improving performance and maintainability. These have be
- Logging interface, now uses [`ts-log`](https://www.npmjs.com/package/ts-log).

### Removed
- Virtual path logic in favour of [`@userfrosting/vinly-fs-vpath`](https://github.com/userfrosting/vinyl-fs-vpath).
- Virtual path logic in favour of [`@userfrosting/vinyl-fs-vpath`](https://github.com/userfrosting/vinyl-fs-vpath).

### Fixed
- Flaw in results API surface, results are now correctly separated according to their type (script/style).
Expand All @@ -63,7 +74,7 @@ This release focuses on simplifying the package for UserFrosting 4 to improve ma
### Added
- Raw configuration validation.
- Raw configuration merging with collision logic (ported from UserFrosting `gulpfile`).
- Path transformation with support for file replacement based on rule order (later rules superseed earlier ones).
- Path transformation with support for file replacement based on rule order (later rules supersede earlier ones).
- Ability to specify base path for resolution of bundle resources and path transformations.
- Support for comprehensive logging through a passed logger function.

Expand All @@ -73,7 +84,7 @@ This release focuses on simplifying the package for UserFrosting 4 to improve ma
- As an internal `gulp` pipeline is no longer responsible for bundle generation, custom `Transform` streams (e.g. `gulp-concat-css`) must be provided.
- Path transformations will no longer be applied to files due to complexity around how paths are managed in `gulp`. Instead this feature will be used for override logic alone.
- Bundle results are now retrieved via a callback which is given a collection of `Vinyl` `NullFiles` to retain as much useful information as possible.
- Moved package under `@userfrosting` organisation in NPM and removed superfluous `uf` from package name.
- Moved package under `@userfrosting` organization in NPM and removed superfluous `uf` from package name.

### Removed
- Support for CSS sourcemaps (broken since 2.27.2).
Expand All @@ -85,7 +96,7 @@ This release focuses on simplifying the package for UserFrosting 4 to improve ma
- Automatic HTML tag generation for results file (use results callback to implement this manually).
- File copy support (use `gulp.dest` or an equivalent).
- Result file support (replaced by callback).
- Removed dependency on `gulp` as per best practises.
- Removed dependency on `gulp` as per best practices.

## [2.28.2] - 2018-02-10

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| master | [![Continuous Integration](https://github.com/userfrosting/gulp-uf-bundle-assets/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/userfrosting/gulp-uf-bundle-assets/actions?query=branch:master+workflow:"Continuous+Integration") [![codecov](https://codecov.io/gh/userfrosting/gulp-uf-bundle-assets/branch/master/graph/badge.svg)](https://codecov.io/gh/userfrosting/gulp-uf-bundle-assets/branch/master) |
| develop | [![Continuous Integration](https://github.com/userfrosting/gulp-uf-bundle-assets/workflows/Continuous%20Integration/badge.svg?branch=develop)](https://github.com/userfrosting/gulp-uf-bundle-assets/actions?query=branch:develop+workflow:"Continuous+Integration") [![codecov](https://codecov.io/gh/userfrosting/gulp-uf-bundle-assets/branch/develop/graph/badge.svg)](https://codecov.io/gh/userfrosting/gulp-uf-bundle-assets/branch/develop) |

Orchastrates JS and CSS bundle creation in an efficient and configurable manner.
Orchestrates JS and CSS bundle creation in an efficient and configurable manner.

## Install

Expand Down Expand Up @@ -68,7 +68,7 @@ $ gulp bundle

The `Bundler` class exposes a `ResultsMap` property containing a Map where the key is the bundle name and value the full path of the generated file. If any transform stream after `Bundler` that changes path names then the results map will no longer be accurate, so use the built in path transforms if possible.

This approach was decided on as it provides the most efficient means to integrate bundles with any system. No need to touch the file system until its absolutely necessary, and less work to optimise the output (e.g. make a `php` file out of it to reduce IO in production by maximising use of bytecode caching).
This approach was decided on as it provides the most efficient means to integrate bundles with any system. No need to touch the file system until its absolutely necessary, and less work to optimise the output (e.g. make a `php` file out of it to reduce IO in production by maximizing use of bytecode caching).

## API

Expand All @@ -79,9 +79,9 @@ The results reside in [docs/api](./docs/api/index.md).

This plugin was originally forked from [gulp-bundle-assets](https://github.com/dowjones/gulp-bundle-assets) to fix a CSS import bug.

It has since been entirely reworked to better suit the requirements of the UserFrosting's Sprinkle system and follow the Gulp plugin guidelines (namely not unncessarily depending on it). Though TypeScript is now the preferred language the output targetted to ES2015 and uses ES Modules (via the `esm` package) to ensure source it can be easily debugged if issues are observed in the wild.
It has since been entirely reworked to better suit the requirements of the UserFrosting's Sprinkle system and follow the Gulp plugin guidelines (namely not unnecessarily depending on it). Though TypeScript is now the preferred language the output targeted to ES2015 and uses ES Modules (via the `esm` package) to ensure source it can be easily debugged if issues are observed in the wild.

This package was previously published under `gulp-uf-bundle-assets` and as of v3 is published under `@userfrosting/gulp-bundle-assets` to assist in longterm project management.
This package was previously published under `gulp-uf-bundle-assets` and as of v3 is published under `@userfrosting/gulp-bundle-assets` to assist in long-term project management.

As of v4 virtual path logic was extracted into a separate package [@userfrosting/vinyl-fs-vpath](https://github.com/userfrosting/vinyl-fs-vpath). This change enabled a significant simplification of core logic along with a significantly faster and more efficient way to support virtual path mappings.

Expand Down
34 changes: 34 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/v5.0.1-alpha.3/cspell.schema.json",
"version": "0.1",
"language": "en-US",
"words": [
"narthollis",
"Zaleski",
"gregorymaertens",
"Mele",
"Sherland",
"Soares",
"jcarrivick",
"bytecode",
"backported"
],
"ignoreWords": [
"userfrosting",
"errlop",
"preversion",
"postversion",
"codecov",
"vpath",
"gulpplugin",
"gulpfile"
],
"ignorePaths": [
"cspell.json",
"package-lock.json",
"api-extractor.json",
"docs/api/",
"dist/",
"temp/"
]
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchastrator](./gulp-bundle-assets.bundleorchastrator.md) &gt; [(constructor)](./gulp-bundle-assets.bundleorchastrator._constructor_.md)
[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchestrator](./gulp-bundle-assets.bundleorchestrator.md) &gt; [(constructor)](./gulp-bundle-assets.bundleorchestrator._constructor_.md)

## BundleOrchastrator.(constructor)
## BundleOrchestrator.(constructor)

Constructs a new instance of the `BundleOrchastrator` class
Constructs a new instance of the `BundleOrchestrator` class

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchastrator](./gulp-bundle-assets.bundleorchastrator.md) &gt; [\_flush](./gulp-bundle-assets.bundleorchastrator._flush.md)
[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchestrator](./gulp-bundle-assets.bundleorchestrator.md) &gt; [\_flush](./gulp-bundle-assets.bundleorchestrator._flush.md)

## BundleOrchastrator.\_flush() method
## BundleOrchestrator.\_flush() method

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchastrator](./gulp-bundle-assets.bundleorchastrator.md) &gt; [\_transform](./gulp-bundle-assets.bundleorchastrator._transform.md)
[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchestrator](./gulp-bundle-assets.bundleorchestrator.md) &gt; [\_transform](./gulp-bundle-assets.bundleorchestrator._transform.md)

## BundleOrchastrator.\_transform() method
## BundleOrchestrator.\_transform() method

Collects copies of applicable files to later bundle.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchastrator](./gulp-bundle-assets.bundleorchastrator.md)
[Home](./index.md) &gt; [@userfrosting/gulp-bundle-assets](./gulp-bundle-assets.md) &gt; [BundleOrchestrator](./gulp-bundle-assets.bundleorchestrator.md)

## BundleOrchastrator class
## BundleOrchestrator class

Orchastrates bundling.
Orchestrates bundling.

<b>Signature:</b>

```typescript
export declare class BundleOrchastrator extends Transform
export declare class BundleOrchestrator extends Transform
```
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(config, joiner, resultsCallback)](./gulp-bundle-assets.bundleorchastrator._constructor_.md) | | Constructs a new instance of the <code>BundleOrchastrator</code> class |
| [(constructor)(config, joiner, resultsCallback)](./gulp-bundle-assets.bundleorchestrator._constructor_.md) | | Constructs a new instance of the <code>BundleOrchestrator</code> class |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [\_flush(callback)](./gulp-bundle-assets.bundleorchastrator._flush.md) | | |
| [\_transform(chunk, encoding, callback)](./gulp-bundle-assets.bundleorchastrator._transform.md) | | Collects copies of applicable files to later bundle. |
| [\_flush(callback)](./gulp-bundle-assets.bundleorchestrator._flush.md) | | |
| [\_transform(chunk, encoding, callback)](./gulp-bundle-assets.bundleorchestrator._transform.md) | | Collects copies of applicable files to later bundle. |
2 changes: 1 addition & 1 deletion docs/api/gulp-bundle-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

| Class | Description |
| --- | --- |
| [BundleOrchastrator](./gulp-bundle-assets.bundleorchastrator.md) | Orchastrates bundling. |
| [BundleOrchestrator](./gulp-bundle-assets.bundleorchestrator.md) | Orchestrates bundling. |

## Enumerations

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@userfrosting/gulp-bundle-assets",
"version": "4.0.0",
"description": "Orchastrates JS and CSS bundle creation in an efficient and configurable manner.",
"description": "Orchestrates JS and CSS bundle creation in an efficient and configurable manner.",
"funding": "https://opencollective.com/userfrosting",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down Expand Up @@ -72,7 +72,6 @@
"engines": {
"node": ">=10.0.0"
},
"engineStrict": true,
"ava": {
"files": [
"dist/**/*.test.js"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test, { ExecutionContext } from "ava";
import { BundleOrchastrator, ResultsCallback } from "./bundle-orchastrator.js";
import { BundleOrchestrator, ResultsCallback } from "./bundle-orchestrator.js";
import intoStream from "into-stream";
import getStream from "get-stream";
import { Readable, Stream } from "stream";
Expand Down Expand Up @@ -84,7 +84,7 @@ interface IBundleBuilderFlags {
* @param flags Flags used to modify returned bundler.
*/
function buildBundler(t: ExecutionContext, flags: IBundleBuilderFlags = {}) {
return new BundleOrchastrator(
return new BundleOrchestrator(
{
cwd: flags.explicitCwd
? process.cwd()
Expand Down Expand Up @@ -309,7 +309,7 @@ test("Bundles with unmet dependencies", async t => {
},
{
instanceOf: Error,
message: "Stream completed before all bundles recieved their dependencies",
message: "Stream completed before all bundles received their dependencies",
}
);
});
Expand All @@ -324,7 +324,7 @@ test("Bundles with all dependencies unmet", async t => {
},
{
instanceOf: Error,
message: "Stream completed before all bundles recieved their dependencies",
message: "Stream completed before all bundles received their dependencies",
}
);
});
Loading

0 comments on commit 6e55e6e

Please sign in to comment.