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

Further Enhancements of Module System #1427

Closed
wants to merge 98 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
8d9d083
Add import support to ec evaluator
leeyi45 Mar 29, 2023
c0dbbfa
Add support for import checking
leeyi45 Mar 29, 2023
b4ff44a
Run format
leeyi45 Mar 29, 2023
08becf1
Fix module loader test
leeyi45 Mar 29, 2023
6d8c5f1
Add tests
leeyi45 Mar 29, 2023
92a96b3
Run format
leeyi45 Mar 29, 2023
8d4f327
Add require provider
leeyi45 Mar 30, 2023
db37dfc
Improve error handling
leeyi45 Mar 30, 2023
829a688
Make stdlib available
leeyi45 Mar 30, 2023
4f9de1d
Update module loading and tests
leeyi45 Mar 30, 2023
807b9ff
Fix require provider not properly providing js-slang
leeyi45 Mar 30, 2023
c291838
Made EC evaluator and transpiler async on imports
leeyi45 Apr 1, 2023
442da85
Unify transpiler and ECE imports
leeyi45 Apr 4, 2023
587a276
Ran format
leeyi45 Apr 4, 2023
7243a3c
Add async module loader code
leeyi45 Apr 19, 2023
27e29b3
Consolidate import options into single object
leeyi45 Apr 19, 2023
35b2e35
Finish merge
leeyi45 Apr 19, 2023
d5f61a2
Introduce the import analyzer
leeyi45 May 2, 2023
edd52b5
Integrate source modules into preprocessor
leeyi45 May 3, 2023
eb38402
Remove import checking from import loader
leeyi45 May 3, 2023
39b47d2
Update undefined variable checker
leeyi45 May 3, 2023
15d937b
Fix ecEval not working with async
leeyi45 May 3, 2023
5232c96
Remove unnecessary import checking
leeyi45 May 3, 2023
8c9adbd
Refactor AST utils
leeyi45 May 3, 2023
cc14d4b
Temporary fix for parsers not respecting throwOnError
leeyi45 May 3, 2023
6b79c01
Fix broken tests
leeyi45 May 3, 2023
61a01cf
Ran format
leeyi45 May 3, 2023
7342b26
Make eslint ignore test files
leeyi45 May 3, 2023
b3f8a4c
Update transpiler tests
leeyi45 May 5, 2023
c47c030
Reorganize AST utilities
leeyi45 May 6, 2023
400d918
Make name-extractor async
leeyi45 May 9, 2023
3124083
Relocate modules preprocessor
leeyi45 May 9, 2023
fdbeaa6
Fully relocate imports preprocessor
leeyi45 May 10, 2023
8674190
Relocate all errors related to imports
leeyi45 May 10, 2023
260641c
Allow import options to be used in tests
leeyi45 May 10, 2023
c36341b
Fix infinite loop tests
leeyi45 May 10, 2023
11c9534
Update variable checker and its tests
leeyi45 May 10, 2023
2ec2399
Update error messages
leeyi45 May 10, 2023
f7eea13
Add new convenience method for defaiult exports
leeyi45 May 10, 2023
9397c90
Fix SourceMapConsumer not working with tests
leeyi45 May 10, 2023
831e457
Fix babel not working with jest
leeyi45 May 10, 2023
fc99abd
Refactor module resolution into its own function and added tests
leeyi45 May 10, 2023
be7d663
Allow import hoister to support namespace specifiers
leeyi45 May 10, 2023
644360a
Update how evaluation options are handled
leeyi45 May 10, 2023
2cca4d9
Update tests
leeyi45 May 10, 2023
9ccf4ae
Fix transpiler not accepting options properly
leeyi45 May 10, 2023
0150036
Ran format
leeyi45 May 10, 2023
e4b0b5b
Remove unused code
leeyi45 May 10, 2023
5a62163
Ran format
leeyi45 May 10, 2023
75a2eec
Ran format
leeyi45 May 10, 2023
e865d43
Fix broken tests
leeyi45 May 10, 2023
dc5b936
Ran format
leeyi45 May 10, 2023
3676f63
Make call location info available to functions
leeyi45 May 11, 2023
76585e1
Ran format
leeyi45 May 12, 2023
f227d7d
Modify scoping ruies for variable checker
leeyi45 May 16, 2023
5f7e3c8
Switch to assertions
leeyi45 May 18, 2023
a032cbb
Use base walkers provided in acorn-walk
leeyi45 May 18, 2023
d29fd7e
Add documentation
leeyi45 May 18, 2023
1924348
Update all non-major dependencies
renovate[bot] May 20, 2023
1980e40
Update undefined variable checker
leeyi45 May 22, 2023
bbf070b
Add extra estree typings
leeyi45 May 22, 2023
621bf92
Add new error for default reexports and move documentation loader out…
leeyi45 May 22, 2023
0d02bde
Merge commit '1924348d478cb7494b3f12e4ccd2cce130a0a0ad' into async-im…
leeyi45 May 22, 2023
0e713eb
Update all non-major dependencies
renovate[bot] Jun 8, 2023
74b4626
Resolve the entrypoint file path
leeyi45 Jun 9, 2023
129657c
Refactor errors and add new error for rexporting default exports
leeyi45 Jun 9, 2023
e27ddce
Create a custom assertion error
leeyi45 Jun 9, 2023
6a30486
Fix moduleLoaderAsync not returning the correct object type
leeyi45 Jun 9, 2023
630516b
Ran format
leeyi45 Jun 9, 2023
c5d7478
Consolidate all module errors types
leeyi45 Jun 9, 2023
7107584
Handle module declarations only when checking program nodes
leeyi45 Jun 9, 2023
1878506
Add new AST helper types
leeyi45 Jun 9, 2023
6da586c
Formatting
leeyi45 Jun 9, 2023
9f2b2c3
Finish merge
leeyi45 Jun 10, 2023
8e2c461
Ran format
leeyi45 Jun 10, 2023
f3680b4
Ensure that 'default' is as a name is accounted for exports and imports
leeyi45 Jun 10, 2023
8f7e2ba
Add type imports and remove unnecessary imports
leeyi45 Jun 11, 2023
8e402d7
Consolidate type guards
leeyi45 Jun 11, 2023
8263b07
Ran format
leeyi45 Jun 11, 2023
a9300b0
Add extra analyzer tests
leeyi45 Jun 12, 2023
10c2d02
Refactor type imports
leeyi45 Jun 12, 2023
79861fc
Ran lint and format
leeyi45 Jun 12, 2023
0a0a48e
Ran lint and format
leeyi45 Jun 12, 2023
d88c3e1
Add support for exportnameddeclarations with local sources
leeyi45 Jun 12, 2023
62d6a1d
Resolve local imports that import through other local modules
leeyi45 Jun 12, 2023
d48532c
Make export reducer work with allowUndefinedImports
leeyi45 Jun 14, 2023
1f55051
Update documentation and AST type guards
leeyi45 Jun 14, 2023
651e5b8
Refactor promise with timeout into function
leeyi45 Jun 15, 2023
6983ca1
Remove old reduce exports code
leeyi45 Jun 15, 2023
d7ee6df
Reduce the number of source import check calls
leeyi45 Jun 20, 2023
0a65b62
Add documentation for utils
leeyi45 Jun 20, 2023
51b2619
Remove old code
leeyi45 Jun 20, 2023
cb469db
Update name-extractor to provide more information for documentation
leeyi45 Jun 20, 2023
ad6f30d
Add option to not perform variable hoisting when checking for undefin…
leeyi45 Jun 20, 2023
7feb6d7
Revert "Add option to not perform variable hoisting when checking for…
leeyi45 Jun 21, 2023
2f54f04
Fix typed parser throwing errors when encountering redeclared builtins
leeyi45 Jun 22, 2023
42753c1
Update node types
leeyi45 Jun 22, 2023
8d7bbb4
Ran format
leeyi45 Jun 22, 2023
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 .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "stage-2"]
"presets": ["@babel/preset-env"]
}
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"project": "tsconfig.json",
"sourceType": "module"
},
"ignorePatterns": [
"**/__tests__/**",
"**/__mocks__/**",
"jest.setup.ts"
],
"plugins": [
"@typescript-eslint",
"simple-import-sort"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ coverage/
.vscode/
tsconfig.tsbuildinfo
test-report.html
yarn-error.log
17 changes: 17 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { SourceMapConsumer } from "source-map"

jest.mock('lodash', () => ({
...jest.requireActual('lodash'),
memoize: jest.fn((x: any) => x),
}))


jest.mock('./src/modules/moduleLoaderAsync')
jest.mock('./src/modules/moduleLoader')

// @ts-ignore
SourceMapConsumer.initialize({
'lib/mappings.wasm': 'https://unpkg.com/[email protected]/lib/mappings.wasm'
})

global.fetch = jest.fn()
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@babel/parser": "^7.19.4",
"@joeychenofficial/alt-ergo-modified": "^2.4.0",
"@ts-morph/bootstrap": "^0.18.0",
"@ts-morph/bootstrap": "^0.20.0",
"@types/estree": "0.0.52",
"acorn": "^8.8.2",
"acorn-class-fields": "^1.0.0",
Expand All @@ -44,7 +44,7 @@
"js-base64": "^3.7.5",
"lodash": "^4.17.20",
"node-getopt": "^0.3.2",
"source-map": "0.7.3",
"source-map": "0.7.4",
"xmlhttprequest-ts": "^1.0.1"
},
"scripts": {
Expand All @@ -64,10 +64,11 @@
"prepare": "husky install"
},
"devDependencies": {
"@babel/preset-env": "^7.21.5",
"@types/jest": "^29.0.0",
"@types/lodash.assignin": "^4.2.6",
"@types/lodash.clonedeep": "^4.5.6",
"@types/node": "^17.0.5",
"@types/node": "^20.3.1",
"@types/offscreencanvas": "^2019.7.0",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.1",
Expand Down Expand Up @@ -96,6 +97,9 @@
"ts",
"js"
],
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.ts"
],
"transform": {
"\\.ts$": "ts-jest",
"\\.js$": "babel-jest"
Expand Down
Loading