Skip to content

Commit

Permalink
Update CI to use modern Node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjwest committed Feb 11, 2023
1 parent d5a154b commit 1caa4d0
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 445 deletions.
62 changes: 34 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ references:
v1-dependency-yarn-{{ .Branch }}-
yarn-backup-cache-key-no-branch: &yarn-backup-cache-key-no-branch
v1-dependency-yarn-
node-10: &node-10
circleci/node:10.19.0
node-12: &node-12
circleci/node:12.18.0

node-14: &node-14
circleci/node:14.4.0
node-10-latest: &node-10-latest
circleci/node:10
node-12-latest: &node-12-latest
circleci/node:12
cimg/node:14.21.1
node-16: &node-16
cimg/node:16.19.0
node-18: &node-18
cimg/node:18.13.0

node-14-latest: &node-14-latest
circleci/node:14
cimg/node:14
node-16-latest: &node-16-latest
cimg/node:16
node-18-latest: &node-18-latest
cimg/node:18

commands:
install-dependencies:
Expand Down Expand Up @@ -111,25 +113,26 @@ commands:
jobs:
checks:
docker:
- image: *node-14
- image: *node-18
steps:
- checkout
- install-dependencies
- checks

test-node-10:
test-node-14:
docker:
- image: *node-10
- image: *node-14
steps:
- checkout
- install-dependencies
- build
- tests
- tests-es5
- tests-es6

test-node-12:
test-node-16:
docker:
- image: *node-12
- image: *node-16
steps:
- checkout
- install-dependencies
Expand All @@ -138,9 +141,9 @@ jobs:
- tests-es5
- tests-es6

test-node-14:
test-node-18:
docker:
- image: *node-14
- image: *node-18
steps:
- checkout
- install-dependencies
Expand All @@ -152,57 +155,60 @@ jobs:

checks-latest:
docker:
- image: *node-14
- image: *node-18
steps:
- checkout
- install-dependencies-latest
- checks

test-node-10-latest:
test-node-14-latest:
docker:
- image: *node-10-latest
- image: *node-14-latest
steps:
- checkout
- install-dependencies-latest
- build
- tests
- tests-es5
- tests-es6

test-node-12-latest:
test-node-16-latest:
docker:
- image: *node-12-latest
- image: *node-16-latest
steps:
- checkout
- install-dependencies-latest
- build
- tests
- tests-es5
- tests-es6

test-node-14-latest:
test-node-18-latest:
docker:
- image: *node-14-latest
- image: *node-18-latest
steps:
- checkout
- install-dependencies-latest
- build
- tests
- tests-es5
- tests-es6

workflows:
version: 2
test:
jobs:
- checks
- test-node-10
- test-node-12
- test-node-14
- test-node-16
- test-node-18

weekly:
jobs:
- checks-latest
- test-node-10-latest
- test-node-12-latest
- test-node-14-latest
- test-node-16-latest
- test-node-18-latest
triggers:
- schedule:
# Midnight on Sunday
Expand Down
3 changes: 0 additions & 3 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"exclude": [
"node_modules/**"
],
"require": [
"ts-node/register"
],
"all": true,
"check-coverage": true,
"per-file": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"build:es6": "rm -rf build/es6 && tsc --project tsconfig-build-es6.json",
"build:es5": "rm -rf build/es5 && tsc --project tsconfig-build-es5.json && convert-extension cjs build/es5",
"lint:ts": "eslint 'src/**/*.ts' 'tests/**/*.ts'",
"test:coverage": "rm -rf coverage && NODE_DEBUG=nyc nyc mocha 'tests/*.ts'",
"test:coverage": "rm -rf coverage && c8 mocha --node-option experimental-specifier-resolution=node --node-option loader=ts-node/esm 'tests/*.ts'",
"test:unit": "mocha --node-option experimental-specifier-resolution=node --node-option loader=ts-node/esm 'tests/*.ts'",
"test:unit:es5": "mocha 'tests/*.cjs'",
"test:unit:es6": "mocha 'tests/*.js'",
Expand All @@ -61,11 +61,11 @@
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"c8": "^7.12.0",
"convert-extension": "^0.3.0",
"eslint": "^8.33.0",
"mocha": "^10.2.0",
"node-html-parser": "^6.1.4",
"nyc": "^15.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"test-snippets": "^0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Matchers {
modifierSelectorRegex: RegExp;
}

export type JsxNode = JSX.Element | string | number;
export type JsxNode = React.ReactElement | string | number;

export const DEFAULT_OPTIONS = {
selector: '&',
Expand Down
2 changes: 1 addition & 1 deletion tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import ReactDom from 'react-dom/server';
import parser from 'node-html-parser';

import { expandClasses } from '../build/es6/index.mjs';
import { expandClasses } from '../build/es6/index.js';

describe('expandClasses', () => {
it('Maps classes in a component', () => {
Expand Down
Loading

0 comments on commit 1caa4d0

Please sign in to comment.