Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #2605

Closed
wants to merge 2 commits into from
Closed

Master #2605

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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module.exports = {
],
plugins: ['prettier', 'unused-imports'],
rules: {
'prefer-const': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-var-requires': 'off',
Expand Down
126 changes: 63 additions & 63 deletions .github/workflows/themes-weekly-pull.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
name: themes-weekly-pull
on:
schedule:
# run every friday at 5AM
- cron: '0 5 * * 5'
workflow_dispatch:
env:
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
GO_VERSION: '1.21'
NODE_VERSION: '18.17'
jobs:
pull-from-jsonbin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Install dependencies
run: yarn install --immutable
- name: Run themes:pull script
run: yarn run themes:pull
env:
JSONBIN_MASTER_KEY: ${{ secrets.JSONBIN_MASTER_KEY }}
JSONBIN_ID: ${{ secrets.JSONBIN_ID }}
- name: Generate dark tokens
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/dark.json core,ide-default,ide-dark,theia core,ide-default,ide-dark
- name: Generate default tokens
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/default.json core,ide-default,theia core,ide-default
- name: Run themes:generate script
run: yarn run themes:generate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: Updated themes
title: Update themes
branch: themes/themes-update
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
name: themes-weekly-pull

on:
schedule:
# run every friday at 5AM
- cron: '0 5 * * 5'
workflow_dispatch:

env:
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
GO_VERSION: '1.21'
NODE_VERSION: '18.17'

jobs:
pull-from-jsonbin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install dependencies
run: yarn install --immutable

- name: Run themes:pull script
run: yarn run themes:pull
env:
JSONBIN_MASTER_KEY: ${{ secrets.JSONBIN_MASTER_KEY }}
JSONBIN_ID: ${{ secrets.JSONBIN_ID }}

- name: Generate dark tokens
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/dark.json core,ide-default,ide-dark,theia core,ide-default,ide-dark

- name: Generate default tokens
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/default.json core,ide-default,theia core,ide-default

- name: Run themes:generate script
run: yarn run themes:generate

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: Updated themes
title: Update themes
branch: themes/themes-update
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
7 changes: 5 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
{
"label": "Watch All",
"type": "shell",
"dependsOn": ["Watch Extension", "Watch App"]
"dependsOn": [
"Watch Extension",
"Watch App"
]
}
]
}
}
4 changes: 2 additions & 2 deletions arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arduino-ide-extension",
"version": "2.3.5",
"version": "3.6.0",
"description": "An extension for Theia building the Arduino IDE",
"license": "AGPL-3.0-or-later",
"scripts": {
Expand Down Expand Up @@ -188,4 +188,4 @@
"version": "14.0.0"
}
}
}
}
3 changes: 1 addition & 2 deletions arduino-ide-extension/scripts/compose-changelog.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
// item.name is the name of the release changelog
return (
acc +
`## ${item.name}\n\n${body}${
index !== releases.length - 1 ? '\n\n---\n\n' : '\n'
`## ${item.name}\n\n${body}${index !== releases.length - 1 ? '\n\n---\n\n' : '\n'
}`
);
}, '');
Expand Down
Empty file modified arduino-ide-extension/scripts/download-cli.js
100755 → 100644
Empty file.
Empty file modified arduino-ide-extension/scripts/download-fwuploader.js
100755 → 100644
Empty file.
5 changes: 2 additions & 3 deletions arduino-ide-extension/scripts/download-ls.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@
}

if (typeof lsVersion === 'string') {
const lsUrl = `https://downloads.arduino.cc/arduino-language-server/${
lsVersion === 'nightly'
const lsUrl = `https://downloads.arduino.cc/arduino-language-server/${lsVersion === 'nightly'
? 'nightly/arduino-language-server'
: 'arduino-language-server_' + lsVersion
}_${lsSuffix}`;
}_${lsSuffix}`;
downloader.downloadUnzipAll(
lsUrl,
resourcesFolder,
Expand Down
50 changes: 23 additions & 27 deletions arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
MenuModelRegistry,
} from '@theia/core/lib/common/menu';
import { MessageService } from '@theia/core/lib/common/message-service';
import { nls } from '@theia/core/lib/common/nls';
import { isHighContrast } from '@theia/core/lib/common/theme';
import { ElectronWindowPreferences } from '@theia/core/lib/electron-browser/window/electron-window-preferences';
import {
Expand All @@ -42,17 +41,17 @@ import { ArduinoMenus } from './menu/arduino-menus';
import { MonitorViewContribution } from './serial/monitor/monitor-view-contribution';
import { SerialPlotterContribution } from './serial/plotter/plotter-frontend-contribution';
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
import { ResponseService } from '../common/protocol';

@injectable()
export class ArduinoFrontendContribution
implements
FrontendApplicationContribution,
TabBarToolbarContribution,
CommandContribution,
MenuContribution,
ColorContribution,
StylingParticipant
{
FrontendApplicationContribution,
TabBarToolbarContribution,
CommandContribution,
MenuContribution,
ColorContribution,
StylingParticipant {
@inject(MessageService)
private readonly messageService: MessageService;

Expand All @@ -68,16 +67,22 @@ export class ArduinoFrontendContribution
@inject(FrontendApplicationStateService)
private readonly appStateService: FrontendApplicationStateService;

@inject(ResponseService)
private readonly responseService: ResponseService;

@postConstruct()
protected init(): void {
if (!window.navigator.onLine) {
// tslint:disable-next-line:max-line-length
this.messageService.warn(
nls.localize(
'arduino/common/offlineIndicator',
'You appear to be offline. Without an Internet connection, the Arduino CLI might not be able to download the required resources and could cause malfunction. Please connect to the Internet and restart the application.'
)
);
// this.messageService.warn(
// nls.localize(
// 'arduino/common/offlineIndicator',
// '你好像离线了。如果没有互联网连接,CLI可能无法下载所需的资源,并可能导致故障。请连接到互联网并重新启动应用程序。'
// )
// );
const chunk =
'你好像离线了。如果没有互联网连接,CLI可能无法下载所需的资源,并可能导致故障。请连接到互联网并重新启动应用程序\n';
this.responseService.appendToOutput({ chunk });
}
}

Expand Down Expand Up @@ -119,15 +124,12 @@ export class ArduinoFrontendContribution
registry.registerItem({
id: 'toggle-serial-plotter',
command: SerialPlotterContribution.Commands.OPEN_TOOLBAR.id,
tooltip: nls.localize(
'arduino/serial/openSerialPlotter',
'Serial Plotter'
),
tooltip: '串口绘图仪',
});
registry.registerItem({
id: 'toggle-serial-monitor',
command: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR,
tooltip: nls.localize('arduino/common/serialMonitor', 'Serial Monitor'),
tooltip: '串口监视器',
});
}

Expand Down Expand Up @@ -156,14 +158,8 @@ export class ArduinoFrontendContribution
registry.getMenu(MAIN_MENU_BAR).removeNode(menuId(TerminalMenus.TERMINAL));
registry.getMenu(MAIN_MENU_BAR).removeNode(menuId(CommonMenus.VIEW));

registry.registerSubmenu(
ArduinoMenus.SKETCH,
nls.localize('arduino/menu/sketch', 'Sketch')
);
registry.registerSubmenu(
ArduinoMenus.TOOLS,
nls.localize('arduino/menu/tools', 'Tools')
);
registry.registerSubmenu(ArduinoMenus.SKETCH, '项目');
registry.registerSubmenu(ArduinoMenus.TOOLS, '工具');
}

registerColors(colors: ColorRegistry): void {
Expand Down
Loading
Loading