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 4, 2023
1 parent d5a154b commit ea0424d
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 37 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: 2 additions & 1 deletion 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,6 +61,7 @@
"@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",
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';

describe('expandClasses', () => {
it('Maps classes in a component', () => {
Expand Down
49 changes: 43 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,11 @@
"@babel/helper-validator-identifier" "^7.19.1"
to-fast-properties "^2.0.0"

"@bcoe/v8-coverage@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
Expand Down Expand Up @@ -1019,7 +1024,7 @@
js-yaml "^3.13.1"
resolve-from "^5.0.0"

"@istanbuljs/schema@^0.1.2":
"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"
integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==
Expand Down Expand Up @@ -1064,7 +1069,7 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@jridgewell/trace-mapping@^0.3.9":
"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.9":
version "0.3.17"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985"
integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==
Expand Down Expand Up @@ -1113,6 +1118,11 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e"
integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==

"@types/istanbul-lib-coverage@^2.0.1":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==

"@types/json-schema@^7.0.9":
version "7.0.11"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
Expand Down Expand Up @@ -1432,6 +1442,24 @@ buffer-from@^1.0.0:
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==

c8@^7.12.0:
version "7.12.0"
resolved "https://registry.yarnpkg.com/c8/-/c8-7.12.0.tgz#402db1c1af4af5249153535d1c84ad70c5c96b14"
integrity sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==
dependencies:
"@bcoe/v8-coverage" "^0.2.3"
"@istanbuljs/schema" "^0.1.3"
find-up "^5.0.0"
foreground-child "^2.0.0"
istanbul-lib-coverage "^3.2.0"
istanbul-lib-report "^3.0.0"
istanbul-reports "^3.1.4"
rimraf "^3.0.2"
test-exclude "^6.0.0"
v8-to-istanbul "^9.0.0"
yargs "^16.2.0"
yargs-parser "^20.2.9"

caching-transform@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f"
Expand Down Expand Up @@ -1571,7 +1599,7 @@ convert-extension@^0.3.0:
mkdirp "^1.0.4"
multiline-ts "^2.0.0"

convert-source-map@^1.7.0:
convert-source-map@^1.6.0, convert-source-map@^1.7.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==
Expand Down Expand Up @@ -2284,7 +2312,7 @@ istanbul-lib-source-maps@^4.0.0:
istanbul-lib-coverage "^3.0.0"
source-map "^0.6.1"

istanbul-reports@^3.0.2:
istanbul-reports@^3.0.2, istanbul-reports@^3.1.4:
version "3.1.5"
resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae"
integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==
Expand Down Expand Up @@ -3216,6 +3244,15 @@ v8-compile-cache-lib@^3.0.1:
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==

v8-to-istanbul@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4"
integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==
dependencies:
"@jridgewell/trace-mapping" "^0.3.12"
"@types/istanbul-lib-coverage" "^2.0.1"
convert-source-map "^1.6.0"

which-module@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
Expand Down Expand Up @@ -3304,7 +3341,7 @@ yargs-parser@^18.1.2:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^20.2.2:
yargs-parser@^20.2.2, yargs-parser@^20.2.9:
version "20.2.9"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
Expand All @@ -3319,7 +3356,7 @@ yargs-unparser@2.0.0:
flat "^5.0.2"
is-plain-obj "^2.1.0"

yargs@16.2.0:
yargs@16.2.0, yargs@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
Expand Down

0 comments on commit ea0424d

Please sign in to comment.