Skip to content

Commit

Permalink
refactor: use typescript (#272)
Browse files Browse the repository at this point in the history
* chore: use pnpm

* chore!: drop support for Node v10

* chore: remove circleci, use github workflows for everything

* refactor: use typescript

* chore: clean up tests for new linting

* chore: try to fix tests in CI

* chore: update tsconfig to es2018 to remove optional chaining
  • Loading branch information
shellscape committed Jul 28, 2021
1 parent 9d0fe7c commit a93ca8c
Show file tree
Hide file tree
Showing 42 changed files with 9,249 additions and 11,959 deletions.
94 changes: 0 additions & 94 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ trim_trailing_whitespace = true

[*.md]
insert_final_newline = true
trim_trailing_whitespace = false
trim_trailing_whitespace = false
9 changes: 8 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
test/output
/node_modules
dist
*.snap
output.js
*-wps-hmr.*
*.hot-update.js
test/**/output
.eslintrc.js
19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ["shellscape/typescript"],
parserOptions: {
project: ["./tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
}
};
53 changes: 34 additions & 19 deletions .github/workflows/node-windows.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
name: Node
name: Windows

on: [push, pull_request]
on:
pull_request:
types:
- edited
- opened
- synchronize
push:
branches:
- '*'

jobs:
build:

runs-on: windows-2019

strategy:
matrix:
node: [ '14', '12', '10' ]
node: ['16']

name: ${{ matrix.node }} (Windows)
name: Node v${{ matrix.node }}
steps:
- name: Configure git line-breaks
run: git config --global core.autocrlf false
- name: Checkout Commit
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: checkout master
run: git branch -f master origin/master
- name: npm install
run: npm ci
- name: run tests
run: npm run test
- name: Configure git line-breaks
run: git config --global core.autocrlf false

- name: Checkout Commit
uses: actions/checkout@v1

- name: Checkout Master
run: git branch -f master origin/master

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: install pnpm
run: npm install pnpm -g

- name: pnpm install
run: pnpm install --ignore-scripts

- name: run tests
run: pnpm test
25 changes: 25 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pull Request Title Format

on:
pull_request:
branches:
- '*'
types:
- opened
- reopened
- edited
- synchronize

jobs:
prTitle:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check PR Title
uses: clowdhaus/actions/pr-title@v0.1.0
with:
on-fail-message: "Your PR title doesn't match the required format. The title should be in the conventional commit (https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format. e.g.\n\n```\nchore(plugin-name): add pr title workflow\n```"
title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w|,|\-|\|]+\))?(!)?\:\s.*$'
github-token: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Validate

on:
pull_request:
types:
- edited
- opened
- synchronize
push:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node: ['16', '14', '12']

name: Node v${{ matrix.node }}

steps:
- name: Checkout Commit
uses: actions/checkout@v1

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Checkout Master
run: git branch -f master origin/master

- name: Install pnpm
run: npm install pnpm -g

- name: Sanity Check
run: |
echo branch `git branch --show-current`;
echo node `node --version`;
echo yarn `pnpm --version`
- name: pnpm install
run: pnpm install

- name: Audit Dependencies
run: pnpm security

- name: Build Packages
run: pnpm build --recursive

- name: Lint Repo
run: pnpm lint:js

- name: Run Tests
run: pnpm ci:coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ coverage
coverage.lcov
node_modules
test/output/
dist
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pnpm options
enable-pre-post-scripts = true
shamefully-hoist = true
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
packages/json/test/fixtures/garbage/*
packages/yaml/test/fixtures/**/*
**/dist/
**/fixtures/
pnpm-lock.yaml
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Note: This file is necessary so that prettier writes which happen in hooks and scripts match the
// same config that we're using from the eslint-config package.
module.exports = require('eslint-config-shellscape/prettier');
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[tests]: https://img.shields.io/circleci/project/github/shellscape/webpack-manifest-plugin.svg
[tests]: https://img.shields.io/circleci/project/github/shellscape/webpack-manifest-plugin.svg
[tests-url]: https://circleci.com/gh/shellscape/webpack-manifest-plugin

[cover]: https://codecov.io/gh/shellscape/webpack-manifest-plugin/branch/master/graph/badge.svg
[cover-url]: https://codecov.io/gh/shellscape/webpack-manifest-plugin

[size]: https://packagephobia.now.sh/badge?p=webpack-manifest-plugin
[size-url]: https://packagephobia.now.sh/result?p=webpack-manifest-plugin

Expand All @@ -16,7 +14,6 @@
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)


# webpack-manifest-plugin

A Webpack plugin for generating an asset manifest.
Expand All @@ -29,6 +26,16 @@ A Webpack plugin for generating an asset manifest.

This module requires an [Active LTS](https://github.com/nodejs/Release) Node version (v10.0.0+) and Webpack v4.44.0+.

## Contributing

This repository leverages [pnpm](https://pnpm.js.org/) for dependency management.

To begin, please install `pnpm`:

```console
$ npm install pnpm -g
```

## Install

Using npm:
Expand Down Expand Up @@ -181,7 +188,6 @@ Default: `false`

If `true`, will emit the manifest to the build directory _and_ in memory for compatibility with `webpack-dev-server`.


## Manifest File Descriptor

This plugin utilizes the following object structure to work with files. Many options for this plugin utilize the structure below.
Expand Down Expand Up @@ -235,10 +241,9 @@ class BatmanPlugin {

beforeEmit.tap('BatmanPlugin', (manifest) => {
return { ...manifest, name: 'hello' };
})
});
}
}

```

## Notes
Expand Down
6 changes: 3 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ coverage:
round: down
range: 70...100
status:
project: "no"
patch: "yes"
comment: "off"
project: 'no'
patch: 'yes'
comment: 'off'
Loading

0 comments on commit a93ca8c

Please sign in to comment.