From 6bdd7014efc5bda310cfe87b40cd0f1af7a1348d Mon Sep 17 00:00:00 2001 From: meloalright Date: Sun, 20 Aug 2023 22:54:59 +0800 Subject: [PATCH 1/2] Update ci --- .github/workflows/ci.yml | 26 +++++++++------ .github/workflows/playground_use_latest.yml | 37 +++++++++++++++++++++ vue-playground/package-ci.json | 36 ++++++++++++++++++++ vue-playground/src/App.vue | 2 +- vue-skia-framework/launch.ts | 2 +- vue-skia-framework/package-publish.json | 18 ++++++++++ vue-skia-framework/package.json | 7 ++-- 7 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/playground_use_latest.yml create mode 100644 vue-playground/package-ci.json create mode 100644 vue-skia-framework/package-publish.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a26fa65..c533d85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,9 @@ -name: Rust +name: CI on: push: branches: - - main - - '0\.*\.*' - pull_request: - branches: - - main + - '**' jobs: build: @@ -47,15 +43,23 @@ jobs: cd vue-playground pnpm i pnpm build + - name: Archive vue-skia-framework artifacts uses: actions/upload-artifact@v3 with: name: vue-skia-framework path: | - vue-skia-framework - !node_modules - - name: Archive vue-playground results + vue-skia-framework/lib + vue-skia-framework/type.d.ts + vue-skia-framework/main.js + vue-skia-framework/main.d.ts + vue-skia-framework/components + vue-skia-framework/LICENSE + vue-skia-framework/package-publish.json + + - name: Archive soft-skia-wasm artifacts uses: actions/upload-artifact@v3 with: - name: vue-playground - path: vue-playground/dist \ No newline at end of file + name: soft-skia-wasm + path: | + soft-skia-wasm/pkg \ No newline at end of file diff --git a/.github/workflows/playground_use_latest.yml b/.github/workflows/playground_use_latest.yml new file mode 100644 index 0000000..1c2b400 --- /dev/null +++ b/.github/workflows/playground_use_latest.yml @@ -0,0 +1,37 @@ +name: Playground Use Latest + +on: + push: + branches: + - main + - '0\.*\.*' + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + + - name: vue-playground + run: | + cd vue-playground + cp package-ci.json package.json + npm i + npm run build + + - name: Archive vue-playground results + uses: actions/upload-artifact@v3 + with: + name: vue-playground-use-latest + path: | + vue-playground + !vue-playground/node_modules \ No newline at end of file diff --git a/vue-playground/package-ci.json b/vue-playground/package-ci.json new file mode 100644 index 0000000..fa736a2 --- /dev/null +++ b/vue-playground/package-ci.json @@ -0,0 +1,36 @@ +{ + "name": "vue-playground", + "version": "0.6.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "@uivjs/vue-github-corners": "^1.0.1", + "core-js": "^3.8.3", + "prism-themes": "^1.9.0", + "prismjs": "^1.29.0", + "vue": "^3.2.13", + "vue-live": "^2.5.4", + "vue-skia": "latest" + }, + "devDependencies": { + "@types/node": "^20.5.0", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", + "@vue/cli-plugin-babel": "~5.0.0", + "@vue/cli-plugin-eslint": "~5.0.0", + "@vue/cli-plugin-typescript": "~5.0.0", + "@vue/cli-service": "~5.0.0", + "@vue/eslint-config-typescript": "^9.1.0", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-vue": "^8.0.3", + "prettier": "^2.4.1", + "typescript": "~4.5.5", + "url-loader": "^4.1.1" + } +} diff --git a/vue-playground/src/App.vue b/vue-playground/src/App.vue index ea949e9..7ff732e 100644 --- a/vue-playground/src/App.vue +++ b/vue-playground/src/App.vue @@ -11,7 +11,7 @@

This super cool editor is based on vue-live !

-
+
You can edit this -> diff --git a/vue-skia-framework/launch.ts b/vue-skia-framework/launch.ts index 88c53d5..4b67a64 100644 --- a/vue-skia-framework/launch.ts +++ b/vue-skia-framework/launch.ts @@ -10,7 +10,7 @@ const launch = function () { const wasm = import("soft-skia-wasm/soft_skia_wasm.js"); wasm.then((ssw) => { ssw.default().then(() => { - global.ssw = ssw; + window.ssw = ssw; while (SSWInitialHelper.initialSucceedCallbackQueue.length) { SSWInitialHelper.initialSucceedCallbackQueue.pop()(); } diff --git a/vue-skia-framework/package-publish.json b/vue-skia-framework/package-publish.json new file mode 100644 index 0000000..d5668e2 --- /dev/null +++ b/vue-skia-framework/package-publish.json @@ -0,0 +1,18 @@ +{ + "name": "vue-skia", + "version": "0.0.6", + "files": [ + "lib", + "type.d.ts", + "main.js", + "main.d.ts", + "components", + "LICENSE" + ], + "license": "MIT", + "main": "./main.js", + "module": "./main.js", + "dependencies": { + "soft-skia-wasm": "0.4.0" + } +} diff --git a/vue-skia-framework/package.json b/vue-skia-framework/package.json index 14084bc..5ff005b 100644 --- a/vue-skia-framework/package.json +++ b/vue-skia-framework/package.json @@ -1,16 +1,17 @@ { "name": "vue-skia", - "version": "0.0.4", + "version": "0.0.0", + "private": "true", "files": [ "lib", - "soft-skia-wasm/pkg", + "type.d.ts", "main.js", "main.d.ts", "components", "LICENSE" ], "scripts": { - "build": "rm -rf lib; tsc;cp main.js main.d.ts" + "build": "rm -rf lib; tsc; cp main.js main.d.ts; cp type.ts type.d.ts" }, "license": "MIT", "main": "./main.js", From 3655cbad92f599bf5417878c1883edff827ec3d4 Mon Sep 17 00:00:00 2001 From: meloalright Date: Mon, 21 Aug 2023 00:13:22 +0800 Subject: [PATCH 2/2] 0.0.6 --- soft-skia-wasm/Cargo.toml | 2 +- soft-skia/Cargo.toml | 2 +- vue-skia-framework/package-publish.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/soft-skia-wasm/Cargo.toml b/soft-skia-wasm/Cargo.toml index ea8194f..8696b28 100644 --- a/soft-skia-wasm/Cargo.toml +++ b/soft-skia-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soft-skia-wasm" -version = "0.4.0" +version = "0.6.0" authors = ["meloalright "] edition = "2018" diff --git a/soft-skia/Cargo.toml b/soft-skia/Cargo.toml index 3018e27..9d99f0e 100644 --- a/soft-skia/Cargo.toml +++ b/soft-skia/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soft_skia" -version = "0.4.0" +version = "0.6.0" edition = "2021" description="software rasterization skia binding" license = "MIT" diff --git a/vue-skia-framework/package-publish.json b/vue-skia-framework/package-publish.json index d5668e2..3476a74 100644 --- a/vue-skia-framework/package-publish.json +++ b/vue-skia-framework/package-publish.json @@ -13,6 +13,6 @@ "main": "./main.js", "module": "./main.js", "dependencies": { - "soft-skia-wasm": "0.4.0" + "soft-skia-wasm": "0.6.0" } }