Skip to content

Commit d7e8e22

Browse files
authored
chore: upgrade dependencies, replace jest with vitest (#48)
* upgrade dependencies to latest * replace jest with vitest * replace Travis CI with GitHub workflows
1 parent 52aa2f2 commit d7e8e22

26 files changed

Lines changed: 533 additions & 3795 deletions

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: actions/cache@v2
16+
id: yarn-cache
17+
with:
18+
path: "**/node_modules"
19+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
20+
21+
- name: Test and build the library
22+
run: |
23+
yarn
24+
yarn test run & yarn prepack

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
/.temp
2-
/**/*node_modules
1+
node_modules
32
/lib
43
/coverage
5-
64
.DS_Store
75
yarn-debug.log*
8-
yarn-error.log*
9-
10-
*.tgz
6+
yarn-error.log*

.travis.yml

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

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# posthtml-insert-at <img align="right" width="220" height="200" title="PostHTML logo" src="http://posthtml.github.io/posthtml/logo.svg">
22

33
[![NPM][npm]][npm-url]
4-
[![Build][build]][build-badge]
5-
[![Coverage][codecov-shield]][codecov]
64

75
`posthtml-insert-at` is a [PostHTML](https://github.com/posthtml/posthtml) plugin to append or prepend HTML to a selector.
86

@@ -126,7 +124,3 @@ See the [PostHTML Guidelines](https://github.com/posthtml/posthtml/tree/master/d
126124

127125
[npm]: https://img.shields.io/npm/v/posthtml-insert-at.svg?color=blue
128126
[npm-url]: https://npmjs.com/package/posthtml-insert-at
129-
[build]: https://travis-ci.org/posthtml/posthtml-insert-at.svg?branch=master
130-
[build-badge]: https://travis-ci.com/posthtml/posthtml-insert-at
131-
[codecov]: https://codecov.io/gh/posthtml/posthtml-insert-at
132-
[codecov-shield]: https://img.shields.io/codecov/c/github/posthtml/posthtml-insert-at.svg

examples/README.md

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

examples/append/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ This example illustrates the ability to append markup to a selector using the "o
88

99
## Running Locally
1010

11-
Clone the repo and install the dependencies:
12-
13-
```bash
14-
git clone git@github.com:posthtml/posthtml-insert-at.git
15-
cd posthtml-insert-at/examples/append
16-
yarn install
17-
```
18-
1911
Run the following:
2012

2113
```bash
22-
cd src/
23-
node index.js
14+
yarn install
15+
yarn posthtml
2416
```
2517

2618
The processed file should be written to src/after.html.

examples/append/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"name": "append",
3-
"version": "1.0.0",
42
"private": true,
5-
"main": "./src/index.js",
6-
"license": "MIT",
3+
"scripts": {
4+
"posthtml": "node src"
5+
},
76
"dependencies": {
87
"posthtml": "^0.13.1",
98
"posthtml-insert-at": "^0.2.7"

examples/append/src/after.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<body>
55
<main class="foo bar">Main Content</main>
66

7-
<footer id="footer">
8-
&copy; 2020
9-
</footer>
7+
<footer id="footer">&copy; 2022</footer>
108
</body>
119
</html>

examples/append/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require('fs');
22
const posthtml = require('posthtml');
33
const { insertAt } = require('posthtml-insert-at');
44

5-
const html = fs.readFileSync('./index.html');
5+
const html = fs.readFileSync('./src/index.html');
66

77
posthtml()
88
.use(
@@ -17,4 +17,4 @@ posthtml()
1717
})
1818
)
1919
.process(html)
20-
.then(result => fs.writeFileSync('./after.html', result.html));
20+
.then(result => fs.writeFileSync('./src/after.html', result.html));

examples/prepend/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ This example illustrates the ability to prepend markup to a selector using the "
88

99
## Running Locally
1010

11-
Clone the repo and install the dependencies:
12-
13-
```bash
14-
git clone git@github.com:posthtml/posthtml-insert-at.git
15-
cd posthtml-insert-at/examples/prepend
16-
yarn install
17-
```
18-
1911
Run the following:
2012

2113
```bash
22-
cd src/
23-
node index.js
14+
yarn install
15+
yarn posthtml
2416
```
2517

2618
The processed file should be written to src/after.html.

0 commit comments

Comments
 (0)