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

[add] reproduction for node_modules import bug #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Run reproduction
on: [push]
on: [push, pull_request]

jobs:
run:
Expand Down
15 changes: 14 additions & 1 deletion example.ts
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
console.log('Some .ts code reproducing a bug');
import { register } from 'ts-node'
import { JSDOM } from 'jsdom';

register({
ignore: [],
compilerOptions: { module: 'CommonJS' }
});

const { window } = new JSDOM();

for (const key of ['self', 'document', 'HTMLElement', 'HTMLUnknownElement'])
global[key] = window[key];

import('boot-cell/source/Reminder/Icon')
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"dependencies": {
"ts-node": "latest",
"typescript": "latest"
"boot-cell": "^1.0.0-rc.2",
"classnames": "^2.2.6",
"jsdom": "^16.2.1",
"react": "^16.13.1",
"ts-node": "^8.8.1",
"typescript": "latest",
"web-cell": "^2.0.0-rc.20",
"web-utility": "^0.13.0"
},
"devDependencies": {
"@types/jsdom": "^16.1.1",
"@types/node": "^12.12.31"
}
}
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Node",
"jsx": "react",
"jsxFactory": "createCell",
"target": "ES6",
"lib": ["ES2019"]
}
}
Loading