Skip to content

Commit

Permalink
refactor exports and add esm export (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba authored Aug 1, 2023
1 parent c8e7407 commit 499075d
Show file tree
Hide file tree
Showing 97 changed files with 76,125 additions and 34,739 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'

- name: npm-install
run: npm install
Expand Down
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ts from 'typescript';
const ts = require('typescript');

export default options => context => node => {
module.exports = options => context => node => {
return ts.visitEachChild(node, (node) => visitor(context.factory, node, options), context);
}

Expand All @@ -9,10 +9,10 @@ function visitor(factory, node, options) {
!isClassIncluded(node.name.escapedText, options)) {
return node;
}
if (isClassDerived(node)) {
// workaround for https://github.com/microsoft/TypeScript/issues/46503
return splitClassIntoConstAndInterface(factory, node);
}
// if (isClassDerived(node)) {
// // workaround for https://github.com/microsoft/TypeScript/issues/46503
// return splitClassIntoConstAndInterface(factory, node);
// }
return createNodeWithFactories(factory, node);
}

Expand Down
2 changes: 1 addition & 1 deletion build-utils/license.js → build-utils/license.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const version = process.env.npm_package_version;

export default `
module.exports = `
Planck.js v${version}
@license The MIT license
@copyright Copyright (c) 2021 Erin Catto, Ali Shakiba
Expand Down
Loading

0 comments on commit 499075d

Please sign in to comment.