Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete migration to ESM #1024

Merged
merged 7 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading