Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
checkpoint
  • Loading branch information
shellscape committed Jul 14, 2022
commit 1e3dc3599c423ccdf173cc2df2b1b7e9d9945f45
55 changes: 55 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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

- uses: pnpm/action-setup@v2.2.2
with:
version: 6

- 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: Lint Repo
run: pnpm lint:js

- name: Run Tests
run: pnpm ci:coverage
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
"bugs": "https://github.com/shellscape/postcss-values-parser/issues",
"main": "dist/index.js",
"engines": {
"node": ">=10"
"node": ">=12"
},
"scripts": {
"ci:coverage": "nyc npm run test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:test": "npm run test",
"lint": "eslint lib test --fix --cache",
"check-types": "tsc --noEmit",
"lint": "eslint src test --fix --cache",
"lint-staged": "lint-staged",
"security": "npm audit --audit-level=high --prod",
"test": "ava test/word.ts"
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

// Breaking Changes:
// - Node v12+
// - postcss-values-parser is now using css-tree which makes its behavior closers to how browsers parse values
// - Comments and superfluous spaces filtered out (upstream; css-tree)
// - Node interfaces changed
Expand Down
22 changes: 0 additions & 22 deletions test/fixtures/comment.js

This file was deleted.

11 changes: 6 additions & 5 deletions test/integration.test.js → test/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
These tests exist because of the use-case submitted in https://github.com/shellscape/postcss-values-parser/issues/63
Multiple successive parses yielded results that were not duplicated in ava's individual process model
*/
const test = require('ava');
import test from 'ava';

const { nodeToString, parse } = require('../lib');
const Punctuation = require('../lib/nodes/Punctuation');
import { nodeToString, parse } from '../src';

import { Operator } from '../src/nodes';

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

first.nodes.splice(1, 0, new Punctuation({ value: ',', parent: first }));
first.nodes.splice(3, 0, new Punctuation({ value: ',', parent: first }));
first.nodes.splice(1, 0, new Operator({ value: ',', parent: first }));
first.nodes.splice(3, 0, new Operator({ value: ',', parent: first }));

string = nodeToString(root);
t.not(source, string);
Expand Down
Loading