Skip to content
Draft
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
3 changes: 3 additions & 0 deletions src/bundles/torch/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabs": []
}
32 changes: 32 additions & 0 deletions src/bundles/torch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@sourceacademy/bundle-torch",
"version": "1.0.0",
"private": true,
"dependencies": {
"@veehz/torch": "^0.1.2"
},
"devDependencies": {
"@sourceacademy/modules-buildtools": "workspace:^",
"typescript": "^5.8.2"
},
"type": "module",
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js"
},
"scripts": {
"build": "buildtools build bundle .",
"lint": "buildtools lint .",
"tsc": "buildtools tsc .",
"test": "buildtools test --project .",
"postinstall": "buildtools compile",
"serve": "yarn buildtools serve"
},
"scripts-info": {
"build": "Compiles the given bundle to the output directory",
"lint": "Runs ESlint on the code in the bundle",
"serve": "Starts the modules server",
"test": "Runs unit tests defined for the bundle",
"tsc": "Runs the Typescript compiler and produces the library version of the bundle"
}
Comment on lines +17 to +31
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The serve script and its corresponding description in scripts-info seem unnecessary for this bundle. Since torch is a library-only bundle without any UI components (as indicated by the empty tabs array in manifest.json), there's nothing to serve. Removing unused scripts helps keep the configuration clean and avoids confusion.

  "scripts": {
    "build": "buildtools build bundle .",
    "lint": "buildtools lint .",
    "tsc": "buildtools tsc .",
    "test": "buildtools test --project .",
    "postinstall": "buildtools compile"
  },
  "scripts-info": {
    "build": "Compiles the given bundle to the output directory",
    "lint": "Runs ESlint on the code in the bundle",
    "test": "Runs unit tests defined for the bundle",
    "tsc": "Runs the Typescript compiler and produces the library version of the bundle"
  }

}
8 changes: 8 additions & 0 deletions src/bundles/torch/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Machine learning library based on PyTorch.
*
* @module torch
* @author Vee Hua Zhi
*/

export * from '@veehz/torch';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While this file correctly exports the torch module, there are no accompanying tests. For a new library feature, it's crucial to add tests to verify its functionality, ensure proper integration, and prevent future regressions. Please consider adding unit tests for this module.

12 changes: 12 additions & 0 deletions src/bundles/torch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.json",
"include": [
"./src"
],
"compilerOptions": {
"outDir": "./dist"
},
"typedocOptions": {
"name": "torch"
}
}
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4166,6 +4166,16 @@ __metadata:
languageName: unknown
linkType: soft

"@sourceacademy/bundle-torch@workspace:src/bundles/torch":
version: 0.0.0-use.local
resolution: "@sourceacademy/bundle-torch@workspace:src/bundles/torch"
dependencies:
"@sourceacademy/modules-buildtools": "workspace:^"
"@veehz/torch": "npm:^0.1.2"
typescript: "npm:^5.8.2"
languageName: unknown
linkType: soft

"@sourceacademy/bundle-unittest@workspace:^, @sourceacademy/bundle-unittest@workspace:src/bundles/unittest":
version: 0.0.0-use.local
resolution: "@sourceacademy/bundle-unittest@workspace:src/bundles/unittest"
Expand Down Expand Up @@ -5846,6 +5856,13 @@ __metadata:
languageName: node
linkType: hard

"@veehz/torch@npm:^0.1.2":
version: 0.1.2
resolution: "@veehz/torch@npm:0.1.2"
checksum: 10c0/09e531a2ca7db3b3bd6e38a0ffde9667b90975f506093a817f05b4c92145c32a944cb8c3052fdbbcdc0a18bc4f48410693be6a0f569fceb54fa7ba348ca1fbe7
languageName: node
linkType: hard

"@vitejs/plugin-react@npm:^6.0.1":
version: 6.0.1
resolution: "@vitejs/plugin-react@npm:6.0.1"
Expand Down
Loading