Skip to content

Commit 1131170

Browse files
authored
Merge branch 'master' into feature/rename-import
2 parents 87fc7ea + b56f674 commit 1131170

10 files changed

Lines changed: 5755 additions & 3515 deletions

File tree

.github/workflows/github-actions-demo.yml

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

.github/workflows/test.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,37 @@ on:
44
pull_request:
55
jobs:
66
full:
7-
name: Node.js 17 Full
7+
name: Node.js 18 Full
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout the repository
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v3
1212
- name: Install Node.js
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v3
1414
with:
15-
node-version: 17
16-
cache: yarn
15+
node-version: 18
1716
- name: Install dependencies
18-
run: yarn install --frozen-lockfile
17+
run: npm ci
1918
- name: Run tests
20-
run: yarn test
19+
run: npm test
2120
env:
2221
FORCE_COLOR: 2
2322
short:
2423
runs-on: ubuntu-latest
2524
strategy:
2625
matrix:
27-
node-version:
28-
- 16
29-
- 14
30-
- 12
31-
name: Node.js ${{ matrix.node-version }} Quick
26+
node: [16]
27+
name: Node.js ${{ matrix.node }} Quick
3228
steps:
3329
- name: Checkout the repository
34-
uses: actions/checkout@v2
35-
- name: Install Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v2
30+
uses: actions/checkout@v3
31+
- name: Install Node.js ${{ matrix.node }}
32+
uses: actions/setup-node@v3
3733
with:
38-
node-version: ${{ matrix.node-version }}
39-
cache: yarn
34+
node-version: ${{ matrix.node }}
4035
- name: Install dependencies
41-
run: yarn install --frozen-lockfile
36+
run: npm ci
4237
- name: Run unit tests
43-
run: yarn unit
38+
run: npm run unit
4439
env:
4540
FORCE_COLOR: 2

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ npm-debug.log
33
yarn-error.log
44
coverage
55
npm-debug.log
6-
package-lock.json
6+

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
#0.1.0
1+
# 0.2.0
2+
- added `c8` for coverage and uvu for unit tests
3+
- enforces 100% coverage
4+
- removed `jest`
5+
- removed `console.log` which reports contents of the resolved `@import`
6+
- moved mock test files into subfolder within `test/mocks/` (previously mock vendors.css was shipping to npm)
7+
- updated to the latest v8 PostCSS (set as peer dependency)
8+
improved the algorithm to account for both single and double and missing quotes within `@import`
9+
- improved the algorithm to try-catch fs errors and report them properly
10+
- removed Travis, added GH actions
11+
- yarn is assumed to be the preferred over npm, but added npm lockfile to gitignore and `.npmrc` just in case somebody forks and tries to run it using npm i
12+
- added `prettier` and `eslint` to trigger VSCode to format/lint the code (previous setup wasn't picked up by VSCode plugins)
13+
- committed a fresh yarn lock file (GH actions will expect it too)
14+
15+
Closes issues #2, #3, #4, #5.
16+
17+
# 0.1.0
218
- Basic nested import functionality

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# PostCSS Nested Import [![Build Status][ci-img]][ci]
1+
<h1 align="center">PostCSS Nested Import</h1>
22

3-
[PostCSS] plugin for importing other stylesheet source files anywhere in your CSS.
3+
<p align="center">PostCSS plugin for importing other stylesheet source files anywhere in your CSS.</p>
44

5-
[PostCSS]: https://github.com/postcss/postcss
6-
[ci-img]: https://travis-ci.org/eriklharper/postcss-nested-import.svg
7-
[ci]: https://travis-ci.org/eriklharper/postcss-nested-import
5+
<p align="center">
6+
<a href="https://github.com/eriklharper/postcss-nested-import/actions/workflows/test.yml" rel="nofollow noreferrer noopener">
7+
<img src="https://github.com/eriklharper/postcss-nested-import/actions/workflows/test.yml/badge.svg" alt="GitHub CI test">
8+
</a>
9+
</p>
810

911
Before:
12+
1013
```css
1114
/* vendor.css */
1215
.vendor {
@@ -18,7 +21,9 @@ Before:
1821
@nested-import './vendor.css';
1922
}
2023
```
24+
2125
After:
26+
2227
```css
2328
:global {
2429
.vendor {
@@ -30,9 +35,7 @@ After:
3035
## Usage
3136

3237
```js
33-
postcss([
34-
require('postcss-nested-import')
35-
])
38+
postcss([require("postcss-nested-import")]);
3639
```
3740

38-
See [PostCSS] docs for examples for your environment.
41+
See [PostCSS](https://github.com/postcss/postcss) docs for examples for your environment.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = () => {
3131
node.replaceWith(`${node.raws.before}${replacement}`);
3232
}
3333
},
34-
postcssPlugin: "ppostcss-nested-import"
34+
postcssPlugin: "postcss-nested-import"
3535
};
3636
};
3737

0 commit comments

Comments
 (0)