Skip to content

Commit

Permalink
Convert scripts to ES modules
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Aug 3, 2024
1 parent 0e76740 commit 39ec58f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/split.js → .github/split.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable no-console */
const fs = require('fs');
const path = require('path');
import fs from 'node:fs';
import path from 'node:path';

const BASE_DIR = path.join(__dirname, '../packages/react-integration/cypress/integration');
const BASE_DIR = path.resolve(import.meta.dirname, '../packages/react-integration/cypress/integration');
const WORKER_NUM = +process.env.WORKER_NUM;
const WORKER_COUNT = +process.env.WORKER_COUNT;

Expand Down
7 changes: 4 additions & 3 deletions .github/upload-preview.js → .github/upload-preview.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable no-console, camelcase */
const path = require('path');
const { Octokit } = require('@octokit/rest');
import { Octokit } from '@octokit/rest';
import path from 'node:path';
import surge from 'surge';

const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN });
const surge = require('surge');
const publishFn = surge().publish();

// From github actions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

- name: Upload documentation
if: always()
run: node .github/upload-preview.js packages/react-docs/public
run: node .github/upload-preview.mjs packages/react-docs/public

- name: Run accessibility tests
run: yarn serve:docs & yarn test:a11y

- name: Upload accessibility results
if: always()
run: node .github/upload-preview.js packages/react-docs/coverage
run: node .github/upload-preview.mjs packages/react-docs/coverage
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
run: printenv

- name: Run Cypress tests
run: yarn serve:integration & yarn test:integration -s $(node .github/split.js)
run: yarn serve:integration & yarn test:integration -s $(node .github/split.mjs)
env:
WORKER_NUM: ${{ matrix.worker }}
WORKER_COUNT: 5

0 comments on commit 39ec58f

Please sign in to comment.