Skip to content
Merged
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
8 changes: 6 additions & 2 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest]
include:
- os: windows-latest
platform: windows
- os: macOS-latest
platform: macosx

steps:
- uses: actions/checkout@v4
Expand All @@ -39,7 +43,7 @@ jobs:
activate-environment: true

- name: Install requirements
run: yarn requirements && uv pip install -r .venv/requirements.txt
run: uv pip install -r dependencies/${{ matrix.platform }}.lock

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ jobs:
matrix:
include:
- os: windows-latest
platform: windows
artifacts: |
desktop/src-tauri/target/release/bundle/msi/*.msi
desktop/src-tauri/target/release/bundle/nsis/*.exe

- os: macOS-latest
platform: macosx
artifacts: |
desktop/src-tauri/target/release/bundle/dmg/*.dmg

Expand All @@ -48,7 +50,7 @@ jobs:
activate-environment: true

- name: Install requirements
run: yarn requirements && uv pip install -r .venv/requirements.txt
run: uv pip install -r dependencies/${{ matrix.platform }}.lock

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
29 changes: 29 additions & 0 deletions dependencies/install_requirements.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { platform } = require('os');
const { execSync } = require('child_process');
const path = require('path');

function getRequirementsFile() {
const os = platform();
if (os === 'win32') {
return path.join(__dirname, 'windows.lock');
} else if (os === 'darwin') {
return path.join(__dirname, 'macosx.lock');
} else {
throw new Error(`Unsupported operating system: ${os}`);
}
}

try {
const requirementsFile = getRequirementsFile();
console.log(`Installing requirements from: ${requirementsFile}`);

// 使用 venv.cjs 来执行 uv pip 命令
execSync(`node ${path.join(__dirname, 'venv.cjs')} uv pip install -r "${requirementsFile}"`, {
stdio: 'inherit'
});

console.log('Requirements installed successfully!');
} catch (error) {
console.error('Error installing requirements:', error.message);
process.exit(1);
}
2 changes: 1 addition & 1 deletion frontend/functional_ui/customImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default function envImport() {
name: 'env-import',
transform(code: string, id: string) {
// 正式环境 && 入口文件
if (id.endsWith('main.js') && process.env.NODE_ENV === 'production') { // 在代码开头注入 import 语句
if (id.endsWith('main.tsx') && process.env.NODE_ENV === 'production') { // 在代码开头注入 import 语句
Copy link
Contributor Author

Choose a reason for hiding this comment

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

意外的没加上,可能某一次回滚的时候给弄错了,这回加上了

return `import 'ssui_components/dist/style.css';\n${code}`
}
return code
Expand Down
2 changes: 0 additions & 2 deletions frontend/functional_ui/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ h1 {

input,
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
Expand All @@ -71,7 +70,6 @@ button {
color: #0f0f0f;
background-color: #ffffff;
transition: border-color 0.25s;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}

button {
Expand Down
4 changes: 4 additions & 0 deletions frontend/ssui_components/css.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.css" {
const css: { [key: string]: string };
export default css
}
5 changes: 3 additions & 2 deletions frontend/ssui_components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"./dist/style.css": "./dist/style.css"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里也是一样,这回给补充好了

},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"dependencies": {
"peerDependencies": {
"@blueprintjs/core": "^5.16.2",
"@blueprintjs/select": "^5.3.7",
"@blueprintjs/table": "^5.3.1",
Expand Down
5 changes: 3 additions & 2 deletions frontend/ssui_components/src/components/Base/StringEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Text } from '@blueprintjs/core';
import { IComponent } from '../IComponent';
import styles from './test.module.css'

export class StringEditor extends IComponent<{}, { textContent: string }> {
render(): ReactNode {
return <Text>String Editor</Text>
return <Text className={styles.normal}>String Editor</Text>
}

onExecute(): any {
Expand All @@ -23,4 +24,4 @@ import { registerComponent, ComponentRegister } from '../ComponentsManager';
[
{ 'name': 'StringEditor', 'type': 'string', 'port': 'input', 'component': StringEditor } as ComponentRegister,
{ 'name': 'StringPreview', 'type': 'string', 'port': 'output', 'component': StringPreview } as ComponentRegister
].forEach(registerComponent);
].forEach(registerComponent);
3 changes: 3 additions & 0 deletions frontend/ssui_components/src/components/Base/test.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.normal {
font-weight: normal;
}
2 changes: 1 addition & 1 deletion frontend/ssui_components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*"],
"include": ["src/**/*", "css.d.ts"],
"exclude": ["node_modules"]
}
1 change: 1 addition & 0 deletions frontend/ssui_components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: ['react', 'react-dom'],
output: {
preserveModules: true,
preserveModulesRoot: 'src',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"package:vscode": "cd ssui-vscode && yarn package",
"check_deps": "yarn --version && rustc --version && cargo --version",
"requirements": "node dependencies/combine_requirements.cjs",
"install-requirements": "node dependencies/venv.cjs uv pip install -r .venv/requirements.txt",
"install-requirements": "node dependencies/install_requirements.cjs",
"update-lock": "node dependencies/update_lock.cjs",
"update-lock:no-upgrade": "node dependencies/update_lock.cjs --no-upgrade",
"postinstall": "node dependencies/install.cjs"
Expand Down
Loading