Skip to content

Commit

Permalink
fix: run on node v10, v12, v14; ubuntu, macos and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sastan committed Dec 14, 2020
1 parent 7c1ba87 commit 54755a0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['14.x']
os: [ubuntu-latest]
node: ['10.x', '12.x', '14.x']
os: [ubuntu-18.04, macos-10.15, windows-2019]

steps:
- name: Checkout 🛎️
Expand All @@ -29,6 +29,7 @@ jobs:
run: yarn run test:coverage

- name: Build
if: ${{ matrix.node != '10.x'}}
run: yarn run build

- name: Coveralls
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: size
on: [pull_request]
jobs:
size:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
CI_JOB_NUMBER: 1
steps:
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,20 @@ We are following the [Conventional Commits](https://www.conventionalcommits.org)

### Develop

> Ensure you run at least Node v14.
> Ensure you run at least Node v12.
Clone the repository and cd into the project directory.

Run `yarn install && yarn build`.
Run `yarn install`.

- `yarn start`: Start example
- `yarn build`: Build the package
- `yarn test`: Run test suite
- `yarn test:coverage`: Run test suite with coverage
- `yarn test:watch`: Run test suite in watch mode
- `yarn format`: Ensure consistent code style
- `yarn build`: Build the package
- `yarn start`: Start example using snowpack
- `yarn lint`: Run eslint
- `yarn lint:fix`: Run eslint fix
- `yarn release`: To publish the package

## License
Expand Down
6 changes: 3 additions & 3 deletions scripts/esbundle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const fs = require('fs/promises')
const { promises: fs } = require('fs')
const path = require('path')

const paths = {
Expand All @@ -9,8 +9,7 @@ const paths = {
}

const targets = {
// Last LTS
node: 'node10.23',
node: 'node10.13',
browser: ['chrome79', 'firefox78', 'safari13.1', 'edge79'],
}

Expand Down Expand Up @@ -69,6 +68,7 @@ async function generateTypescriptDeclarations() {
extends: './' + path.basename(tsconfig),
exclude: ['**/__fixtures__/**', '**/__tests__/**'],
compilerOptions: {
target: 'ESNext',
module: 'ESNext',
emitDeclarationOnly: true,
noEmit: false,
Expand Down
27 changes: 15 additions & 12 deletions src/__tests__/tailwind-compat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ const test = suite('tailwind compat')

setup({ mode: strict })

test('all tailwind directives are available', async () => {
const { processPlugins } = await import('../__fixtures__/process-plugins')
// Tailwind only supports Node.JS >=12.13.0
// use feature detection
if (Object.entries && [].flatMap) {
test('all tailwind directives are available', async () => {
const { processPlugins } = await import('../__fixtures__/process-plugins')

const { directives } = processPlugins()
const { directives } = processPlugins()

for (const directive of Object.keys(directives)) {
try {
assert.ok(tw(directive))
} catch (error) {
console.warn(directive, directives[directive])
throw error
for (const directive of Object.keys(directives)) {
try {
assert.ok(tw(directive))
} catch (error) {
console.warn(directive, directives[directive])
throw error
}
}
}
})

})
}
test.run()

0 comments on commit 54755a0

Please sign in to comment.