Skip to content

Commit 1e3dc35

Browse files
committed
checkpoint
1 parent 03be02f commit 1e3dc35

20 files changed

+64
-5601
lines changed

.github/workflows/validate.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
types:
6+
- edited
7+
- opened
8+
- synchronize
9+
push:
10+
branches:
11+
- '*'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node: ['16', '14', '12']
20+
21+
name: Node v${{ matrix.node }}
22+
23+
steps:
24+
- name: Checkout Commit
25+
uses: actions/checkout@v1
26+
27+
- name: Setup Node
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: ${{ matrix.node }}
31+
32+
- name: Checkout Master
33+
run: git branch -f master origin/master
34+
35+
- uses: pnpm/action-setup@v2.2.2
36+
with:
37+
version: 6
38+
39+
- name: Sanity Check
40+
run: |
41+
echo branch `git branch --show-current`;
42+
echo node `node --version`;
43+
echo yarn `pnpm --version`
44+
45+
- name: pnpm install
46+
run: pnpm install
47+
48+
- name: Audit Dependencies
49+
run: pnpm security
50+
51+
- name: Lint Repo
52+
run: pnpm lint:js
53+
54+
- name: Run Tests
55+
run: pnpm ci:coverage

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
"bugs": "https://github.com/shellscape/postcss-values-parser/issues",
1414
"main": "dist/index.js",
1515
"engines": {
16-
"node": ">=10"
16+
"node": ">=12"
1717
},
1818
"scripts": {
1919
"ci:coverage": "nyc npm run test && nyc report --reporter=text-lcov > coverage.lcov",
2020
"ci:test": "npm run test",
21-
"lint": "eslint lib test --fix --cache",
22-
"check-types": "tsc --noEmit",
21+
"lint": "eslint src test --fix --cache",
2322
"lint-staged": "lint-staged",
2423
"security": "npm audit --audit-level=high --prod",
2524
"test": "ava test/word.ts"

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
// Breaking Changes:
13+
// - Node v12+
1314
// - postcss-values-parser is now using css-tree which makes its behavior closers to how browsers parse values
1415
// - Comments and superfluous spaces filtered out (upstream; css-tree)
1516
// - Node interfaces changed

test/fixtures/comment.js

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

test/integration.test.js renamed to test/integration.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
These tests exist because of the use-case submitted in https://github.com/shellscape/postcss-values-parser/issues/63
1212
Multiple successive parses yielded results that were not duplicated in ava's individual process model
1313
*/
14-
const test = require('ava');
14+
import test from 'ava';
1515

16-
const { nodeToString, parse } = require('../lib');
17-
const Punctuation = require('../lib/nodes/Punctuation');
16+
import { nodeToString, parse } from '../src';
17+
18+
import { Operator } from '../src/nodes';
1819

1920
test('integration', (t) => {
2021
let root = parse(`normal normal 1em/1 'Source Sans Pro', serif`);
@@ -36,8 +37,8 @@ test('manipulation', (t) => {
3637
let string = nodeToString(root);
3738
t.is(source, string);
3839

39-
first.nodes.splice(1, 0, new Punctuation({ value: ',', parent: first }));
40-
first.nodes.splice(3, 0, new Punctuation({ value: ',', parent: first }));
40+
first.nodes.splice(1, 0, new Operator({ value: ',', parent: first }));
41+
first.nodes.splice(3, 0, new Operator({ value: ',', parent: first }));
4142

4243
string = nodeToString(root);
4344
t.not(source, string);

0 commit comments

Comments
 (0)