豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 7f44afe

Browse files
Merge pull request #2 from OmniBlocks/main
Update upstream
2 parents 754d40e + 217d144 commit 7f44afe

File tree

132 files changed

+23903
-15355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+23903
-15355
lines changed

.amazonq/rules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
README.md
2+
3+
also do not constantly brag about resource updates and multilingual support

.browserslistrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
chrome >= 70
1+
chrome >= 102
22
chromeandroid >= 70
33
ios >= 12
44
safari >= 12
55
edge >= 18
6-
firefox >= 68
6+
firefox >= 68

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Resolves
22

3-
_What Github issue does this resolve (please include link)?_
3+
_What Github issue does this resolve (if any, if not then please include link)?_
44

55
- Resolves #
66

@@ -10,7 +10,7 @@ _Describe what this Pull Request does_
1010

1111
### Reason for Changes
1212

13-
_Explain why these changes should be made_
13+
_Explain why these changes should be made. Why is this helpful or necessary? Why should this be added?_
1414

1515
### Test Coverage
1616

.github/copilot-instructions.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copilot Instructions for scratch-gui (OmniBlocks/TurboWarp)
2+
## OmniBlocks Project Description & Licensing
3+
OmniBlocks is a developing Multi‑Language IDE. Currently based on TurboWarp, which is a mod of Scratch 3, for the block editor.
4+
Text editors are also planned for languages like Python or C, but they are not implemented yet.
5+
OmniBlocks adds some cool things to the classic block editor, such as a music editor or extra features.
6+
OmniBlocks' and TurboWarp's modifications to Scratch are licensed under the GNU General Public License v3.0.
7+
The OmniBlocks logo is licensed under CC BY‑SA 4.0. The logo incorporates the Python logo, which is a trademark of the Python Software Foundation, used here solely to reference the Python programming language. This project is not affiliated with or endorsed by the Python Software Foundation.
8+
The OmniBlocks mascot "Boxy" is licensed under CC BY‑SA 4.0.
9+
10+
## Project Overview
11+
12+
## Architecture & Data Flow
13+
- GUI logic is in `src/`, with Redux for state management (`src/reducers/`).
14+
- Addons are managed in `src/addons/`, with code pulled and patched via `pull.js`.
15+
- Extensions and translations are in `src/lib/libraries/extensions/` and `src/lib/tw-translations/`.
16+
- Themes and color variables are set in `src/lib/themes/accent/<theme>.js` and `src/css/colors.css`. <theme> stands for what theme is. The current ones are aqua, blue, rainbow, red, and purple.
17+
18+
## Developer Workflows
19+
- **Install dependencies:** `npm ci` (do not use `npm install` unless necessary since it modifies package-lock.json)
20+
- **Build:** `npm run build` (outputs to `build/`)
21+
- **Test:** `npm start` opens local server at `localhost:8601`
22+
- **Addons:** Use `pull.js` to sync and patch addon sources from upstream
23+
24+
## Conventions & Patterns
25+
- Addons and translations are managed by scripts, which can be manually edited.
26+
- Custom patches for addons are maintained in TurboWarp/addons repo.
27+
- Static assets and generated files are in `build/` and `static/`.
28+
- License and mascot info is in `README.md` and `TRADEMARK`.
29+
- Color and theme variables use CSS custom properties, overridden in JS when needed, such as when a theme is selected. A theme is always going to be on.
30+
31+
## Integration Points
32+
- Addons: `src/addons/entry.js` is the main entry point.
33+
- Extensions: `src/lib/libraries/extensions/`
34+
- Translations: `src/lib/tw-translations/`
35+
- Micro:bit: `static/microbit/` (hex files downloaded at prepublish)
36+
37+
## Examples
38+
- To add a new addon, add a new folder and all the necessary files for the addon to function..
39+
- To change theme colors, edit `src/lib/themes/guiHelpers.js` and `src/css/colors.css`.
40+
- To debug build output, inspect files in `build/` or just read the error messages in the console when running `npm run build`.
41+
42+
43+

.github/workflows/PRreview.yml

Lines changed: 0 additions & 130 deletions
This file was deleted.

.github/workflows/categorizer.yml

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: AI Issue Categorization
22

33
on:
44
issues:
5-
types: [opened]
5+
types: [opened, edited]
66

77
jobs:
88
categorize:
@@ -17,10 +17,12 @@ jobs:
1717
uses: actions/ai-inference@v1
1818
with:
1919
prompt: |
20-
Categorize this GitHub issue into exactly one of these labels:
21-
bug, question, enhancement, documentation.
22-
23-
Respond ONLY with the label name. No explanations.
20+
Categorize this GitHub issue using one or more of these labels:
21+
bug, question, enhancement, documentation, dependencies,
22+
help-wanted, High-Priority, Medium-Priority, Low-Priority,
23+
invalid, javascript, wontfix.
24+
Always add at least one priority one.
25+
Respond ONLY with comma-separated label names. No explanations. No extra characters.
2426
2527
Issue Title: ${{ github.event.issue.title }}
2628
Issue Body: |
@@ -29,25 +31,55 @@ jobs:
2931
- name: Clean AI output
3032
id: clean-label
3133
run: |
32-
# Remove quotes and trim whitespace
33-
CLEAN_LABEL=$(echo '${{ steps.ai-categorize.outputs.response }}' | tr -d '"' | tr -d "'" | xargs echo -n)
34-
echo "label=$CLEAN_LABEL" >> $GITHUB_OUTPUT
34+
# Clean and normalize AI output
35+
RAW_OUTPUT='${{ steps.ai-categorize.outputs.response }}'
36+
CLEANED=$(echo "$RAW_OUTPUT" | \
37+
tr '[:upper:]' '[:lower:]' | \
38+
sed -e 's/["'\''$$$$]//g' -e 's/[, ]\+/, /g' -e 's/^[ ,]*//' -e 's/[ ,]*$//')
39+
40+
echo "raw_labels=$CLEANED" >> $GITHUB_OUTPUT
3541
36-
- name: Apply label to issue
42+
- name: Apply validated labels
3743
uses: actions/github-script@v6
3844
with:
3945
script: |
40-
const label = '${{ steps.clean-label.outputs.label }}'.toLowerCase();
41-
const validLabels = ['bug', 'question', 'enhancement', 'documentation'];
46+
// Valid labels with exact casing
47+
const validLabels = new Set([
48+
'bug', 'question', 'enhancement', 'documentation',
49+
'dependencies', 'help-wanted', 'High-Priority',
50+
'Medium-Priority', 'Low-Priority', 'invalid',
51+
'javascript', 'wontfix'
52+
]);
53+
54+
// Case-insensitive mapping
55+
const labelMap = new Map();
56+
validLabels.forEach(label => {
57+
labelMap.set(label.toLowerCase(), label);
58+
});
59+
60+
// Process AI output
61+
const rawLabels = '${{ steps.clean-label.outputs.raw_labels }}';
62+
const receivedLabels = new Set();
63+
const finalLabels = new Set();
64+
65+
// Split and validate labels
66+
rawLabels.split(/\s*,\s*/).forEach(label => {
67+
const normalized = label.trim().toLowerCase();
68+
if (labelMap.has(normalized) && !receivedLabels.has(normalized)) {
69+
finalLabels.add(labelMap.get(normalized));
70+
receivedLabels.add(normalized);
71+
}
72+
});
4273
43-
// Validate AI response
44-
const finalLabel = validLabels.includes(label)
45-
? label
46-
: 'question'; // Fallback label
74+
// Add fallback if no valid labels found
75+
if (finalLabels.size === 0) {
76+
finalLabels.add('question');
77+
}
4778
79+
// Apply labels to issue
4880
await github.rest.issues.addLabels({
4981
owner: context.repo.owner,
5082
repo: context.repo.repo,
5183
issue_number: ${{ github.event.issue.number }},
52-
labels: [finalLabel]
84+
labels: Array.from(finalLabels)
5385
});

0 commit comments

Comments
 (0)