Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d2dcdf1
Upgrade TS to 5.8
RichDom2185 Jul 21, 2025
7348764
Remove deprecated tsconfig option
RichDom2185 Jul 21, 2025
a392268
Remove duplicate properties
RichDom2185 Jul 21, 2025
0b77281
Merge branch 'master' into ts-58
RichDom2185 Aug 13, 2025
68e316a
Upgrade TS to v5.9
RichDom2185 Aug 13, 2025
ee7b2e3
Add types for mathjs
RichDom2185 Aug 13, 2025
27bba9d
Fix some type errors
RichDom2185 Aug 13, 2025
6e252b6
Update tsconfig
RichDom2185 Aug 13, 2025
3ab92ba
Fix more type errors
RichDom2185 Aug 13, 2025
1630263
Fix remaining errors
RichDom2185 Aug 13, 2025
63320b0
Update GitHub workflows
RichDom2185 Aug 13, 2025
bad081b
Fix type error
RichDom2185 Aug 13, 2025
d8d6fa3
Update scm-slang to latest
RichDom2185 Aug 13, 2025
ab7273d
Merge branch 'master' of https://github.com/source-academy/js-slang i…
RichDom2185 Aug 16, 2025
0710bcd
Add newline to EOF
RichDom2185 Aug 16, 2025
8ef004f
Fix cse-machine types and utils to use fewer type assertions
leeyi45 Aug 20, 2025
e48bbfc
Migrate to vitest tests
leeyi45 Aug 23, 2025
8d1402b
Migrate tests to vitest
leeyi45 Aug 23, 2025
1adb943
Relocate base error files and types
leeyi45 Aug 23, 2025
2983e1f
Get modules tests working
leeyi45 Aug 23, 2025
6f4c63f
run format
leeyi45 Aug 23, 2025
c5a9ddd
Merge branch 'ts-58' into vitest-testing-refactor
leeyi45 Aug 23, 2025
64116b9
Sort tsconfig compiler options
leeyi45 Aug 23, 2025
9d88e44
Update eslint packages to match typescript version
leeyi45 Aug 24, 2025
8c1783d
Small linting change
leeyi45 Aug 24, 2025
c3fff23
Merge commit '02bf9398aa66a61c5baa507cca342ca6e4d30c74' into vitest-t…
leeyi45 Aug 24, 2025
597b827
Use function names instead of strings for describe blocks
leeyi45 Aug 25, 2025
01d26d7
Merge branch 'ts-58-cse-addons' into vitest-testing-refactor
leeyi45 Aug 25, 2025
aa6edb3
Include scripts in linting
leeyi45 Aug 25, 2025
df75d1c
Move tests and replace describe titles with functions
leeyi45 Aug 25, 2025
c8e0244
Add type modifiers and reformat tests
leeyi45 Aug 25, 2025
ec8696e
Simplify isEnvDependent code
leeyi45 Aug 25, 2025
0badbac
Instruct tsc to ignore py-slang's tests during build
leeyi45 Aug 25, 2025
bedc719
Move walkers to be under utils/ast
leeyi45 Aug 25, 2025
3c11c48
Update tests failing due to timeout
leeyi45 Aug 26, 2025
0f5c20b
Update cse-machine typings
leeyi45 Aug 29, 2025
63f9deb
Incorporate import assertions into docs importer
leeyi45 Aug 29, 2025
823187b
Add context property to error result
leeyi45 Aug 29, 2025
084e817
Update test timeout and add no-restricted-import rule for commander i…
leeyi45 Aug 30, 2025
dc177eb
Update snapshots
leeyi45 Aug 31, 2025
8b4bf21
Run format
leeyi45 Aug 31, 2025
425ced8
Update snapshots again....
leeyi45 Aug 31, 2025
194f8e9
Run format
leeyi45 Aug 31, 2025
068a691
Change to use the test.each
leeyi45 Sep 1, 2025
e6324f7
Disable the svmc snapshot test cause it doesn't work
leeyi45 Sep 1, 2025
5cdc579
Add a new test for properties when loading modules
leeyi45 Sep 2, 2025
7b78005
Merge commit '9c2e795d4e05a1ae172e0b8576ab55bb49cd4bd4' into vitest-t…
leeyi45 Sep 3, 2025
ed08cf8
Run format
leeyi45 Sep 3, 2025
afad324
Merge commit '4105ea06fe95a4ed41b505ad14381fab99802075' into vitest-t…
leeyi45 Sep 17, 2025
59e099d
Convert stdlib parser to use nodetypetonode helper type
leeyi45 Sep 27, 2025
cc1ad64
A working version of the statementSeqTransform
leeyi45 Sep 27, 2025
c709a62
More compact version of seq transform
leeyi45 Sep 27, 2025
6d393c0
Remove unnecessary type assertions
leeyi45 Sep 27, 2025
e13ecac
Clean up some documentation bits and pieces
leeyi45 Sep 27, 2025
7c685be
Use type imports for tracer
leeyi45 Sep 27, 2025
12b5cf7
Swap the list library to use generics
leeyi45 Sep 27, 2025
2daf1ec
Fix some error messages and tests
leeyi45 Sep 27, 2025
3d4a15a
Fix list tests
leeyi45 Sep 29, 2025
adfa058
Run format
leeyi45 Sep 29, 2025
03781e6
Update stream library and tests
leeyi45 Sep 30, 2025
e315f64
Running format
leeyi45 Sep 30, 2025
3f7e2d0
Add some documentation for the scripts
leeyi45 Sep 30, 2025
a883737
Remove unnecessary packages
leeyi45 Oct 4, 2025
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
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[*]
end_of_line = lf
end_of_line = lf
4 changes: 3 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install dependencies (apt)
run: |
sudo apt-get update && \
Expand Down
76 changes: 38 additions & 38 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,41 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check for package-lock.json
run: |
if [ -e package-lock.json ]; then
echo "package-lock.json found; please do not use NPM! This project uses Yarn!"
exit 1
fi
exit 0
- name: Install dependencies (apt)
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
texlive texlive-fonts-extra texlive-lang-cjk latexmk latex-cjk-all
# Has to be run before actions/setup-node.
# See: https://github.com/actions/setup-node/issues/480
- name: Enable corepack for Yarn
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- run: yarn build
- run: yarn format:ci
- run: yarn eslint
- run: yarn test-coverage
env:
CI: true
- name: Check that docs build
run: yarn jsdoc prepare
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Check for package-lock.json
run: |
if [ -e package-lock.json ]; then
echo "package-lock.json found; please do not use NPM! This project uses Yarn!"
exit 1
fi
exit 0
- name: Install dependencies (apt)
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
texlive texlive-fonts-extra texlive-lang-cjk latexmk latex-cjk-all
# Has to be run before actions/setup-node.
# See: https://github.com/actions/setup-node/issues/480
- name: Enable corepack for Yarn
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- run: yarn build
- run: yarn format:ci
- run: yarn eslint
- run: yarn test-coverage
env:
CI: true
- name: Check that docs build
run: yarn jsdoc prepare
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ coverage/

.vscode/
*.tsbuildinfo
test-report.html
test-report

# yarn files

Expand All @@ -27,4 +27,4 @@ test-report.html
!.yarn/releases
!.yarn/sdks
!.yarn/versions
yarn-error.log
yarn-error.log
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/src/alt-langs/
/src/py-slang/
/src/**/__tests__/**/__snapshots__
/src/**/__tests__/**/__snapshots__
61 changes: 50 additions & 11 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import vitestPlugin from '@vitest/eslint-plugin'
import tseslint from 'typescript-eslint'
import globals from 'globals'
import * as importPlugin from 'eslint-plugin-import'
Expand All @@ -11,45 +12,68 @@ export default tseslint.config(
},
...tseslint.configs.recommended,
{
files: ['**/*.ts*', 'scripts/*.mjs'],
languageOptions: {
globals: {
...globals.node,
...globals.es2016,
...globals.browser
},
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json'
}
},
plugins: {
'@typescript-eslint': tseslint.plugin,
import: importPlugin
},
rules: {
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': ['warn', { 'prefer-inline': true }],
'import/order': 'warn',
'@typescript-eslint/no-base-to-string': 'off', // TODO: Remove
'prefer-const': 'off', // TODO: Remove

'no-constant-condition': ['warn', { checkLoops: false }],
'no-restricted-imports': [
'error',
{
paths: [{
name: 'commander',
message: 'Import from @commander-js/extra-typings instead'
}]
}
],
'no-var': 'off', // TODO: Remove
'object-shorthand': ['warn', 'properties'],
'prefer-const': 'off', // TODO: Remove
'prefer-rest-params': 'off',
}
},
{
files: ['**/*.ts*'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json'
}
},
plugins: {
'@typescript-eslint': tseslint.plugin,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-base-to-string': 'off', // TODO: Remove
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
Expand All @@ -62,12 +86,27 @@ export default tseslint.config(
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
'@typescript-eslint/unbound-method': 'off',
'prefer-rest-params': 'off'
}
},
{
files: ['**/*.js', 'src/repl/*.ts'],
extends: [vitestPlugin.configs.recommended],
files: ['**/__tests__/**/*.test.ts'],
plugins: {
vitest: vitestPlugin
},
rules: {
'no-empty-pattern': 'off',
'vitest/expect-expect': 'off', // TODO turn this back on
'vitest/no-focused-tests': ['warn', { fixable: false }],
'vitest/prefer-describe-function-title': 'warn',
'vitest/valid-describe-callback': 'off',
'vitest/valid-title': 'off',
}
},
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off'
}
Expand Down
79 changes: 15 additions & 64 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,60 +30,53 @@
"bin": "dist/repl/index.js",
"dependencies": {
"@babel/parser": "^7.19.4",
"@commander-js/extra-typings": "^12.0.1",
"@joeychenofficial/alt-ergo-modified": "^2.4.0",
"@commander-js/extra-typings": "^14.0.0",
"@ts-morph/bootstrap": "^0.18.0",
"@types/estree": "^1.0.5",
"acorn": "^8.8.2",
"acorn-class-fields": "^1.0.0",
"acorn-loose": "^8.0.0",
"acorn-walk": "^8.0.0",
"astring": "^1.4.3",
"commander": "^12.0.0",
"commander": "^14.0.0",
"js-base64": "^3.7.5",
"lodash": "^4.17.21",
"source-map": "0.7.6"
},
"scripts": {
"build": "yarn docs && yarn build:slang",
"build:slang": "tsc --project tsconfig.prod.json",
"eslint": "eslint src",
"eslint": "eslint --concurrency=auto src scripts",
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"format:ci": "prettier --list-different \"src/**/*.{ts,tsx}\"",
"test": "node ./scripts/run_jest.mjs",
"test": "vitest",
"test-coverage": "yarn test --coverage",
"docs": "node ./scripts/docs.mjs docs",
"jsdoc": "node ./scripts/docs.mjs",
"autocomplete": "node ./scripts/docs.mjs autocomplete",
"build_sicp_package": "yarn build && node ./scripts/build_sicp_package.mjs",
"publish_sicp_package": "./scripts/publish_sicp_package.sh",
"benchmark": "node ./scripts/run_jest.mjs --runInBand --testPathPattern='.*benchmark.*' --testPathIgnorePatterns='/dist/'",
"benchmark": "vitest benchmark",
"prepare": "husky"
},
"devDependencies": {
"@babel/core": "^7.26.10",
"@babel/preset-env": "^7.23.2",
"@types/babel__core": "^7",
"@types/jest": "^29.0.0",
"@types/estree": "^1.0.5",
"@types/lodash": "^4.14.202",
"@types/node": "^20.0.0",
"@types/offscreencanvas": "^2019.7.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/eslint-plugin": "^1.3.4",
"@vitest/ui": "3.2.4",
"ace-builds": "~1.17.0",
"coveralls": "^3.1.0",
"escodegen": "^2.0.0",
"eslint": "^9.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint": "^9.35.0",
"eslint-plugin-import": "^2.32.0",
"globals": "^16.0.0",
"husky": "^9.0.0",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
"jest-html-reporter": "^3.2.0",
"jsdoc": "3.6.11",
"jsdom": "^19.0.0",
"prettier": "^3.6.2",
"ts-jest": "^29.0.0",
"typescript": "^4.0.3",
"typescript-eslint": "^8.8.1"
"typescript": "^5.9.2",
"typescript-eslint": "^8.40.0",
"vitest": "^3.2.4"
},
"devEngines": {
"packageManager": {
Expand All @@ -92,47 +85,5 @@
"onFail": "error"
}
},
"packageManager": "[email protected]",
"jest": {
"snapshotFormat": {
"escapeString": true,
"printBasicPrototype": true
},
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"\\.ts$": "ts-jest",
"\\.js$": "babel-jest"
},
"testEnvironment": "jsdom",
"testRegex": "/__tests__/.*\\.ts$",
"testPathIgnorePatterns": [
"/dist/",
"/src/alt-langs/scheme/scm-slang",
".*benchmark.*",
"/__tests__/(.*/)?utils\\.ts"
],
"coveragePathIgnorePatterns": [
"/dist/",
"/node_modules/",
"/src/typings/",
"/src/utils/testing.ts",
"/src/alt-langs/scheme/scm-slang",
"/src/py-slang/"
],
"reporters": [
"default",
[
"./node_modules/jest-html-reporter",
{
"pageTitle": "Test Report",
"includeFailureMsg": true,
"includeConsoleLog": true
}
]
],
"prettierPath": null
}
"packageManager": "[email protected]"
}
3 changes: 3 additions & 0 deletions scripts/autocomplete.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ async function processDirGlobals(target) {
return undefined
}

/**
* Generates the autocomplete documentation for js-slang
*/
export default async function autocomplete() {
try {
// Check that the BASE_DIR exists and that we can read from it
Expand Down
Loading
Loading