Skip to content

Commit

Permalink
Accept major versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Mar 30, 2022
1 parent df9664b commit 4e46408
Show file tree
Hide file tree
Showing 15 changed files with 7,971 additions and 205 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: check-dist
name: build

on:
pull_request:
Expand All @@ -17,6 +17,8 @@ jobs:
node-version: 16

- run: npm ci
- run: npm test

- run: npm run build
- name: Check for uncommitted changes
run: git diff --quiet || (git diff && false)
96 changes: 48 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
| | `ubuntu-18.04` | `ubuntu-20.04` | `macos-10.15` | `macos-11` | `windows-2019` | `windows-2022` |
| :------- | :------------: | :------------: | :-----------: | :--------: | :------------: | :------------: |
| `9.2.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `9.2.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `9.0.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `9.0.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.7` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.6` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.5` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.5` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.2.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.2.1` |||||||
| `8.0.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.0.1` |||||||
| `7.10.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `7.10.2` |||||||
| `7.10.1` |||||||
| `7.8.4` | 🟢 ||||||
| `7.8.3` |||||||
| `7.8.2` |||||||
| `7.8.1` |||||||
| `7.6.3` | 🟢 ||||||
| `7.6.2` |||||||
| `7.6.1` |||||||
| `7.4.2` | 🟢 | 🟢 |||||
| `7.4.1` | 🟢 ||||||
| `7.2.2` | 🟢 | 🟢 |||||
| `7.2.1` |||||||
| `7.0.4` | 🟢 | 🟢 |||||
| `7.0.3` |||||||
| `7.0.2` |||||||
| `7.0.1` | 🟢 | 🟢 |||||
| | `ubuntu-18.04` | `ubuntu-20.04` | `macos-10.15` | `macos-11` | `windows-2019` | `windows-2022` |
| :-------------- | :------------: | :------------: | :-----------: | :--------: | :------------: | :------------: |
| `9.2.2` `9.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `9.2.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `9.0.2` `9.0` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `9.0.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.7` `8.10` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.6` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.5` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.10.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.4` `8.8` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.8.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.5` `8.6` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.6.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.4` `8.4` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.3` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.4.1` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.2.2` `8.2` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.2.1` |||||||
| `8.0.2` `8.0` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `8.0.1` |||||||
| `7.10.3` `7.10` | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 |
| `7.10.2` |||||||
| `7.10.1` |||||||
| `7.8.4` `7.8` | 🟢 ||||||
| `7.8.3` |||||||
| `7.8.2` |||||||
| `7.8.1` |||||||
| `7.6.3` `7.6` | 🟢 ||||||
| `7.6.2` |||||||
| `7.6.1` |||||||
| `7.4.2` `7.4` | 🟢 | 🟢 |||||
| `7.4.1` | 🟢 ||||||
| `7.2.2` `7.2` | 🟢 | 🟢 |||||
| `7.2.1` |||||||
| `7.0.4` `7.0` | 🟢 | 🟢 |||||
| `7.0.3` |||||||
| `7.0.2` |||||||
| `7.0.1` | 🟢 | 🟢 |||||
142 changes: 115 additions & 27 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions generate/readme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { all, versions } from './versions';
import { resolveVersion } from '../src/resolve';
import { allSet, all, versions } from './versions';

type Environment = keyof typeof versions;
const environments: Environment[] = Object.keys(versions) as Environment[];
Expand All @@ -9,11 +10,24 @@ const supports = (version: string) => (name: Environment) => {
return versions[name].includes(version) ? 'oo' : 'xx';
};

const majorVersion = (version: string) => version.split('.').splice(0, 2).join('.');

const unique = (xs: string[]) => [...new Set(xs)];

const latestMajorVersions = Object.fromEntries(
unique(all.map(majorVersion)).map(major => [resolveVersion(major, allSet), major])
);

function codeVersion(version: string): string {
const major = latestMajorVersions[version];
return major ? `${code(version)} ${code(major)}` : code(version);
}

async function main() {
const { markdownTable } = await import('markdown-table');
const header = [''].concat(environments.map(code));
const align = ['l'].concat(environments.map(_ => 'c'));
const row = (version: string) => [code(version)].concat(environments.map(supports(version)));
const row = (version: string) => [codeVersion(version)].concat(environments.map(supports(version)));
const rows = all.reverse().map(row);
const table = [header].concat(rows);
console.log(markdownTable(table, { align }).replace(/oo/g, '🟢').replace(/xx/g, '❌'));
Expand Down
Loading

0 comments on commit 4e46408

Please sign in to comment.