Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESModuleのパッケージを読み込めるようにする #2073

Merged
merged 13 commits into from
May 24, 2024
Merged
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const afterWindowsNsisWebArtifactBuild =
require("./afterNsisWebArtifactBuild").default;
require("./afterNsisWebArtifactBuild.cjs").default;

// buildResult: electron-builder.BuildResult
exports.default = async function (buildResult) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const splitNsisArchive = require("./splitNsisArchive").default;
const splitNsisArchive = require("./splitNsisArchive.cjs").default;

// target: electron-builder.Target
exports.default = async function (target) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions electron-builder.config.js → electron-builder.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const sevenZipFile = fs

if (!sevenZipFile) {
throw new Error(
"7z binary file not found. Run `node ./build/download7z.js` first.",
"7z binary file not found. Run `node ./build/download7z.cjs` first.",
);
}

Expand Down Expand Up @@ -104,7 +104,7 @@ const builderOptions = {
afterAllArtifactBuild: path.resolve(
__dirname,
"build",
"afterAllArtifactBuild.js",
"afterAllArtifactBuild.cjs",
),
win: {
icon: "public/icon.png",
Expand Down
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.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
"test-watch:electron-e2e": "cross-env PWTEST_WATCH=1 VITE_TARGET=electron playwright test",
"test:browser-e2e": "cross-env VITE_TARGET=browser playwright test",
"test-watch:browser-e2e": "cross-env PWTEST_WATCH=1 VITE_TARGET=browser playwright test",
"lint": "eslint --ext .js,.vue,.ts *.config.* src tests build",
"fmt": "eslint --ext .js,.vue,.ts *.config.* src tests build --fix",
"lint": "eslint --ext .cjs,.vue,.ts *.config.* src tests build",
"fmt": "eslint --ext .cjs,.vue,.ts *.config.* src tests build --fix",
"markdownlint": "markdownlint --ignore node_modules/ --ignore dist/ --ignore dist_electron/ ./",
"typecheck": "vue-tsc --noEmit",
"electron:build": "cross-env VITE_TARGET=electron vite build && electron-builder --config electron-builder.config.js --publish never",
"electron:build": "cross-env VITE_TARGET=electron vite build && electron-builder --config electron-builder.config.cjs --publish never",
"electron:serve": "cross-env VITE_TARGET=electron vite",
"browser:serve": "cross-env VITE_TARGET=browser vite",
"browser:build": "cross-env VITE_TARGET=browser vite build",
"postinstall": "electron-builder install-app-deps && node build/download7z.js",
"postinstall": "electron-builder install-app-deps && node build/download7z.cjs",
"postuninstall": "electron-builder install-app-deps",
"license:generate": "node build/generateLicenses.js",
"license:merge": "node build/mergeLicenses.js"
"license:generate": "node build/generateLicenses.cjs",
"license:merge": "node build/mergeLicenses.cjs"
},
"dependencies": {
"@gtm-support/vue-gtm": "1.2.3",
Expand All @@ -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",
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
"electron-window-state": "5.0.3",
"encoding-japanese": "1.0.30",
"fast-array-diff": "1.1.0",
Expand Down
12 changes: 12 additions & 0 deletions src/@types/immer.d.ts
sevenc-nanashi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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。
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading