Skip to content

Commit

Permalink
Complete migration to ESM (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp authored Dec 21, 2024
1 parent b3cda83 commit a9e9210
Show file tree
Hide file tree
Showing 193 changed files with 895 additions and 1,082 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# Do not support --experimental-require-module
# Commented until we have a solution to run tests without it
# node: [14, 16, 18, 20, 22]
# node: [20, 22] // fails on 20 with (0 , _getDomain.default) is not a function
node: [22]
node: [20, 22]
steps:
- uses: actions/checkout@v4

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ test:

ci:
npm install
npx jest
make unit
make lint
make restart
npx lerna run prepublish
node bundle.js
make e2e
make bundlesize

unit:
npx jest

e2e:
NODE_TLS_REJECT_UNAUTHORIZED=0 npx jest --runInBand --config e2e.config.js
NODE_TLS_REJECT_UNAUTHORIZED=0 npx jest --runInBand --config e2e.config.cjs

clean:
make stop
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions bundle.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env node

'use strict'
import fs from "fs"
import path from "path"
import browserify from "browserify"
import commonShake from "common-shakeify"
import packFlat from "browser-pack-flat"
import exorcist from "exorcist"
import { minify } from "uglify-js"

const fs = require('fs')
const path = require('path')
const browserify = require('browserify')
const commonShake = require('common-shakeify')
const packFlat = require('browser-pack-flat')
const exorcist = require('exorcist')
const {minify} = require('uglify-js')
const __dirname = import.meta.dirname;

const dist = path.join(__dirname, 'packages/client/dist')

Expand Down
File renamed without changes.
8 changes: 5 additions & 3 deletions eslint.config.mjs → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line n/no-extraneous-import
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
Expand Down Expand Up @@ -26,7 +27,7 @@ export default [
jsx: true,
},
},
sourceType: "commonjs",
sourceType: "module",
},

rules: {
Expand Down Expand Up @@ -78,12 +79,13 @@ export default [
"unicorn/prefer-event-target": 0,
"unicorn/prefer-top-level-await": 0,
"unicorn/prefer-node-protocol": 0,
"unicorn/prefer-export-from": "off",
},
},
{
files: ["packages/client/**/*.js"],
files: ["**/*.cjs"],
languageOptions: {
sourceType: "module",
sourceType: "commonjs",
},
},
{
Expand Down
File renamed without changes.
Loading

0 comments on commit a9e9210

Please sign in to comment.