Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,48 @@ name: CI default branch
on:
push:
branches: [development]
pull_request:
branches: [development]

jobs:
linting:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run linters
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: "npm"
- run: npm ci
- run: make ci/linting
- name: Install Node modules
run: npm ci
- name: Run eslint
run: make ci/linting

testing:
name: Run tests on ${{ matrix.os }} for Node ${{ matrix.node-version }}
needs: linting
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x, 16.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: OS ${{ matrix.os }} - Node ${{ matrix.node-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Setup OS ${{ matrix.os }} - Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: make ci/coverage
- name: Coveralls
- name: Install Node modules
run: npm ci
- name: Run tests with Jest
run: make ci/coverage
- name: Prepare coverage result
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -44,10 +53,11 @@ jobs:
parallel: true

finish:
name: Indicate completion to Coveralls.io
needs: testing
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
- name: Finished coverage collection
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/ci-feature.yml

This file was deleted.

20 changes: 13 additions & 7 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ on:

jobs:
build:
name: Release to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: make ci/linting
- run: make ci/testing
- run: make ci/release
- name: Install Node modules
run: npm ci
- name: Run linters
run: make ci/linting
- name: Run test suite
run: make ci/testing
- name: Perform the release
run: make ci/release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ dev/coverage : | $(STAMP_NODE_INSTALL)

# Run the test suite.
dev/test : | $(STAMP_NODE_INSTALL)
npx jest --config .jestrc.json --verbose
npx jest --config .jestrc.json --verbose main.spec.ts
.PHONY : dev/test

# Run eslint against all files in the current directory.
Expand Down
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ providing a manifest file to match the orginal filename to the new one.
Just install _buster_ from **npm**:

```bash
npm install --save-dev @mischback/buster
$ npm install --save-dev @mischback/buster
```

Most likely you will want to install it as a development dependency for internal
Expand All @@ -30,11 +30,65 @@ usage.
After installation, _buster_ is available using the following command:

```bash
npx buster
$ npx buster
```

### Example Usage

```bash
$ tree .manual-test
.manual-test
├── blank.css
├── index.ts
└── lib
└── hashwalker.ts

$ npx buster -i "./.manual-test" -e "ts"
[date and time] INFO [buster] No mode specified, using "copy"
[date and time] INFO [buster] No output file specified, using "asset-manifest.json"

$ tree .manual-test
.manual-test
├── asset-manifest.json
├── blank.css
├── index.dd99a19417.ts
├── index.ts
└── lib
├── hashwalker.84f1a289e8.ts
└── hashwalker.ts

$ cat .manual-test/asset-manifest.json
{"index.ts":"index.dd99a19417.ts","lib/hashwalker.ts":"lib/hashwalker.84f1a289e8.ts"}%
```

## Configuration

_buster_ is configured by command line parameters.

- `--commonPathLength`: manually override the length of filepath's that is to be
preserved in the manifest file
- `--debug`, `-d`: activate debug mode, providing more log messages
- default: `false`
- `--extension`, `-e`: a file extension to include during processing; may be specified multiple times
- default: `["css", "js"]`
- `--hashLength`: the length of the hash to be appended to the filename
- default: `10`
- `--input`, `-i`: the actual input file or directory
- **mandator parameter**, no default value
- `--mode`, `-m`: operation mode, either `"copy"` or `"rename"`
- default: `copy`
- `MODE_COPY` as specified by `copy` will copy the source file to a new file
with the content's hash appended to the filename
- `MODE_RENAME` as specified by `rename` will rename the existing file
- `--outFile`, `-o`: filename and path of the manifest file to be created
- default: `"asset-manifest.json"`
- **Please note:** If just a filename is specified, the output file will be
created relative to `input`: if `input` is a directory, it will be placed
inside this directory; if `input` is a file, it will be placed into the same
directory; if a path and filename is specified, that location will be useds
- `--quiet`, `-q`: suppress all log messages
- default: `false`

## Contributing

Issues, pull requests and feature requests are welcome. Just use the project's
Expand Down
23 changes: 17 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"homepage": "https://github.com/Mischback/buster#readme",
"dependencies": {
"@mischback/fileobject-walker": "1.0.0",
"@mischback/min-async-json-interface": "1.0.1",
"stdio": "2.1.1",
"tslog": "3.2.2"
},
Expand Down
Loading