Skip to content

Commit

Permalink
ESModuleのパッケージを読み込めるようにする (#2073)
Browse files Browse the repository at this point in the history
* Migrate: ESModuleに移行

* Revert: vuexの変更をRevert

* Fix: __dirnameを追加

* Fix: electronが立ち上がらないのを修正

* Change: type: moduleをやめる

* Delete: __dirnameをなくす

* Revert: js -> cjsをやめる

* Code: コメントを追加

* Revert: package.jsonのパスも戻す

* Revert: 色々なコンフィルファイルの拡張子も戻す

* Revert: electron-builder.config.jsのも戻す

* Revert: js内のも戻す
  • Loading branch information
sevenc-nanashi authored May 24, 2024
1 parent e1dac6e commit 29195c3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"buffer": "6.0.3",
"clone-deep": "4.0.1",
"dayjs": "1.10.7",
"electron-log": "5.0.0",
"electron-log": "5.1.2",
"electron-window-state": "5.0.3",
"encoding-japanese": "1.0.30",
"fast-array-diff": "1.1.0",
Expand Down
13 changes: 13 additions & 0 deletions src/@types/immer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// immerの内部APIの型定義。exportsで指定されていないファイルを参照するために用意したもの。
declare module "immer/src/plugins/patches" {
export function enablePatches(): void;
}
declare module "immer/src/plugins/mapset" {
export function enableMapSet(): void;
}
declare module "immer/src/utils/plugins" {
import { Patch } from "immer";
export function getPlugin(name: "Patches"): {
applyPatches_: (state: unknown, patches: Patch[]) => void;
};
}
8 changes: 8 additions & 0 deletions src/@types/vuex.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// vuexのexportsにtypeがないのを回避するWorkaround。
// https://github.com/vuejs/vuex/issues/2213#issuecomment-1592267216
declare module "vuex" {
export * from "vuex/types/index.d.ts";
export * from "vuex/types/helpers.d.ts";
export * from "vuex/types/logger.d.ts";
export * from "vuex/types/vue.d.ts";
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
Expand Down

0 comments on commit 29195c3

Please sign in to comment.