diff --git a/README.ja.md b/README.ja.md
index 182149f..9c30b10 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -46,6 +46,10 @@ VITE_KINTONE_APP=1
```
## Example
-kintone + vue example: [vue3-porject-kintone-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/vue3-porject-kintone-demo)
+kintone + vue + vite
+example: [vue-kintone-vite-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/vue-kintone-vite-demo)
+
+kintone + react + vite
+example: [react-kintone-vite-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/react-kintone-vite-demo)
diff --git a/README.md b/README.md
index 40829a1..721d9f8 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,11 @@ VITE_KINTONE_APP=1
```
## Example
-kintone + vue example: [vue3-porject-kintone-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/vue3-porject-kintone-demo)
+kintone + vue + vite
+example: [vue-kintone-vite-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/vue-kintone-vite-demo)
+
+kintone + react + vite
+example: [react-kintone-vite-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/react-kintone-vite-demo)
diff --git a/README.zh-CN.md b/README.zh-CN.md
index fbca4cc..5839c91 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -48,7 +48,11 @@ VITE_KINTONE_APP=1
```
## Example
-kintone + vue example: [vue3-porject-kintone-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/vue3-porject-kintone-demo)
+kintone + vue + vite
+example: [vue-kintone-vite-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/vue-kintone-vite-demo)
+
+kintone + react + vite
+example: [react-kintone-vite-demo](https://github.com/GuSanle/vite-plugin-kintone-dev/tree/main/example/react-kintone-vite-demo)
diff --git a/example/react-project-kintone-demo/.env.sample b/example/react-kintone-vite-demo/.env.sample
similarity index 100%
rename from example/react-project-kintone-demo/.env.sample
rename to example/react-kintone-vite-demo/.env.sample
diff --git a/example/react-project-kintone-demo/.eslintrc.cjs b/example/react-kintone-vite-demo/.eslintrc.cjs
similarity index 100%
rename from example/react-project-kintone-demo/.eslintrc.cjs
rename to example/react-kintone-vite-demo/.eslintrc.cjs
diff --git a/example/react-project-kintone-demo/.gitignore b/example/react-kintone-vite-demo/.gitignore
similarity index 100%
rename from example/react-project-kintone-demo/.gitignore
rename to example/react-kintone-vite-demo/.gitignore
diff --git a/example/react-kintone-vite-demo/README.md b/example/react-kintone-vite-demo/README.md
new file mode 100644
index 0000000..af39d33
--- /dev/null
+++ b/example/react-kintone-vite-demo/README.md
@@ -0,0 +1,14 @@
+# react-kintone-vite-demo
+
+This demo was built using @vitejs/vite-plugin-react.
+Please refer to [@vitejs/vite-plugin-react](https://github.com/vitejs/vite-plugin-react)
+
+## Project run
+```
+npm run dev
+```
+
+## Project build
+```
+npm run build
+```
\ No newline at end of file
diff --git a/example/react-project-kintone-demo/index.html b/example/react-kintone-vite-demo/index.html
similarity index 100%
rename from example/react-project-kintone-demo/index.html
rename to example/react-kintone-vite-demo/index.html
diff --git a/example/react-project-kintone-demo/package-lock.json b/example/react-kintone-vite-demo/package-lock.json
similarity index 99%
rename from example/react-project-kintone-demo/package-lock.json
rename to example/react-kintone-vite-demo/package-lock.json
index 4704b82..c6e140a 100644
--- a/example/react-project-kintone-demo/package-lock.json
+++ b/example/react-kintone-vite-demo/package-lock.json
@@ -3208,13 +3208,16 @@
}
},
"node_modules/vite-plugin-kintone-dev": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/vite-plugin-kintone-dev/-/vite-plugin-kintone-dev-1.1.0.tgz",
- "integrity": "sha512-+jt8P9W/XjEnwmujfEAiri0KwD4yMPfrBtYwP3G4BRSDrU50eSC9N92+aI9IbM3QnlkjXNbdFjtUQglo/0Ulyg==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/vite-plugin-kintone-dev/-/vite-plugin-kintone-dev-1.1.1.tgz",
+ "integrity": "sha512-MtDj8K1+Gr2xfwduDmxulFyaMwGIvnT1ECS1vWSV6j6yUiYKvCT2xVLR2ushQsgwlW+QW3psg8OC5sMzcqEBsQ==",
"dev": true,
"dependencies": {
"axios": "^1.5.0",
"cheerio": "^1.0.0-rc.12"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
}
},
"node_modules/which": {
diff --git a/example/react-project-kintone-demo/package.json b/example/react-kintone-vite-demo/package.json
similarity index 94%
rename from example/react-project-kintone-demo/package.json
rename to example/react-kintone-vite-demo/package.json
index 2726742..fde2885 100644
--- a/example/react-project-kintone-demo/package.json
+++ b/example/react-kintone-vite-demo/package.json
@@ -1,8 +1,7 @@
{
"name": "react-project-kintone-demo",
- "private": true,
"version": "0.0.0",
- "type": "module",
+ "license": "MIT",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
diff --git a/example/react-project-kintone-demo/public/vite.svg b/example/react-kintone-vite-demo/public/vite.svg
similarity index 100%
rename from example/react-project-kintone-demo/public/vite.svg
rename to example/react-kintone-vite-demo/public/vite.svg
diff --git a/example/react-project-kintone-demo/src/App.css b/example/react-kintone-vite-demo/src/App.css
similarity index 100%
rename from example/react-project-kintone-demo/src/App.css
rename to example/react-kintone-vite-demo/src/App.css
diff --git a/example/react-kintone-vite-demo/src/App.tsx b/example/react-kintone-vite-demo/src/App.tsx
new file mode 100644
index 0000000..6780ccb
--- /dev/null
+++ b/example/react-kintone-vite-demo/src/App.tsx
@@ -0,0 +1,19 @@
+// export default function () {
+// // return
Hello
+// return (
+// <>
+// Vite + React
+// >
+// )
+// }
+
+const App= ()=> {
+ // return Hello
+ return (
+ <>
+ Vite + React
+ >
+ )
+}
+
+export default App
\ No newline at end of file
diff --git a/example/react-project-kintone-demo/src/assets/react.svg b/example/react-kintone-vite-demo/src/assets/react.svg
similarity index 100%
rename from example/react-project-kintone-demo/src/assets/react.svg
rename to example/react-kintone-vite-demo/src/assets/react.svg
diff --git a/example/react-project-kintone-demo/src/index.css b/example/react-kintone-vite-demo/src/index.css
similarity index 100%
rename from example/react-project-kintone-demo/src/index.css
rename to example/react-kintone-vite-demo/src/index.css
diff --git a/example/react-project-kintone-demo/src/main.tsx b/example/react-kintone-vite-demo/src/main.tsx
similarity index 100%
rename from example/react-project-kintone-demo/src/main.tsx
rename to example/react-kintone-vite-demo/src/main.tsx
diff --git a/example/react-project-kintone-demo/src/types/kintone.d.ts b/example/react-kintone-vite-demo/src/types/kintone.d.ts
similarity index 100%
rename from example/react-project-kintone-demo/src/types/kintone.d.ts
rename to example/react-kintone-vite-demo/src/types/kintone.d.ts
diff --git a/example/react-project-kintone-demo/src/vite-env.d.ts b/example/react-kintone-vite-demo/src/vite-env.d.ts
similarity index 100%
rename from example/react-project-kintone-demo/src/vite-env.d.ts
rename to example/react-kintone-vite-demo/src/vite-env.d.ts
diff --git a/example/react-project-kintone-demo/tsconfig.json b/example/react-kintone-vite-demo/tsconfig.json
similarity index 100%
rename from example/react-project-kintone-demo/tsconfig.json
rename to example/react-kintone-vite-demo/tsconfig.json
diff --git a/example/react-project-kintone-demo/tsconfig.node.json b/example/react-kintone-vite-demo/tsconfig.node.json
similarity index 100%
rename from example/react-project-kintone-demo/tsconfig.node.json
rename to example/react-kintone-vite-demo/tsconfig.node.json
diff --git a/example/react-kintone-vite-demo/vite-plugin/devUpdate.ts b/example/react-kintone-vite-demo/vite-plugin/devUpdate.ts
new file mode 100644
index 0000000..0d354b7
--- /dev/null
+++ b/example/react-kintone-vite-demo/vite-plugin/devUpdate.ts
@@ -0,0 +1,108 @@
+import kintoneApi from "./kintoneApi";
+import path from "node:path";
+const devFileName = "kintone_module_hack.js";
+import {
+ type Type,
+ type EnvSetting,
+ type TypeInput,
+ type JsList,
+} from "kintone-types";
+
+const urlPrefix = (url: string) => {
+ if (
+ url.substring(0, 7).toLowerCase() == "http://" ||
+ url.substring(0, 8).toLowerCase() == "https://"
+ ) {
+ url = url;
+ } else {
+ url = "https://" + url;
+ }
+ return url;
+};
+
+//步骤:上传文件,获取系统设置,准备新的自定义文件列表,更新系统设置
+export default async function devUpdate(
+ env: EnvSetting,
+ fileList: Array,
+ type: TypeInput
+) {
+ const {
+ VITE_KINTONE_URL: url,
+ VITE_KINTONE_USER_NAME: username,
+ VITE_KINTONE_PASSWORD: password,
+ VITE_KINTONE_APP: app,
+ } = env;
+ const k = new kintoneApi(urlPrefix(url), username, password);
+ try {
+ //上传文件
+ const fileNameList = fileList.map((filePath) => path.basename(filePath));
+ const uploadPromise = await Promise.all(
+ fileList.map((filePath) => {
+ return k.uploadFile(filePath, path.basename(filePath));
+ })
+ );
+
+ let jsList: JsList = {
+ DESKTOP: [],
+ MOBILE: [],
+ DESKTOP_CSS: [],
+ MOBILE_CSS: [],
+ };
+
+ //准备构建好的文件
+ for (const index in uploadPromise) {
+ const { fileKey } = uploadPromise[index];
+ const fileType: Type =
+ path.extname(fileNameList[index]).slice(1) === "js"
+ ? type.type
+ : `${type.type}_CSS`;
+ jsList[fileType].push(fileKey);
+ }
+ //获取自定义设置
+ let customSetting;
+ let appName = "";
+
+ if (type.platform === "PORTAL") {
+ customSetting = await k.getSystemSetting();
+ } else if (app) {
+ const result = await k.getAppInfo(app);
+ appName = result.name;
+ customSetting = await k.getAppSetting(app);
+ } else {
+ console.log("env setting error");
+ return;
+ }
+
+ const { scripts, scope } = customSetting.result;
+
+ //补充之前的自定义配置,排除老的构建文件
+ scripts.forEach((setting) => {
+ const { locationType, type, name, contentUrl, contentId } = setting;
+ if (locationType === "URL") {
+ jsList[type as Type].push(contentUrl);
+ } else if (locationType === "BLOB") {
+ if (!fileNameList.includes(name) && name !== devFileName) {
+ jsList[type as Type].push(contentId);
+ }
+ }
+ });
+
+ const jsFiles = [
+ { jsType: "DESKTOP", fileKeys: jsList["DESKTOP"] },
+ { jsType: "MOBILE", fileKeys: jsList["MOBILE"] },
+ { jsType: "DESKTOP_CSS", fileKeys: jsList["DESKTOP_CSS"] },
+ { jsType: "MOBILE_CSS", fileKeys: jsList["MOBILE_CSS"] },
+ ];
+
+ //更新系统设置
+ if (type.platform === "PORTAL") {
+ await k.updateSystemSetting(scope, jsFiles);
+ } else if (app) {
+ await k.updateAppSetting(app, scope, jsFiles, appName);
+ await k.deploySetting(app);
+ }
+ console.log("update success");
+ } catch (err) {
+ console.log(err);
+ }
+}
diff --git a/example/react-kintone-vite-demo/vite-plugin/index.ts b/example/react-kintone-vite-demo/vite-plugin/index.ts
new file mode 100644
index 0000000..2dc6306
--- /dev/null
+++ b/example/react-kintone-vite-demo/vite-plugin/index.ts
@@ -0,0 +1,163 @@
+import { ResolvedConfig, type Plugin, loadEnv, normalizePath } from "vite";
+import devUpdate from "./devUpdate";
+import path from "node:path";
+import fs from "node:fs";
+import { load } from "cheerio";
+const fileName = "kintone_module_hack.js";
+import {
+ type EnvSetting,
+ type TypeInput,
+ type ScriptList,
+} from "kintone-types";
+
+//类型守卫函数
+function isEnvSetting(obj: any): obj is EnvSetting {
+ return (
+ obj &&
+ typeof obj.VITE_KINTONE_URL === "string" &&
+ typeof obj.VITE_KINTONE_USER_NAME === "string" &&
+ typeof obj.VITE_KINTONE_PASSWORD === "string" &&
+ (typeof obj.VITE_KINTONE_APP === "undefined" ||
+ typeof obj.VITE_KINTONE_APP === "string")
+ );
+}
+
+const getIndexHtmlContent = () => {
+ const url = path.resolve("index.html");
+ const htmlContent = fs.readFileSync(url, "utf-8");
+
+ const $ = load(htmlContent);
+ const scriptTags = $("body script");
+
+ const scriptList: ScriptList = [];
+ scriptTags.each((index, element) => {
+ const data = {
+ type: $(element).attr("type"),
+ src: $(element).attr("src"),
+ };
+ scriptList.push(data);
+ });
+ return scriptList;
+};
+
+const kintoneModuleHack = (devServerUrl: string, scriptList: ScriptList) => {
+ return `(function () {
+ const scriptList = ${JSON.stringify(scriptList)};
+ function loadScript(src,type) {
+ const script = document.createElement("script");
+ script.type = type;
+ script.src = "${devServerUrl}"+src;
+ document.body.appendChild(script);
+ }
+ for (const script of scriptList){
+ const {src,type}=script
+ loadScript(src,type)
+ }
+ })();
+ `;
+};
+
+const getDirFiles = (dir: string, extList: string[]) => {
+ let result: string[] = [];
+ let files = fs.readdirSync(dir, { withFileTypes: true });
+ files.forEach((file) => {
+ const filepath = path.join(dir, file.name);
+ const ext = path.extname(filepath).slice(1);
+ if (file.isFile() && extList.includes(ext)) {
+ result.push(filepath);
+ } else if (file.isDirectory()) {
+ result.push(...getDirFiles(filepath, extList));
+ }
+ });
+ return result;
+};
+
+export default function kintoneDev(inputType: TypeInput): Plugin[] {
+ let viteConfig: ResolvedConfig;
+ const validateEnv = (viteConfig: ResolvedConfig): EnvSetting | undefined => {
+ const resolvedRoot = normalizePath(
+ viteConfig.root ? path.resolve(viteConfig.root) : process.cwd()
+ );
+
+ const envDir = viteConfig.envDir
+ ? normalizePath(path.resolve(resolvedRoot, viteConfig.envDir))
+ : resolvedRoot;
+
+ const env = loadEnv("", envDir, viteConfig.envPrefix);
+ return isEnvSetting(env) ? env : undefined;
+ };
+ return [
+ {
+ name: "vite-plugin-kintone-dev:dev",
+ apply: "serve",
+ enforce: "post", // 指定运行顺序
+ configResolved(config) {
+ viteConfig = config;
+ },
+ configureServer(server) {
+ server.httpServer?.once("listening", () => {
+ const outputDir = path.resolve(viteConfig.build.outDir);
+ const address = server.httpServer?.address();
+ if (!address || typeof address === "string") {
+ console.error("Unexpected dev server address", address);
+ process.exit(1);
+ }
+ const protocol = server.config.server.https ? "https" : "http";
+ const host = address.address;
+ const port = address.port;
+ const devServerUrl = `${protocol}://${host}:${port}`;
+ if (!fs.existsSync(outputDir)) {
+ fs.mkdirSync(outputDir);
+ }
+ const fileUrl = path.resolve(outputDir, fileName);
+
+ const scriptList = getIndexHtmlContent();
+
+ fs.writeFileSync(
+ fileUrl,
+ kintoneModuleHack(devServerUrl, scriptList)
+ );
+
+ const env = validateEnv(viteConfig);
+
+ if (env) {
+ devUpdate(env, [fileUrl], inputType).then((r) => {
+ fs.unlinkSync(fileUrl);
+ });
+ } else {
+ console.log("env error");
+ }
+ });
+ },
+ },
+ {
+ name: "vite-plugin-kintone-dev:build",
+ apply: "build",
+ enforce: "post",
+ config: () => ({
+ build: {
+ cssCodeSplit: false,
+ rollupOptions: {
+ output: {
+ format: "iife",
+ },
+ },
+ },
+ }),
+ configResolved(config) {
+ viteConfig = config;
+ },
+ async closeBundle() {
+ const outputDir = path.resolve(viteConfig.build.outDir);
+ const extList = ["js", "css"];
+ const fileList = getDirFiles(outputDir, extList);
+ const env = validateEnv(viteConfig);
+ if (env) {
+ devUpdate(env, fileList, inputType);
+ } else {
+ console.log("env error");
+ }
+ },
+ },
+ ];
+}
diff --git a/example/react-kintone-vite-demo/vite-plugin/kintone-types.d.ts b/example/react-kintone-vite-demo/vite-plugin/kintone-types.d.ts
new file mode 100644
index 0000000..eea2dd8
--- /dev/null
+++ b/example/react-kintone-vite-demo/vite-plugin/kintone-types.d.ts
@@ -0,0 +1,61 @@
+declare module "kintone-types" {
+ export type Type = "DESKTOP" | "MOBILE" | "DESKTOP_CSS" | "MOBILE_CSS";
+
+ export type TypeInput = {
+ platform: "APP" | "PORTAL";
+ type: "DESKTOP" | "MOBILE";
+ };
+
+ export interface JsList {
+ DESKTOP: string[];
+ MOBILE: string[];
+ DESKTOP_CSS: string[];
+ MOBILE_CSS: string[];
+ }
+
+ export interface EnvSetting {
+ VITE_KINTONE_URL: string;
+ VITE_KINTONE_USER_NAME: string;
+ VITE_KINTONE_PASSWORD: string;
+ VITE_KINTONE_APP: string | undefined;
+ }
+
+ export interface UploadFileResponse {
+ fileKey: string;
+ }
+
+ export type ScriptList = {
+ type: string | undefined;
+ src: string | undefined;
+ }[];
+
+ export type ScriptsList = {
+ locationType: string;
+ type: string;
+ name: string;
+ contentUrl: string;
+ contentId: string;
+ }[];
+
+ export interface GetSystemSettingResponse {
+ result: { scripts: ScriptsList; scope: string };
+ }
+
+ export interface GetAppSettingResponse {
+ result: { scripts: ScriptsList; scope: string };
+ }
+
+ export interface UpdateSystemSettingResponse {
+ result: object;
+ }
+
+ export interface GetAppInfo {
+ name: string;
+ [propName: string]: any;
+ }
+
+ export type jsFiles = {
+ jsType: string;
+ fileKeys: string[];
+ };
+}
diff --git a/example/react-kintone-vite-demo/vite-plugin/kintoneApi.ts b/example/react-kintone-vite-demo/vite-plugin/kintoneApi.ts
new file mode 100644
index 0000000..a835798
--- /dev/null
+++ b/example/react-kintone-vite-demo/vite-plugin/kintoneApi.ts
@@ -0,0 +1,113 @@
+import axios, { Axios } from "axios";
+import fs from "node:fs";
+import FormData from "form-data";
+import {
+ type jsFiles,
+ type UploadFileResponse,
+ type GetSystemSettingResponse,
+ type GetAppSettingResponse,
+ type GetAppInfo,
+ type UpdateSystemSettingResponse,
+} from "kintone-types";
+
+export default class kintoneApi {
+ http: Axios;
+ constructor(baseURL: string, username: string, password: string) {
+ this.http = axios.create({
+ baseURL,
+ timeout: 10000,
+ headers: {
+ "X-Cybozu-Authorization": Buffer.from(
+ `${username}:${password}`
+ ).toString("base64"),
+ },
+ });
+ //响应拦截器
+ this.http.interceptors.response.use(
+ (res) => {
+ return res.data;
+ },
+ (err) => {
+ return Promise.reject(new Error(err.message));
+ }
+ );
+ }
+
+ //文件上传
+ uploadFile(filePath: string, name: string): Promise {
+ const url = "/k/v1/file.json";
+ let formData = new FormData();
+
+ formData.append("file", fs.createReadStream(filePath), name);
+ const config = {
+ headers: {
+ ...formData.getHeaders(),
+ },
+ };
+
+ return this.http.post(url, formData, config);
+ }
+
+ //获取系统设置
+ getSystemSetting(): Promise {
+ const url = "/k/api/js/getSystemSetting.json";
+ const header = {
+ "Content-Type": "application/json",
+ };
+ return this.http.post(url, header);
+ }
+
+ //更新系统设置
+ updateSystemSetting(
+ jsScope: string,
+ jsFiles: Array
+ ): Promise {
+ const url = "/k/api/js/updateSystemSetting.json";
+ const body = {
+ jsScope,
+ jsFiles,
+ };
+ return this.http.post(url, body);
+ }
+
+ //更新系统设置
+ getAppInfo(appid: string): Promise {
+ const url = `/k/v1/app.json?id=${appid}`;
+ return this.http.get(url);
+ }
+
+ //获取应用的自定义设置 todo 返回类型调整
+ getAppSetting(app: string): Promise {
+ const url = `/k/api/js/get.json`;
+ const body = {
+ app,
+ };
+ return this.http.post(url, body);
+ }
+
+ //更新应用自定义设置 todo 返回类型调整
+ updateAppSetting(
+ id: string,
+ jsScope: string,
+ jsFiles: Array,
+ name: string
+ ): Promise {
+ const url = "/k/api/dev/app/update.json";
+ const body = {
+ id,
+ jsScope,
+ jsFiles,
+ name,
+ };
+ return this.http.post(url, body);
+ }
+
+ //更新应用自定义设置 todo 返回类型调整
+ deploySetting(app: string): Promise {
+ const url = "/k/api/dev/app/deploy.json";
+ const body = {
+ app,
+ };
+ return this.http.post(url, body);
+ }
+}
diff --git a/example/react-project-kintone-demo/vite.config.ts b/example/react-kintone-vite-demo/vite.config.ts
similarity index 100%
rename from example/react-project-kintone-demo/vite.config.ts
rename to example/react-kintone-vite-demo/vite.config.ts
diff --git a/example/react-project-kintone-demo/README.md b/example/react-project-kintone-demo/README.md
deleted file mode 100644
index 1ebe379..0000000
--- a/example/react-project-kintone-demo/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# React + TypeScript + Vite
-
-This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
-
-Currently, two official plugins are available:
-
-- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
-- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
-
-## Expanding the ESLint configuration
-
-If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
-
-- Configure the top-level `parserOptions` property like this:
-
-```js
- parserOptions: {
- ecmaVersion: 'latest',
- sourceType: 'module',
- project: ['./tsconfig.json', './tsconfig.node.json'],
- tsconfigRootDir: __dirname,
- },
-```
-
-- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
-- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
-- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
diff --git a/example/react-project-kintone-demo/src/App.tsx b/example/react-project-kintone-demo/src/App.tsx
deleted file mode 100644
index d4b39b9..0000000
--- a/example/react-project-kintone-demo/src/App.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-export default function () {
- // return Hello
- return (
- <>
- Vite + React
- >
- )
-}
diff --git a/example/vue3-porject-kintone-demo/.env.sample b/example/vue-kintone-vite-demo/.env.sample
similarity index 100%
rename from example/vue3-porject-kintone-demo/.env.sample
rename to example/vue-kintone-vite-demo/.env.sample
diff --git a/example/vue3-porject-kintone-demo/.gitignore b/example/vue-kintone-vite-demo/.gitignore
similarity index 100%
rename from example/vue3-porject-kintone-demo/.gitignore
rename to example/vue-kintone-vite-demo/.gitignore
diff --git a/example/vue3-porject-kintone-demo/.vscode/extensions.json b/example/vue-kintone-vite-demo/.vscode/extensions.json
similarity index 100%
rename from example/vue3-porject-kintone-demo/.vscode/extensions.json
rename to example/vue-kintone-vite-demo/.vscode/extensions.json
diff --git a/example/vue3-porject-kintone-demo/README.md b/example/vue-kintone-vite-demo/README.md
similarity index 95%
rename from example/vue3-porject-kintone-demo/README.md
rename to example/vue-kintone-vite-demo/README.md
index e8935e9..df25359 100644
--- a/example/vue3-porject-kintone-demo/README.md
+++ b/example/vue-kintone-vite-demo/README.md
@@ -1,4 +1,4 @@
-# vue3-porject-kintone-demo
+# vue3-kintone-vite-demo
This demo was built using create-vue.
Please refer to [create-vue](https://cn.vuejs.org/guide/quick-start.html#creating-a-vue-application)
diff --git a/example/vue3-porject-kintone-demo/components.d.ts b/example/vue-kintone-vite-demo/components.d.ts
similarity index 100%
rename from example/vue3-porject-kintone-demo/components.d.ts
rename to example/vue-kintone-vite-demo/components.d.ts
diff --git a/example/vue3-porject-kintone-demo/env.d.ts b/example/vue-kintone-vite-demo/env.d.ts
similarity index 100%
rename from example/vue3-porject-kintone-demo/env.d.ts
rename to example/vue-kintone-vite-demo/env.d.ts
diff --git a/example/vue3-porject-kintone-demo/index.html b/example/vue-kintone-vite-demo/index.html
similarity index 100%
rename from example/vue3-porject-kintone-demo/index.html
rename to example/vue-kintone-vite-demo/index.html
diff --git a/example/vue3-porject-kintone-demo/package-lock.json b/example/vue-kintone-vite-demo/package-lock.json
similarity index 99%
rename from example/vue3-porject-kintone-demo/package-lock.json
rename to example/vue-kintone-vite-demo/package-lock.json
index 7a32fbb..c32fe2e 100644
--- a/example/vue3-porject-kintone-demo/package-lock.json
+++ b/example/vue-kintone-vite-demo/package-lock.json
@@ -3175,13 +3175,16 @@
}
},
"node_modules/vite-plugin-kintone-dev": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/vite-plugin-kintone-dev/-/vite-plugin-kintone-dev-1.0.7.tgz",
- "integrity": "sha512-0KcyAABbW/y2n/ACtKLBLjWmzMt5j23e0s2bMdgt1wMwyIWHQlKhRCXuvFn8g0uugsbwnqUVk7ZG4urv9jwWkA==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/vite-plugin-kintone-dev/-/vite-plugin-kintone-dev-1.1.1.tgz",
+ "integrity": "sha512-MtDj8K1+Gr2xfwduDmxulFyaMwGIvnT1ECS1vWSV6j6yUiYKvCT2xVLR2ushQsgwlW+QW3psg8OC5sMzcqEBsQ==",
"dev": true,
"dependencies": {
"axios": "^1.5.0",
"cheerio": "^1.0.0-rc.12"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
}
},
"node_modules/vue": {
diff --git a/example/vue3-porject-kintone-demo/package.json b/example/vue-kintone-vite-demo/package.json
similarity index 97%
rename from example/vue3-porject-kintone-demo/package.json
rename to example/vue-kintone-vite-demo/package.json
index e897862..d57c3dd 100644
--- a/example/vue3-porject-kintone-demo/package.json
+++ b/example/vue-kintone-vite-demo/package.json
@@ -1,6 +1,7 @@
{
"name": "vue3-porject-kintone-demo",
"version": "0.0.0",
+ "license": "MIT",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
diff --git a/example/vue3-porject-kintone-demo/public/favicon.ico b/example/vue-kintone-vite-demo/public/favicon.ico
similarity index 100%
rename from example/vue3-porject-kintone-demo/public/favicon.ico
rename to example/vue-kintone-vite-demo/public/favicon.ico
diff --git a/example/vue3-porject-kintone-demo/src/App.vue b/example/vue-kintone-vite-demo/src/App.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/App.vue
rename to example/vue-kintone-vite-demo/src/App.vue
diff --git a/example/vue3-porject-kintone-demo/src/assets/base.css b/example/vue-kintone-vite-demo/src/assets/base.css
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/assets/base.css
rename to example/vue-kintone-vite-demo/src/assets/base.css
diff --git a/example/vue3-porject-kintone-demo/src/assets/logo.svg b/example/vue-kintone-vite-demo/src/assets/logo.svg
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/assets/logo.svg
rename to example/vue-kintone-vite-demo/src/assets/logo.svg
diff --git a/example/vue3-porject-kintone-demo/src/assets/main.css b/example/vue-kintone-vite-demo/src/assets/main.css
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/assets/main.css
rename to example/vue-kintone-vite-demo/src/assets/main.css
diff --git a/example/vue3-porject-kintone-demo/src/components/HelloWorld.vue b/example/vue-kintone-vite-demo/src/components/HelloWorld.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/HelloWorld.vue
rename to example/vue-kintone-vite-demo/src/components/HelloWorld.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/TheWelcome.vue b/example/vue-kintone-vite-demo/src/components/TheWelcome.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/TheWelcome.vue
rename to example/vue-kintone-vite-demo/src/components/TheWelcome.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/WelcomeItem.vue b/example/vue-kintone-vite-demo/src/components/WelcomeItem.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/WelcomeItem.vue
rename to example/vue-kintone-vite-demo/src/components/WelcomeItem.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/icons/IconCommunity.vue b/example/vue-kintone-vite-demo/src/components/icons/IconCommunity.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/icons/IconCommunity.vue
rename to example/vue-kintone-vite-demo/src/components/icons/IconCommunity.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/icons/IconDocumentation.vue b/example/vue-kintone-vite-demo/src/components/icons/IconDocumentation.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/icons/IconDocumentation.vue
rename to example/vue-kintone-vite-demo/src/components/icons/IconDocumentation.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/icons/IconEcosystem.vue b/example/vue-kintone-vite-demo/src/components/icons/IconEcosystem.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/icons/IconEcosystem.vue
rename to example/vue-kintone-vite-demo/src/components/icons/IconEcosystem.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/icons/IconSupport.vue b/example/vue-kintone-vite-demo/src/components/icons/IconSupport.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/icons/IconSupport.vue
rename to example/vue-kintone-vite-demo/src/components/icons/IconSupport.vue
diff --git a/example/vue3-porject-kintone-demo/src/components/icons/IconTooling.vue b/example/vue-kintone-vite-demo/src/components/icons/IconTooling.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/components/icons/IconTooling.vue
rename to example/vue-kintone-vite-demo/src/components/icons/IconTooling.vue
diff --git a/example/vue3-porject-kintone-demo/src/main.ts b/example/vue-kintone-vite-demo/src/main.ts
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/main.ts
rename to example/vue-kintone-vite-demo/src/main.ts
diff --git a/example/vue3-porject-kintone-demo/src/router/index.ts b/example/vue-kintone-vite-demo/src/router/index.ts
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/router/index.ts
rename to example/vue-kintone-vite-demo/src/router/index.ts
diff --git a/example/vue3-porject-kintone-demo/src/types/kintone.d.ts b/example/vue-kintone-vite-demo/src/types/kintone.d.ts
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/types/kintone.d.ts
rename to example/vue-kintone-vite-demo/src/types/kintone.d.ts
diff --git a/example/vue3-porject-kintone-demo/src/views/AboutView.vue b/example/vue-kintone-vite-demo/src/views/AboutView.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/views/AboutView.vue
rename to example/vue-kintone-vite-demo/src/views/AboutView.vue
diff --git a/example/vue3-porject-kintone-demo/src/views/HomeView.vue b/example/vue-kintone-vite-demo/src/views/HomeView.vue
similarity index 100%
rename from example/vue3-porject-kintone-demo/src/views/HomeView.vue
rename to example/vue-kintone-vite-demo/src/views/HomeView.vue
diff --git a/example/vue3-porject-kintone-demo/tsconfig.app.json b/example/vue-kintone-vite-demo/tsconfig.app.json
similarity index 100%
rename from example/vue3-porject-kintone-demo/tsconfig.app.json
rename to example/vue-kintone-vite-demo/tsconfig.app.json
diff --git a/example/vue3-porject-kintone-demo/tsconfig.json b/example/vue-kintone-vite-demo/tsconfig.json
similarity index 100%
rename from example/vue3-porject-kintone-demo/tsconfig.json
rename to example/vue-kintone-vite-demo/tsconfig.json
diff --git a/example/vue3-porject-kintone-demo/tsconfig.node.json b/example/vue-kintone-vite-demo/tsconfig.node.json
similarity index 100%
rename from example/vue3-porject-kintone-demo/tsconfig.node.json
rename to example/vue-kintone-vite-demo/tsconfig.node.json
diff --git a/example/vue3-porject-kintone-demo/vite.config.ts b/example/vue-kintone-vite-demo/vite.config.ts
similarity index 100%
rename from example/vue3-porject-kintone-demo/vite.config.ts
rename to example/vue-kintone-vite-demo/vite.config.ts
diff --git a/package.json b/package.json
index b38deec..6a9ed50 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-kintone-dev",
- "version": "1.1.1",
+ "version": "1.1.2",
"description": "vite plugin for developement kintone",
"files": [
"dist"