๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • What would life be If we had no courage to attemp anything?

Development/Electron8

[Electron] electron์•ฑ ํ™”๋ฉด์ด ๋žœ๋”๋ง์ด ๋˜์ง€ ์•Š๋Š” ๋ฌธ์ œ ๋ฌธ์ œ์  2023.06.17 - [Development/Electron] - [Electron] SyntaxError: Cannot use import statement outside a module ์œ„์˜ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐ ํ›„ electron์•ฑ์„ ์‹คํ–‰ํ–ˆ์„ ๋•Œ, electron ์•ฑ์€ ์ผœ์ง€์ง€๋งŒ ํ™”๋ฉด์ด ๋žœ๋”๋ง ๋˜์ง€ ์•Š๋Š” ์ƒํƒœ๊ฐ€ ๋ฐœ์ƒ. ํ•ด๊ฒฐ๊ณผ์ • Failed to compile. Module not found: Error: Can't resolve './App' in 'D:\\2023\\march\\realPractice\\login\\src' Did you mean 'App.js'? BREAKING CHANGE: The request './App' failed to resolve only because it was r.. 2023. 6. 18.
[Electron] SyntaxError: Cannot use import statement outside a module ์˜ค๋ฅ˜ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๋“ค์ด ๋œจ๋ฉด์„œ(๊ฒฝ๊ณ ์ฐฝ) electron ์•ฑ์ด ์‹คํ–‰๋˜์ง€ ์•Š์Œ. (node:29788) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. (Use `electron --trace-warnings ...` to show where the warning was created) App threw an error during load D:\\2023\\march\\realPractice\\login\\public\\electron.js:1 import * as operator from './script/operator.js' ^^^^^^ SyntaxError: Canno.. 2023. 6. 17.
[Electron] ipcRenderer.invoke & ipcMin.handle IpcRenderer.invoke ๐Ÿ’ก Electron์—์„œ ์ฃผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ๋ฉ”์„œ๋“œ ์ค‘ ํ•˜๋‚˜. ipcRenderer ๊ฐ์ฒด๋Š” ๋ Œ๋”๋Ÿฌ ํ”„๋กœ์„ธ์Šค์—์„œ ์‚ฌ์šฉ๋˜๋ฉฐ, ์ฃผ๋กœ ๋ฉ”์ธ ํ”„๋กœ์„ธ์Šค์™€์˜ ๋น„๋™๊ธฐ์ ์ธ ํ†ต์‹ ์„ ์œ„ํ•ด ์‚ฌ์šฉ. ipcRenderer.invoke๋Š” ๋ฉ”์ธ ํ”„๋กœ์„ธ์Šค์— ๋น„๋™๊ธฐ์ ์ธ ์š”์ฒญ์„ ๋ณด๋‚ด๊ณ  ๊ฒฐ๊ณผ๋ฅผ ๋ฐ›๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ. ์ด ๋ฉ”์„œ๋“œ๋Š” Promise๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋ฉฐ, ๋ฉ”์ธ ํ”„๋กœ์„ธ์Šค์—์„œ ์ฒ˜๋ฆฌ๋˜๊ณ  ์™„๋ฃŒ๋œ ํ›„์— Promise ๊ฒฐ๊ณผ๊ฐ€ ๋ Œ๋”๋Ÿฌ ํ”„๋กœ์„ธ์Šค์— ์ „๋‹ฌ. ipcRenderer.invoke ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ๋ฉ”์ธ ํ”„๋กœ์„ธ์Šค์—์„œ ํ•ด๋‹น ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•  ๋•Œ ipcMain.handle์„ ์‚ฌ์šฉํ•˜์—ฌ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ ์˜ˆ์ œ // ๋ Œ๋”๋Ÿฌ ํ”„๋กœ์„ธ์Šค์—์„œ์˜ ์˜ˆ์ œ ์ฝ”๋“œ const { ipcRenderer } = require('electron'); a.. 2023. 6. 15.
[Electron] dialog.showOpenDialog() dialog.showOpenDialogSync() ๐Ÿ’ก Electron ํ”„๋ ˆ์ž„์›Œํฌ์—์„œ ์ œ๊ณต๋˜๋Š” ๋ฉ”์„œ๋“œ ์‚ฌ์šฉ์ž์—๊ฒŒ ํŒŒ์ผ ์„ ํƒ ๋Œ€ํ™” ์ƒ์ž๋ฅผ ํ‘œ์‹œํ•˜๊ณ  ํŒŒ์ผ์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Œ ์ฃผ๋กœ ๋ฉ”์ธ ํ”„๋กœ์„ธ์Šค์—์„œ ์‚ฌ์šฉ ์‚ฌ์šฉ ์˜ˆ์‹œ const { dialog } = require('electron'); // ํŒŒ์ผ ์„ ํƒ ๋Œ€ํ™” ์ƒ์ž ์˜ต์…˜ ์„ค์ • const options = { title: 'Open File', // ๋Œ€ํ™” ์ƒ์ž ์ œ๋ชฉ defaultPath: '/path/to/default', // ๊ธฐ๋ณธ ๊ฒฝ๋กœ buttonLabel: 'Open', // ํ™•์ธ ๋ฒ„ํŠผ ๋ ˆ์ด๋ธ” filters: [ { name: 'Text Files', extensions: ['txt'] }, // ํŒŒ์ผ ํ•„ํ„ฐ { name: 'All Files', extensions.. 2023. 6. 15.
[Electron] electron ์•„์ด์ฝ˜ ๋„ฃ๊ธฐ //๋””๋ ‰ํ† ๋ฆฌ์— ์•„์ด์ฝ˜ ํŒŒ์ผ์„ ๋„ฃ์€ ๋’ค ์„ค์ • //electron.js - ๋ฉ”์ธํ”„๋กœ์„ธ์„œ ํŒŒ์ผ const {app, BrowserWindow,ipcMain} = require('electron') const path = require('path') // const fs = require("fs"); function createWindow () { const mainWindow = new BrowserWindow({ width: 528, height: 791, resizable:false, //size ๊ณ ์ • useContentSize :true, //๊ฐ€์šด๋ฐ ์„ค์ • center:true, //์•ฑ ์‹คํ–‰์‹œ ์œˆ๋„์šฐ๋ฅผ ํ™”๋ฉด ์ •์ค‘์•™์— ์œ„์น˜ **icon:path.join(__dirname,'[๋กœ๊ณ  path]'), //์ผ๋ ‰ํŠธ๋ก .. 2023. 1. 25.
[Electron] Electron + React ์—ฐ๋™ํ•˜๊ธฐ 1. React์— electron ์ ์šฉํ•˜๊ธฐ https://2ssue.github.io/programming/electron-react/ #create-react-appํ›„ electron ์ง‘์–ด๋„ฃ๊ธฐ npm init npm install create-react-app --save npx create-react-app {project_name} cd {project_name} npm install electron --save-dev ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ {project_name} โ”œโ”€โ”€ public # ์ •์  ํŒŒ์ผ. react๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ํŠน๋ณ„ํžˆ ๋ณ€๊ฒฝํ•  ๋‚ด์šฉ์€ ์—†๋‹ค. โ”œโ”€โ”€ src # javascript ํŒŒ์ผ. react routing, electron๋กœ๋”ฉ ๋“ฑ์˜ ์ž‘์—…์„ ์ง„ํ–‰. โ”‚ โ”œโ”€โ”€ App.js โ”‚ โ”œโ”€โ”€ in.. 2023. 1. 13.
[Electron]Electron-forge Publishing a GitHub release Electorn-Forge electron forge๋Š” publisher ํ”Œ๋Ÿฌ๊ทธ์ธ Github access token ์ƒ์„ฑํ•˜๊ธฐ electorn forge๋Š” github permission ์—†์ด ์–ด๋–ค repository์—๋„ publish ํ•  ์ˆ˜ ์—†์Œ Forge์˜ github releases ํ—ˆ๊ฐ€๋ฅผ ์œ„ํ•ด authenticated token์ด ํ•„์š”ํ•จ ๊ฐ€์žฅ ์‰ฌ์šด ๋ฐฉ๋ฒ•์€ public_repo์™€ ํ•จ๊ป˜ PAT๋ฅผ ์ƒ์„ฑํ•ด public repo์— ์ ‘๊ทผํ•ด ์“ธ ์ˆ˜ ์žˆ๊ฒŒ ํ•จ ๋ฐœ๊ธ‰ ๋ฐ›์€ ๋น„๋ฐ€๋กœ ์œ ์ง€๋˜์–ด์•ผ๋งŒ ํ•จ! forge์—์„œ github publisher ์„ธํŒ…ํ•˜๊ธฐ ๋จผ์ € forge์˜ github publisher ์„ค์น˜ npm install --save-dev @electron-fo.. 2023. 1. 12.
[Electron]Electron Electron ์ด๋ž€? ๐Ÿ’ก - JavaScript, HTML ๋ฐ CSS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์Šคํฌํƒ‘ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•œ ํ”„๋ ˆ์ž„์›Œํฌ Chromium ๊ณผ Node.js ๋ฅผ ๋ฐ”์ด๋„ˆ๋ฆฌ์— ๋‚ด์žฅ Electron์„ ์‚ฌ์šฉํ•˜๋ฉด ํ•˜๋‚˜์˜ JavaScript ์ฝ”๋“œ ๋ฒ ์ด์Šค๋ฅผ ์œ ์ง€ํ•˜๊ณ  Windows, macOS ๋ฐ Linux์—์„œ ์ž‘๋™ํ•˜๋Š” ํฌ๋กœ์Šค ํ”Œ๋žซํผ ์•ฑ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Œ ํ•ต์‹ฌ ๊ตฌ์„ฑ ์š”์†Œ ๐Ÿ’ก ํ”„๋ก ํŠธ์—”๋“œ : ํฌ๋กœ๋ฏธ์›€ ๋ฐฑ์—”๋“œ : ๋…ธ๋“œJS ํฌ๋กœ๋ฏธ์›€ ๋ Œ๋”๋ง ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋…ธ๋“œJS์™€ ๊ฒฐํ•ฉ - V8์„ ๊ณต์œ  โ–ณ์˜คํ”ˆ์†Œ์Šค ์›น๋ธŒ๋ผ์šฐ์ € ํฌ๋กœ๋ฏธ์›€(Chromium) โ–ณ๋ธŒ๋ผ์šฐ์ € ๋ฐ–์—์„œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์ธ ๋…ธ๋“œJS โ–ณ์˜คํ”ˆ์†Œ์Šค ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์—”์ง„ V8 ํ™œ์šฉ ์‚ฌ๋ก€ Atom Editor VScode Slack ์žฅ์  ๋‚ฎ์€ ์ง„์ž… ์žฅ๋ฒฝ JavaSc.. 2023. 1. 11.