Skip to content

Commit

Permalink
Change to improve development process
Browse files Browse the repository at this point in the history
- use local build script instead of xcratch-build
- build automatically
- use local setup script instead of xcratch-register
- no modify scratch-vm/scratch-gui
- eslint according to origin
- test using Mocha
  • Loading branch information
yokobond committed Jan 5, 2024
1 parent cf03ede commit 8e99045
Show file tree
Hide file tree
Showing 35 changed files with 11,884 additions and 2,364 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage/*
dist/*
node_modules/*
playground/*
benchmark/*
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/node_modules
node_modules/

src/vm/*
!src/vm/extensions/
!src/vm/.*
4 changes: 4 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
require: ["@babel/register", "./test/setup-test.js"],
spec: "test/unit/**/*.test.js",
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Koji Yokokawa
Copyright (c) 2021-2024 Koji Yokokawa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ https://xcratch.github.io/xcx-example/dist/xcratchExample.mjs

## Development

### Register on the local Xcratch
### Install Dependencies

Run register script to install this extension on the local Xcratch for testing.
```sh
npm install
```

### Setup Development Environment

Change ```vmSrcOrg``` to your local ```scratch-vm``` directory in ```./scripts/setup-dev.js``` then run setup-dev script to setup development environment.

```sh
npm run register
npm run setup-dev
```

### Bundle into a Module
Expand All @@ -39,12 +45,20 @@ Run build script to bundle this extension into a module file which could be load
npm run build
```

### Linting
### Watch and Bundle

Install eslint-config following Scratch team.
Run watch script to watch the changes of source files and bundle automatically.

```sh
npm install
npm run watch
```

### Test

Run test script to test this extension.

```sh
npm run test
```


Expand Down
13 changes: 13 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": true
},
"useBuiltIns": "entry"
}
]
]
}
Loading

0 comments on commit 8e99045

Please sign in to comment.