Skip to content

Commit

Permalink
MISC: Support JSX, TS, TSX script files (bitburner-official#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg authored and antoinedube committed Aug 5, 2024
1 parent d558f65 commit 285730d
Show file tree
Hide file tree
Showing 38 changed files with 895 additions and 201 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ module.exports = {
"^monaco-editor$": "<rootDir>/test/__mocks__/NullMock.js",
"^monaco-vim$": "<rootDir>/test/__mocks__/NullMock.js",
"/utils/Protections$": "<rootDir>/test/__mocks__/NullMock.js",
"@swc/wasm-web": "@swc/core",
},
};
2 changes: 1 addition & 1 deletion markdown/bitburner.ns.read.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Data in the specified text file.

RAM cost: 0 GB

This function is used to read data from a text file (.txt) or script (.js or .script).
This function is used to read data from a text file (.txt, .json) or script (.js, .jsx, .ts, .tsx, .script).

This function will return the data in the specified file. If the file does not exist, an empty string will be returned.

2 changes: 1 addition & 1 deletion markdown/bitburner.ns.wget.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ True if the data was successfully retrieved from the URL, false otherwise.

RAM cost: 0 GB

Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.js or .script) or a text file (.txt). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).
Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.js, .jsx, .ts, .tsx, .script) or a text file (.txt, .json). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).

IMPORTANT: This is an asynchronous function that returns a Promise. The Promise’s resolved value will be a boolean indicating whether or not the data was successfully retrieved from the URL. Because the function is async and returns a Promise, it is recommended you use wget in NetscriptJS (Netscript 2.0).

Expand Down
2 changes: 1 addition & 1 deletion markdown/bitburner.ns.write.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void

RAM cost: 0 GB

This function can be used to write data to a text file (.txt) or a script (.js or .script).
This function can be used to write data to a text file (.txt, .json) or a script (.js, .jsx, .ts, .tsx, .script).

This function will write data to that file. If the specified file does not exist, then it will be created. The third argument mode defines how the data will be written to the file. If mode is set to “w”, then the data is written in “write” mode which means that it will overwrite all existing data on the file. If mode is set to any other value then the data will be written in “append” mode which means that the data will be added at the end of the file.

261 changes: 253 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@
"url": "https://github.com/bitburner-official/bitburner-src/issues"
},
"dependencies": {
"@babel/standalone": "^7.24.4",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@material-ui/core": "^4.12.4",
"@mui/icons-material": "^5.14.12",
"@mui/material": "^5.14.12",
"@mui/styles": "^5.14.12",
"@mui/system": "^5.14.12",
"@swc/wasm-web": "^1.4.14",
"@types/estree": "^1.0.2",
"@types/react-syntax-highlighter": "^15.5.8",
"acorn": "^8.10.0",
"acorn-walk": "^8.2.0",
"acorn": "^8.11.3",
"acorn-jsx-walk": "^2.0.0",
"acorn-walk": "^8.3.2",
"arg": "^5.0.2",
"bcryptjs": "^2.4.3",
"better-react-mathjax": "^2.0.3",
Expand Down Expand Up @@ -55,6 +58,8 @@
"@microsoft/api-documenter": "^7.23.9",
"@microsoft/api-extractor": "^7.38.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@swc/core": "^1.4.14",
"@types/babel__standalone": "^7.1.7",
"@types/bcryptjs": "^2.4.4",
"@types/escodegen": "^0.0.7",
"@types/file-saver": "^2.0.5",
Expand Down
Loading

0 comments on commit 285730d

Please sign in to comment.