tauri-apps / tauricon Goto Github PK
View Code? Open in Web Editor NEWMake icons for your tauri app with nodejs
License: Apache License 2.0
Make icons for your tauri app with nodejs
License: Apache License 2.0
We're currently seeing 24 vulnerabilities (12 with severity "high") in our Tauri package, all of which are coming from @tauri-apps/tauricon
. I know dealing with npm audit
warnings is annoying, but for a tool focused on security, I think it's important to make sure your deps are clean. I hope we can expect a fix soon? Thanks!
When only running tauricon
the icons get placed in no-mans-land.
I can investigate this further, just want to register this so I don't forget it.
Linux
fish shell
To get the correct behaviour I need to do
tauricon --target ./src-tauri/icons
Due to this tool depending on optipng
it doesn't work with apple sillicon. This is due to optipng using operations that arent available on arm.
There seems to be an issue with the latest release:
> [email protected] icon
> npx @tauri-apps/tauricon ./artwork/icon.png
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module '../src/helpers/icns.json'
Require stack:
- C:\Users\Dan\AppData\Local\npm-cache\_npx\98c943a920688aff\node_modules\@tauri-apps\tauricon\dist\tauricon.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at file:///C:/Users/Dan/AppData/Local/npm-cache/_npx/98c943a920688aff/node_modules/@tauri-apps/tauricon/dist/tauricon.js:1:3428
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:65:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Dan\\AppData\\Local\\npm-cache\\_npx\\98c943a920688aff\\node_modules\\@tauri-apps\\tauricon\\dist\\tauricon.js'
]
}
I tried deleting then reinstalling, but that didn't fix the issue.
tauri info
:
Environment
› OS: Windows 10.0.22000 X64
› Webview2: 100.0.1185.50
› MSVC:
› Node.js: 16.13.1
› npm: 8.3.2
› pnpm: Not installed!
› yarn: Not installed!
› rustup: 1.24.3
› rustc: 1.60.0
› cargo: 1.60.0
› Rust toolchain: stable-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.0.0-rc.9
› @tauri-apps/api [NPM]: 1.0.0-rc.4
› tauri [RUST]: 1.0.0-rc.8,
› tauri-build [RUST]: 1.0.0-rc.7,
› tao [RUST]: 0.8.3,
› wry [RUST]: 0.15.1,
App
› build-type: bundle
› CSP: default-src 'self'
› distDir: ../dist
› devPath: http://localhost:3000/
› framework: Vue.js
App directory structure
├─ .git
├─ .github
├─ .vscode
├─ artwork
├─ dist
├─ node_modules
├─ scripts
├─ src
└─ src-tauri
It seems that because of the following strict check it is impossible to convert perfectly square icons, because, obviously, they have no transparent pixels. Could we just remove this block or at least provide some CLI flag to disable it?
Lines 94 to 103 in 5eea916
run script 'npx @tauri-apps/tauricon --help' will show intall @tauri-apps/tauricon every time even I have installed
No response
No response
Environment
› OS: Windows 10.0.22000 X64
› Webview2: 104.0.1293.47
› MSVC:
- Visual Studio ���ɹ��� 2019
- Visual Studio ���ɹ��� 2022
› Node.js: 16.14.2
› npm: 8.5.0
› pnpm: 6.32.3
› yarn: 1.22.18
› rustup: 1.24.3
› rustc: 1.62.0
› cargo: 1.62.0
› Rust toolchain: stable-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:3000/
› framework: Vue.js
App directory structure
├─ dist
├─ env
├─ node_modules
├─ public
├─ src
└─ src-tauri
No response
No response
last night, I wanted to set an icon for my app, so i see: https://tauri.studio/docs/guides/icons
yarn global add github:tauri-apps/tauricon
[1/4] Resolving packages...
warning github:tauri-apps/tauricon > imagemin-optipng > exec-buffer > tempfile > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@tauri-apps/[email protected]" with binaries:
- tauricon
Done in 39.97s.
when i run it:
$ tauri
tauri Couldn't recognize the current folder as a part of a Tauri project. It must contain a `tauri.conf.json` file in any subfolder. +0ms
so, I clone the source code project.
run yarn test
:
yarn run v1.22.18
$ yarn build
$ rimraf ./dist && rollup -c --silent
babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
$ cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --forceExit --no-cache --testPathIgnorePatterns="(build|dev)"
(node:14632) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
console.log
tauri Couldn't recognize the current folder as a part of a Tauri project. It must contain a `tauri.conf.json` file in any subfolder. +0ms
at warn (src/helpers/logger.ts:18:15)
● process.exit called with "1"
43 | "Couldn't recognize the current folder as a part of a Tauri project. It must contain a `tauri.conf.json` file in any subfolder."
44 | )
> 45 | process.exit(1)
| ^
46 | return ''
47 | } else {
48 | return dirname(matches[0])
at getTauriDir (src/helpers/app-paths.ts:45:13)
at src/helpers/app-paths.ts:52:39
at Object.<anonymous> (test/jest/__tests__/tauricon.spec.js:6:23)
RUNS test/jest/__tests__/tauricon.spec.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
i found this bug:
const getTauriDir = (): string => {
const dir = process.env.__TAURI_TEST_APP_DIR ?? process.cwd()
// eslint-disable-next-line
const matches: string[] = glob.sync(join(dir, `**/tauri.conf.json`), {
ignore: ['**/node_modules/**', '**/target/**']
})
if (matches.length === 0) {
warn(
"Couldn't recognize the current folder as a part of a Tauri project. It must contain a `tauri.conf.json` file in any subfolder."
)
process.exit(1)
return ''
} else {
return dirname(matches[0])
}
}
after modify code:
const getTauriDir = (): string => {
const dir = process.env.__TAURI_TEST_APP_DIR ?? process.cwd()
// eslint-disable-next-line
const matches: string[] = glob.sync('**/tauri.conf.json', {
cwd: dir,
ignore: ['**/node_modules/**', '**/target/**']
})
if (matches.length === 0) {
warn(
"Couldn't recognize the current folder as a part of a Tauri project. It must contain a `tauri.conf.json` file in any subfolder."
)
process.exit(1)
return ''
} else {
return resolve(dir, dirname(matches[0]))
}
}
run test result:
yarn run v1.22.18
$ yarn build
$ rimraf ./dist && rollup -c --silent
babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
$ cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --forceExit --no-cache --testPathIgnorePatterns="(build|dev)"
(node:6376) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
console.log
app:spawn batch minify:. +0ms
at log (src/helpers/logger.ts:18:15)
console.error
[Error: Input file is missing]
530 | writeFileSync(path.join(target, '/icon.ico'), out2)
531 | } catch (err) {
> 532 | console.error(err)
| ^
533 | throw err
534 | }
535 | }
at Object.icns (src/tauricon.ts:532:15)
at Object.make (src/tauricon.ts:235:5)
at Object.<anonymous> (test/jest/__tests__/tauricon.spec.js:26:7)
console.log
app:spawn batch minify:. +3s
at log (src/helpers/logger.ts:18:15)
PASS test/jest/__tests__/tauricon.spec.js (15.699 s)
[CLI] tauri-icon internals
√ tells you the version (616 ms)
[CLI] tauri-icon builder
√ will still use default compression if missing compression chosen (11928 ms)
√ will not validate a non-file (19 ms)
√ makes a set of icons with optipng (2626 ms)
Test Suites: 1 passed, 1 total
Tests: 4 passed, 4 total
Snapshots: 0 total
Time: 15.776 s
Ran all test suites.
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
Done in 21.54s.
my tauri info:
$ tauri info
Environment
› OS: Windows 10.0.19044 X64
› Webview2: 100.0.1185.36
› MSVC:
- Visual Studio ���ɹ��� 2019
› Node.js: 14.18.3
› npm: 6.14.15
› pnpm: Not installed!
› yarn: 1.22.18
› rustup: 1.24.3
› rustc: 1.60.0
› cargo: 1.60.0
› Rust toolchain: stable-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.0.0-rc.7
› @tauri-apps/api [NPM]: 1.0.0-rc.3
› tauri [RUST]: 1.0.0-rc.6,
› tauri-build [RUST]: 1.0.0-rc.5,
› tao [RUST]: 0.7.0,
› wry [RUST]: 0.14.0,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:8000/
› framework: Vue.js
App directory structure
├─ .git
├─ .github
├─ .vscode
├─ dist
├─ docs
├─ node_modules
├─ scripts
├─ src
└─ src-tauri
Done in 50.19s.
would be nice to allow the logo to be svg-format, from my understanding it's technically possible with the libraries used, now I work around it by having sharp-cli installed and running this
sharp -i ./logo.svg -o ./app-icon.png resize 1240 1240 && tauricon --target ./src-tauri/icons && rm -f ./app-icon.png
I'm also open to creating a pull request for this feature
I am trying to use tauricon but failing. Installation seems to work fine... I did both:
globall:
yarn global add @tauri-apps/tauricon
and locally:
yarn add @tauri-apps/tauricon
I can start tauricon in both cases. But getting this error message, and at the same time my mouse turns into this funny cross...
I am really not sure whats going on here?
it doesn't matter what I do with tauricon I am always getting the same error:
after clicking around a bit, the mouse turns back to normal and I get this error message:
/home/laptop/.yarn/bin/tauricon: line 1: //: Is a directory
/home/laptop/.yarn/bin/tauricon: line 2: //: Is a directory
/home/laptop/.yarn/bin/tauricon: line 3: //: Is a directory
import-im6.q16: unable to grab mouse `': No such file or directory @ error/xwindow.c/XSelectWindow/9187.
import-im6.q16: unable to grab mouse `': No such file or directory @ error/xwindow.c/XSelectWindow/9187.
/home/laptop/.yarn/bin/tauricon: line 8: /bin: Is a directory
/home/laptop/.yarn/bin/tauricon: line 9: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 10: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 11: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 12: boolean}: command not found
/home/laptop/.yarn/bin/tauricon: line 12: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 13: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 13: boolean}: command not found
/home/laptop/.yarn/bin/tauricon: line 14: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 15: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 16: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 17: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 18: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 19: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 20: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 21: babel.config.js: command not found
/home/laptop/.yarn/bin/tauricon: line 22: dist/: Is a directory
/home/laptop/.yarn/bin/tauricon: line 23: syntax error near unexpected token `('
/home/laptop/.yarn/bin/tauricon: line 23: `const argv = parseArgs(process.argv.slice(2), {'
I am really not sure whats going on here... does anybody have an idea?
not sure how to reproduce... I simply installed tauricon through yarn.
No response
Operating System - Ubuntu, version 20.04 X64
Node.js environment
Node.js - 17.7.1
@tauri-apps/cli - 1.0.0-rc.6
@tauri-apps/api - 1.0.0-rc.2
Global packages
npm - 8.5.2
pnpm - Not installed
yarn - 1.22.17
Rust environment
rustup - Not installed
rustc - 1.57.0
cargo - 1.57.0
toolchain - Not installed
App directory structure
/src-pwa
/node_modules
/public
/.vscode
/dist
/src-ssr
/.quasar
/src-electron
/src
/src-tauri
App
tauri - 1.0.0-rc.4
tauri-build - 1.0.0-rc.4
tao - 0.6.4
wry - 0.13.3
build-type - bundle
CSP - unset
distDir - ../dist/spa
devPath - http://localhost:8080/
framework - Vue.js (Quasar)
bundler - Webpack
No response
I am not sure, but I think this might be caused by some error in the script. like a missing shebang...
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@jest/globals
, babel-jest
, jest
)inquirer
, @types/inquirer
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@jest/globals
, babel-jest
, jest
)@babel/core
, @babel/preset-env
, @babel/preset-typescript
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)sharp
, @types/sharp
).github/workflows/audit.yml
actions/checkout v2
.github/workflows/covector-status.yml
actions/checkout v2
.github/workflows/covector-version-or-publish.yml
actions/checkout v2
actions/setup-node v3
peter-evans/create-pull-request v3
.github/workflows/format.yml
actions/checkout v3
actions/setup-node v3
.github/workflows/lint.yml
actions/checkout v3
actions/setup-node v3
.github/workflows/test.yml
actions/checkout v3
actions/setup-node v3
package.json
@fiahfy/icns 0.0.7
chalk 5.0.1
cross-env 7.0.3
cross-spawn 7.0.3
find-up 6.3.0
fs-extra 10.1.0
glob 8.0.3
global-agent 3.0.0
got 12.1.0
imagemin 8.0.1
imagemin-optipng 8.0.0
imagemin-zopfli 7.0.0
inquirer 8.2.4
is-png 3.0.1
minimist 1.2.6
ms 2.1.3
png-to-ico 2.1.4
read-chunk 4.0.2
semver 7.3.7
sharp 0.30.5
update-notifier 5.1.0
@babel/core 7.18.0
@babel/preset-env 7.18.0
@babel/preset-typescript 7.17.12
@jest/globals 28.1.0
@rollup/plugin-babel 5.3.1
@rollup/plugin-commonjs 22.0.0
@rollup/plugin-node-resolve 13.3.0
@rollup/plugin-typescript 8.3.2
@types/cross-spawn 6.0.2
@types/fs-extra 9.0.13
@types/glob 7.2.0
@types/global-agent 2.1.1
@types/imagemin 8.0.0
@types/imagemin-optipng 5.2.1
@types/inquirer 8.2.1
@types/ms 0.7.31
@types/semver 7.3.9
@types/sharp 0.30.2
@typescript-eslint/eslint-plugin 5.26.0
@typescript-eslint/parser 5.26.0
babel-jest 28.1.0
covector 0.7.3
eslint 8.16.0
eslint-config-prettier 8.5.0
eslint-config-standard-with-typescript 21.0.1
eslint-plugin-import 2.26.0
eslint-plugin-lodash-template 0.21.0
eslint-plugin-node 11.1.0
eslint-plugin-promise 6.0.0
eslint-plugin-security 1.5.0
is-running 2.1.0
jest 28.1.0
jest-transform-toml 1.0.0
lockfile-lint 4.7.4
prettier 2.6.2
promise 8.1.0
rimraf 3.0.2
rollup 2.74.1
rollup-plugin-terser 7.0.2
tslib 2.4.0
typescript 4.6.4
node >= 12.13.0
npm >= 6.6.0
yarn >= 1.19.1
semver-regex 4.0.3
trim-newlines 4.0.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.