From a6172336d25e4c69ff3731a4019d54693326efe9 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Sun, 14 Mar 2021 17:20:16 +0100 Subject: [PATCH 1/2] make it node 12 compatible --- src/corePlugins/ringWidth.js | 5 ++--- src/lib/setupContext.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corePlugins/ringWidth.js b/src/corePlugins/ringWidth.js index d6a1444..d29d677 100644 --- a/src/corePlugins/ringWidth.js +++ b/src/corePlugins/ringWidth.js @@ -1,6 +1,5 @@ const dlv = require('dlv') const nameClass = require('tailwindcss/lib/util/nameClass').default -const transformThemeValue = require('tailwindcss/lib/util/transformThemeValue').default const toRgba = require('tailwindcss/lib/util/withAlphaVariable').toRgba const { asLength } = require('../pluginUtils') @@ -20,8 +19,8 @@ module.exports = function ({ addBase, matchUtilities, addUtilities, jit: { theme let ringReset = { '*': { '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-ring-offset-width': theme.ringOffsetWidth?.DEFAULT ?? '0px', - '--tw-ring-offset-color': theme.ringOffsetColor?.DEFAULT ?? '#fff', + '--tw-ring-offset-width': dlv(theme, ['ringOffsetWidth', 'DEFAULT'], '0px'), + '--tw-ring-offset-color': dlv(theme, ['ringOffsetColor', 'DEFAULT'], '#fff'), '--tw-ring-color': ringColorDefault, '--tw-ring-offset-shadow': '0 0 #0000', '--tw-ring-shadow': '0 0 #0000', diff --git a/src/lib/setupContext.js b/src/lib/setupContext.js index 2e5cf1f..5e657b2 100644 --- a/src/lib/setupContext.js +++ b/src/lib/setupContext.js @@ -153,7 +153,7 @@ function getTailwindConfig(configOrPath) { if (userConfigPath !== null) { let [prevConfig, prevModified = -Infinity, prevConfigHash] = - configPathCache.get(userConfigPath) ?? [] + configPathCache.get(userConfigPath) || [] let modified = fs.statSync(userConfigPath).mtimeMs // It hasn't changed (based on timestamp) From ca6e47bbd354aecf17522488429b2df90cc3eab8 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Sun, 14 Mar 2021 17:26:38 +0100 Subject: [PATCH 2/2] setup CI --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e8c6904 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 15.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: Use cached node_modules + id: cache + uses: actions/cache@v2 + with: + path: node_modules + key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }} + restore-keys: | + nodeModules- + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm install + env: + CI: true + + - name: Test + run: npm run test -- --coverage + env: + CI: true