@growi/pluginkit 1.0.1 → 1.1.0-next.d1faecac6ad3d0a42733cf62fa2f066a876e8d2e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/model/growi-plugin-validation-data.d.ts +1 -1
- package/dist/model/growi-plugin-validation-error.cjs +1 -1
- package/dist/model/growi-plugin-validation-error.cjs.map +1 -1
- package/dist/model/growi-plugin-validation-error.d.ts +1 -1
- package/dist/model/growi-plugin-validation-error.js +4 -4
- package/dist/model/growi-plugin-validation-error.js.map +1 -1
- package/dist/v4/client/index.cjs +2 -0
- package/dist/v4/client/index.cjs.map +1 -0
- package/dist/v4/client/index.d.ts +1 -0
- package/dist/v4/client/index.js +5 -0
- package/dist/v4/client/index.js.map +1 -0
- package/dist/v4/client/utils/growi-facade/growi-react.cjs +2 -0
- package/dist/v4/client/utils/growi-facade/growi-react.cjs.map +1 -0
- package/dist/v4/client/utils/growi-facade/growi-react.d.ts +26 -0
- package/dist/v4/client/utils/growi-facade/growi-react.js +5 -0
- package/dist/v4/client/utils/growi-facade/growi-react.js.map +1 -0
- package/dist/v4/client/utils/growi-facade/growi-react.spec.d.ts +1 -0
- package/dist/v4/client/utils/growi-facade/index.cjs +2 -0
- package/dist/v4/client/utils/growi-facade/index.cjs.map +1 -0
- package/dist/v4/client/utils/growi-facade/index.d.ts +1 -0
- package/dist/v4/client/utils/growi-facade/index.js +5 -0
- package/dist/v4/client/utils/growi-facade/index.js.map +1 -0
- package/dist/v4/client/utils/index.cjs +2 -0
- package/dist/v4/client/utils/index.cjs.map +1 -0
- package/dist/v4/client/utils/index.d.ts +1 -0
- package/dist/v4/client/utils/index.js +5 -0
- package/dist/v4/client/utils/index.js.map +1 -0
- package/dist/v4/server/utils/common/import-package-json.cjs.map +1 -1
- package/dist/v4/server/utils/common/validate-growi-plugin-directive.cjs.map +1 -1
- package/dist/v4/server/utils/common/validate-growi-plugin-directive.d.ts +1 -1
- package/dist/v4/server/utils/common/validate-growi-plugin-directive.js.map +1 -1
- package/dist/v4/server/utils/template/get-markdown.cjs.map +1 -1
- package/dist/v4/server/utils/template/get-markdown.js +1 -2
- package/dist/v4/server/utils/template/get-markdown.js.map +1 -1
- package/dist/v4/server/utils/template/get-status.cjs.map +1 -1
- package/dist/v4/server/utils/template/get-status.js.map +1 -1
- package/dist/v4/server/utils/template/scan.cjs.map +1 -1
- package/dist/v4/server/utils/template/scan.d.ts +1 -1
- package/dist/v4/server/utils/template/scan.js +3 -6
- package/dist/v4/server/utils/template/scan.js.map +1 -1
- package/dist/v4/server/utils/template/validate-all-locales.cjs.map +1 -1
- package/dist/v4/server/utils/template/validate-all-locales.js.map +1 -1
- package/dist/v4/server/utils/template/validate-growi-plugin-directive.cjs.map +1 -1
- package/dist/v4/server/utils/template/validate-growi-plugin-directive.js.map +1 -1
- package/dist/v4/server/utils/theme/validate-growi-plugin-directive.cjs.map +1 -1
- package/dist/v4/server/utils/theme/validate-growi-plugin-directive.js.map +1 -1
- package/dist/v4/utils/template.spec.d.ts +1 -0
- package/package.json +13 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 WESEEK, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./model/growi-plugin-validation-error.cjs");exports.GrowiPluginValidationError=r.GrowiPluginValidationError;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./model/growi-plugin-validation-error.cjs"),i=require("./v4/client/utils/growi-facade/growi-react.cjs");exports.GrowiPluginValidationError=r.GrowiPluginValidationError;exports.growiReact=i.growiReact;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { GrowiPluginValidationError as i } from "./model/growi-plugin-validation-error.js";
|
|
2
|
+
import { growiReact as a } from "./v4/client/utils/growi-facade/growi-react.js";
|
|
2
3
|
export {
|
|
3
|
-
i as GrowiPluginValidationError
|
|
4
|
+
i as GrowiPluginValidationError,
|
|
5
|
+
a as growiReact
|
|
4
6
|
};
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GrowiPluginDirective } from './growi-plugin-package-data';
|
|
2
1
|
import { GrowiPluginType, GrowiThemeMetadata } from '@growi/core';
|
|
2
|
+
import { GrowiPluginDirective } from './growi-plugin-package-data';
|
|
3
3
|
|
|
4
4
|
export type GrowiPluginValidationData = {
|
|
5
5
|
projectDirRoot: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var s=(
|
|
1
|
+
"use strict";var a=Object.defineProperty;var s=(t,r,o)=>r in t?a(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o;var e=(t,r,o)=>s(t,typeof r!="symbol"?r+"":r,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("extensible-custom-error");class l extends n{constructor(o,i){super(o);e(this,"data");this.data=i}}exports.GrowiPluginValidationError=l;
|
|
2
2
|
//# sourceMappingURL=growi-plugin-validation-error.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"growi-plugin-validation-error.cjs","sources":["../../src/model/growi-plugin-validation-error.ts"],"sourcesContent":["import ExtensibleCustomError from 'extensible-custom-error';\n\nimport type { GrowiPluginValidationData } from './growi-plugin-validation-data';\n\n\nexport class GrowiPluginValidationError<E extends Partial<GrowiPluginValidationData> = Partial<GrowiPluginValidationData>> extends ExtensibleCustomError {\n\n data?: E;\n\n constructor(message: string, data?: E) {\n super(message);\n this.data = data;\n }\n\n}\n"],"names":["GrowiPluginValidationError","ExtensibleCustomError","message","data","__publicField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"growi-plugin-validation-error.cjs","sources":["../../src/model/growi-plugin-validation-error.ts"],"sourcesContent":["import ExtensibleCustomError from 'extensible-custom-error';\n\nimport type { GrowiPluginValidationData } from './growi-plugin-validation-data';\n\n\nexport class GrowiPluginValidationError<E extends Partial<GrowiPluginValidationData> = Partial<GrowiPluginValidationData>> extends ExtensibleCustomError {\n\n data?: E;\n\n constructor(message: string, data?: E) {\n super(message);\n this.data = data;\n }\n\n}\n"],"names":["GrowiPluginValidationError","ExtensibleCustomError","message","data","__publicField"],"mappings":"+RAKO,MAAMA,UAAsHC,CAAsB,CAIvJ,YAAYC,EAAiBC,EAAU,CACrC,MAAMD,CAAO,EAHfE,EAAA,aAIE,KAAK,KAAOD,CAAA,CAGhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GrowiPluginValidationData } from './growi-plugin-validation-data';
|
|
2
1
|
import { default as ExtensibleCustomError } from 'extensible-custom-error';
|
|
2
|
+
import { GrowiPluginValidationData } from './growi-plugin-validation-data';
|
|
3
3
|
|
|
4
4
|
export declare class GrowiPluginValidationError<E extends Partial<GrowiPluginValidationData> = Partial<GrowiPluginValidationData>> extends ExtensibleCustomError {
|
|
5
5
|
data?: E;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
|
-
var e = (
|
|
3
|
-
var s = (
|
|
2
|
+
var e = (t, r, o) => r in t ? i(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
|
|
3
|
+
var s = (t, r, o) => e(t, typeof r != "symbol" ? r + "" : r, o);
|
|
4
4
|
import n from "extensible-custom-error";
|
|
5
5
|
class u extends n {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
6
|
+
constructor(o, a) {
|
|
7
|
+
super(o);
|
|
8
8
|
s(this, "data");
|
|
9
9
|
this.data = a;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"growi-plugin-validation-error.js","sources":["../../src/model/growi-plugin-validation-error.ts"],"sourcesContent":["import ExtensibleCustomError from 'extensible-custom-error';\n\nimport type { GrowiPluginValidationData } from './growi-plugin-validation-data';\n\n\nexport class GrowiPluginValidationError<E extends Partial<GrowiPluginValidationData> = Partial<GrowiPluginValidationData>> extends ExtensibleCustomError {\n\n data?: E;\n\n constructor(message: string, data?: E) {\n super(message);\n this.data = data;\n }\n\n}\n"],"names":["GrowiPluginValidationError","ExtensibleCustomError","message","data","__publicField"],"mappings":";;;;AAKO,MAAMA,UAAsHC,EAAsB;AAAA,EAIvJ,YAAYC,GAAiBC,GAAU;AACrC,UAAMD,CAAO;AAHf,IAAAE,EAAA;AAIE,SAAK,OAAOD;AAAA,
|
|
1
|
+
{"version":3,"file":"growi-plugin-validation-error.js","sources":["../../src/model/growi-plugin-validation-error.ts"],"sourcesContent":["import ExtensibleCustomError from 'extensible-custom-error';\n\nimport type { GrowiPluginValidationData } from './growi-plugin-validation-data';\n\n\nexport class GrowiPluginValidationError<E extends Partial<GrowiPluginValidationData> = Partial<GrowiPluginValidationData>> extends ExtensibleCustomError {\n\n data?: E;\n\n constructor(message: string, data?: E) {\n super(message);\n this.data = data;\n }\n\n}\n"],"names":["GrowiPluginValidationError","ExtensibleCustomError","message","data","__publicField"],"mappings":";;;;AAKO,MAAMA,UAAsHC,EAAsB;AAAA,EAIvJ,YAAYC,GAAiBC,GAAU;AACrC,UAAMD,CAAO;AAHf,IAAAE,EAAA;AAIE,SAAK,OAAOD;AAAA,EAAA;AAGhB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"growi-react.cjs","sources":["../../../../../src/v4/client/utils/growi-facade/growi-react.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { GrowiFacade } from '@growi/core';\n\n\ndeclare global {\n interface Window {\n GrowiFacade: GrowiFacade\n }\n}\n\n/**\n * Retrieves the React instance that this package should use.\n *\n * - **Production Mode**: Returns the React instance from `window.GrowiFacade.react`\n * to ensure a single shared React instance across the app.\n * - **Development Mode**: Returns the React instance passed as an argument,\n * which allows local development and hot reload without issues.\n *\n * @param react - The React instance to use during development\n * @returns A React instance to be used in the current environment\n *\n * @remarks\n * Using multiple React instances in a single app can cause serious issues,\n * especially with features like Hooks, which rely on a consistent internal state.\n * This function ensures that only one React instance is used in production\n * to avoid such problems.\n */\nexport const growiReact = (react: typeof React): typeof React => {\n if (process.env.NODE_ENV === 'production') {\n return window.GrowiFacade.react as typeof React;\n }\n return react as typeof React;\n};\n"],"names":["growiReact","react"],"mappings":"gFA4Ba,MAAAA,EAAcC,GACrB,QAAQ,IAAI,WAAa,aACpB,OAAO,YAAY,MAErBA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { GrowiFacade } from '@growi/core';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
GrowiFacade: GrowiFacade;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves the React instance that this package should use.
|
|
11
|
+
*
|
|
12
|
+
* - **Production Mode**: Returns the React instance from `window.GrowiFacade.react`
|
|
13
|
+
* to ensure a single shared React instance across the app.
|
|
14
|
+
* - **Development Mode**: Returns the React instance passed as an argument,
|
|
15
|
+
* which allows local development and hot reload without issues.
|
|
16
|
+
*
|
|
17
|
+
* @param react - The React instance to use during development
|
|
18
|
+
* @returns A React instance to be used in the current environment
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Using multiple React instances in a single app can cause serious issues,
|
|
22
|
+
* especially with features like Hooks, which rely on a consistent internal state.
|
|
23
|
+
* This function ensures that only one React instance is used in production
|
|
24
|
+
* to avoid such problems.
|
|
25
|
+
*/
|
|
26
|
+
export declare const growiReact: (react: typeof React) => typeof React;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"growi-react.js","sources":["../../../../../src/v4/client/utils/growi-facade/growi-react.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { GrowiFacade } from '@growi/core';\n\n\ndeclare global {\n interface Window {\n GrowiFacade: GrowiFacade\n }\n}\n\n/**\n * Retrieves the React instance that this package should use.\n *\n * - **Production Mode**: Returns the React instance from `window.GrowiFacade.react`\n * to ensure a single shared React instance across the app.\n * - **Development Mode**: Returns the React instance passed as an argument,\n * which allows local development and hot reload without issues.\n *\n * @param react - The React instance to use during development\n * @returns A React instance to be used in the current environment\n *\n * @remarks\n * Using multiple React instances in a single app can cause serious issues,\n * especially with features like Hooks, which rely on a consistent internal state.\n * This function ensures that only one React instance is used in production\n * to avoid such problems.\n */\nexport const growiReact = (react: typeof React): typeof React => {\n if (process.env.NODE_ENV === 'production') {\n return window.GrowiFacade.react as typeof React;\n }\n return react as typeof React;\n};\n"],"names":["growiReact","react"],"mappings":"AA4Ba,MAAAA,IAAa,CAACC,MACrB,QAAQ,IAAI,aAAa,eACpB,OAAO,YAAY,QAErBA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './growi-react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './growi-facade';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-package-json.cjs","sources":["../../../../../src/v4/server/utils/common/import-package-json.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport path from 'path';\n\nimport type { GrowiPluginPackageData } from '../../../../model';\n\nexport const importPackageJson = (projectDirRoot: string): GrowiPluginPackageData => {\n const packageJsonUrl = path.resolve(projectDirRoot, 'package.json');\n return JSON.parse(readFileSync(packageJsonUrl, 'utf-8'));\n};\n"],"names":["importPackageJson","projectDirRoot","packageJsonUrl","path","readFileSync"],"mappings":"wHAKaA,EAAqBC,GAAmD,CACnF,MAAMC,EAAiBC,EAAK,QAAQF,EAAgB,cAAc,EAClE,OAAO,KAAK,MAAMG,
|
|
1
|
+
{"version":3,"file":"import-package-json.cjs","sources":["../../../../../src/v4/server/utils/common/import-package-json.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport path from 'path';\n\nimport type { GrowiPluginPackageData } from '../../../../model';\n\nexport const importPackageJson = (projectDirRoot: string): GrowiPluginPackageData => {\n const packageJsonUrl = path.resolve(projectDirRoot, 'package.json');\n return JSON.parse(readFileSync(packageJsonUrl, 'utf-8'));\n};\n"],"names":["importPackageJson","projectDirRoot","packageJsonUrl","path","readFileSync"],"mappings":"wHAKaA,EAAqBC,GAAmD,CACnF,MAAMC,EAAiBC,EAAK,QAAQF,EAAgB,cAAc,EAClE,OAAO,KAAK,MAAMG,EAAa,aAAAF,EAAgB,OAAO,CAAC,CACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-growi-plugin-directive.cjs","sources":["../../../../../src/v4/server/utils/common/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiPluginType } from '@growi/core';\n\nimport { type GrowiPluginValidationData, GrowiPluginValidationError } from '../../../../model';\n\nimport { importPackageJson } from './import-package-json';\n\n\nexport const validateGrowiDirective = (projectDirRoot: string, expectedPluginType?: GrowiPluginType): GrowiPluginValidationData => {\n const pkg = importPackageJson(projectDirRoot);\n\n const { growiPlugin } = pkg;\n\n const data: GrowiPluginValidationData = { projectDirRoot, schemaVersion: NaN, growiPlugin };\n\n if (growiPlugin == null) {\n throw new GrowiPluginValidationError(\"The package.json does not have 'growiPlugin' directive.\", data);\n }\n\n // schema version checking\n const schemaVersion = Number(growiPlugin.schemaVersion);\n data.schemaVersion = schemaVersion;\n if (Number.isNaN(schemaVersion) || schemaVersion < 4) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive must have a valid 'schemaVersion' directive.\", data);\n }\n\n const types: GrowiPluginType[] = growiPlugin.types;\n data.actualPluginTypes = types;\n if (types == null) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have 'types' directive.\", data);\n }\n\n // type checking\n if (expectedPluginType != null) {\n data.expectedPluginType = expectedPluginType;\n\n if (!types.includes(expectedPluginType)) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have expected plugin type in 'types' directive.\", data);\n }\n }\n\n return data;\n};\n"],"names":["validateGrowiDirective","projectDirRoot","expectedPluginType","pkg","importPackageJson","growiPlugin","data","GrowiPluginValidationError","schemaVersion","types"],"mappings":"8LAOaA,EAAyB,CAACC,EAAwBC,IAAoE,CAC3H,MAAAC,EAAMC,oBAAkBH,CAAc,EAEtC,CAAE,YAAAI,
|
|
1
|
+
{"version":3,"file":"validate-growi-plugin-directive.cjs","sources":["../../../../../src/v4/server/utils/common/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiPluginType } from '@growi/core';\n\nimport { type GrowiPluginValidationData, GrowiPluginValidationError } from '../../../../model';\n\nimport { importPackageJson } from './import-package-json';\n\n\nexport const validateGrowiDirective = (projectDirRoot: string, expectedPluginType?: GrowiPluginType): GrowiPluginValidationData => {\n const pkg = importPackageJson(projectDirRoot);\n\n const { growiPlugin } = pkg;\n\n const data: GrowiPluginValidationData = { projectDirRoot, schemaVersion: NaN, growiPlugin };\n\n if (growiPlugin == null) {\n throw new GrowiPluginValidationError(\"The package.json does not have 'growiPlugin' directive.\", data);\n }\n\n // schema version checking\n const schemaVersion = Number(growiPlugin.schemaVersion);\n data.schemaVersion = schemaVersion;\n if (Number.isNaN(schemaVersion) || schemaVersion < 4) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive must have a valid 'schemaVersion' directive.\", data);\n }\n\n const types: GrowiPluginType[] = growiPlugin.types;\n data.actualPluginTypes = types;\n if (types == null) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have 'types' directive.\", data);\n }\n\n // type checking\n if (expectedPluginType != null) {\n data.expectedPluginType = expectedPluginType;\n\n if (!types.includes(expectedPluginType)) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have expected plugin type in 'types' directive.\", data);\n }\n }\n\n return data;\n};\n"],"names":["validateGrowiDirective","projectDirRoot","expectedPluginType","pkg","importPackageJson","growiPlugin","data","GrowiPluginValidationError","schemaVersion","types"],"mappings":"8LAOaA,EAAyB,CAACC,EAAwBC,IAAoE,CAC3H,MAAAC,EAAMC,oBAAkBH,CAAc,EAEtC,CAAE,YAAAI,GAAgBF,EAElBG,EAAkC,CAAE,eAAAL,EAAgB,cAAe,IAAK,YAAAI,CAAY,EAE1F,GAAIA,GAAe,KACX,MAAA,IAAIE,EAAAA,2BAA2B,0DAA2DD,CAAI,EAIhG,MAAAE,EAAgB,OAAOH,EAAY,aAAa,EAEtD,GADAC,EAAK,cAAgBE,EACjB,OAAO,MAAMA,CAAa,GAAKA,EAAgB,EAC3C,MAAA,IAAID,EAAAA,2BAA2B,yEAA0ED,CAAI,EAGrH,MAAMG,EAA2BJ,EAAY,MAE7C,GADAC,EAAK,kBAAoBG,EACrBA,GAAS,KACL,MAAA,IAAIF,EAAAA,2BAA2B,6DAA8DD,CAAI,EAIzG,GAAIJ,GAAsB,OACxBI,EAAK,mBAAqBJ,EAEtB,CAACO,EAAM,SAASP,CAAkB,GAC9B,MAAA,IAAIK,EAAAA,2BAA2B,qFAAsFD,CAAI,EAI5H,OAAAA,CACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GrowiPluginValidationData } from '../../../../model';
|
|
2
1
|
import { GrowiPluginType } from '@growi/core';
|
|
2
|
+
import { GrowiPluginValidationData } from '../../../../model';
|
|
3
3
|
|
|
4
4
|
export declare const validateGrowiDirective: (projectDirRoot: string, expectedPluginType?: GrowiPluginType) => GrowiPluginValidationData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-growi-plugin-directive.js","sources":["../../../../../src/v4/server/utils/common/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiPluginType } from '@growi/core';\n\nimport { type GrowiPluginValidationData, GrowiPluginValidationError } from '../../../../model';\n\nimport { importPackageJson } from './import-package-json';\n\n\nexport const validateGrowiDirective = (projectDirRoot: string, expectedPluginType?: GrowiPluginType): GrowiPluginValidationData => {\n const pkg = importPackageJson(projectDirRoot);\n\n const { growiPlugin } = pkg;\n\n const data: GrowiPluginValidationData = { projectDirRoot, schemaVersion: NaN, growiPlugin };\n\n if (growiPlugin == null) {\n throw new GrowiPluginValidationError(\"The package.json does not have 'growiPlugin' directive.\", data);\n }\n\n // schema version checking\n const schemaVersion = Number(growiPlugin.schemaVersion);\n data.schemaVersion = schemaVersion;\n if (Number.isNaN(schemaVersion) || schemaVersion < 4) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive must have a valid 'schemaVersion' directive.\", data);\n }\n\n const types: GrowiPluginType[] = growiPlugin.types;\n data.actualPluginTypes = types;\n if (types == null) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have 'types' directive.\", data);\n }\n\n // type checking\n if (expectedPluginType != null) {\n data.expectedPluginType = expectedPluginType;\n\n if (!types.includes(expectedPluginType)) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have expected plugin type in 'types' directive.\", data);\n }\n }\n\n return data;\n};\n"],"names":["validateGrowiDirective","projectDirRoot","expectedPluginType","pkg","importPackageJson","growiPlugin","data","GrowiPluginValidationError","schemaVersion","types"],"mappings":";;AAOa,MAAAA,IAAyB,CAACC,GAAwBC,MAAoE;AAC3H,QAAAC,IAAMC,EAAkBH,CAAc,GAEtC,EAAE,aAAAI,
|
|
1
|
+
{"version":3,"file":"validate-growi-plugin-directive.js","sources":["../../../../../src/v4/server/utils/common/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiPluginType } from '@growi/core';\n\nimport { type GrowiPluginValidationData, GrowiPluginValidationError } from '../../../../model';\n\nimport { importPackageJson } from './import-package-json';\n\n\nexport const validateGrowiDirective = (projectDirRoot: string, expectedPluginType?: GrowiPluginType): GrowiPluginValidationData => {\n const pkg = importPackageJson(projectDirRoot);\n\n const { growiPlugin } = pkg;\n\n const data: GrowiPluginValidationData = { projectDirRoot, schemaVersion: NaN, growiPlugin };\n\n if (growiPlugin == null) {\n throw new GrowiPluginValidationError(\"The package.json does not have 'growiPlugin' directive.\", data);\n }\n\n // schema version checking\n const schemaVersion = Number(growiPlugin.schemaVersion);\n data.schemaVersion = schemaVersion;\n if (Number.isNaN(schemaVersion) || schemaVersion < 4) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive must have a valid 'schemaVersion' directive.\", data);\n }\n\n const types: GrowiPluginType[] = growiPlugin.types;\n data.actualPluginTypes = types;\n if (types == null) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have 'types' directive.\", data);\n }\n\n // type checking\n if (expectedPluginType != null) {\n data.expectedPluginType = expectedPluginType;\n\n if (!types.includes(expectedPluginType)) {\n throw new GrowiPluginValidationError(\"The growiPlugin directive does not have expected plugin type in 'types' directive.\", data);\n }\n }\n\n return data;\n};\n"],"names":["validateGrowiDirective","projectDirRoot","expectedPluginType","pkg","importPackageJson","growiPlugin","data","GrowiPluginValidationError","schemaVersion","types"],"mappings":";;AAOa,MAAAA,IAAyB,CAACC,GAAwBC,MAAoE;AAC3H,QAAAC,IAAMC,EAAkBH,CAAc,GAEtC,EAAE,aAAAI,MAAgBF,GAElBG,IAAkC,EAAE,gBAAAL,GAAgB,eAAe,KAAK,aAAAI,EAAY;AAE1F,MAAIA,KAAe;AACX,UAAA,IAAIE,EAA2B,2DAA2DD,CAAI;AAIhG,QAAAE,IAAgB,OAAOH,EAAY,aAAa;AAEtD,MADAC,EAAK,gBAAgBE,GACjB,OAAO,MAAMA,CAAa,KAAKA,IAAgB;AAC3C,UAAA,IAAID,EAA2B,0EAA0ED,CAAI;AAGrH,QAAMG,IAA2BJ,EAAY;AAE7C,MADAC,EAAK,oBAAoBG,GACrBA,KAAS;AACL,UAAA,IAAIF,EAA2B,8DAA8DD,CAAI;AAIzG,MAAIJ,KAAsB,SACxBI,EAAK,qBAAqBJ,GAEtB,CAACO,EAAM,SAASP,CAAkB;AAC9B,UAAA,IAAIK,EAA2B,sFAAsFD,CAAI;AAI5H,SAAAA;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-markdown.cjs","sources":["../../../../../src/v4/server/utils/template/get-markdown.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { getStatus } from './get-status';\n\n\nexport const getMarkdown = async(projectDirRoot: string, templateId: string, locale: string): Promise<string> => {\n const tplDir = path.resolve(projectDirRoot, 'dist', templateId, locale);\n\n const { isTemplateExists } = await getStatus(tplDir);\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n\n const markdownPath = path.resolve(tplDir, 'template.md');\n return fs.readFileSync(markdownPath, { encoding: 'utf-8' });\n};\n"],"names":["getMarkdown","projectDirRoot","templateId","locale","tplDir","path","isTemplateExists","getStatus","markdownPath","fs"],"mappings":"sJAMaA,EAAc,MAAMC,EAAwBC,EAAoBC,IAAoC,CAC/G,MAAMC,EAASC,EAAK,QAAQJ,EAAgB,OAAQC,EAAYC,CAAM,EAEhE,CAAE,iBAAAG,
|
|
1
|
+
{"version":3,"file":"get-markdown.cjs","sources":["../../../../../src/v4/server/utils/template/get-markdown.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { getStatus } from './get-status';\n\n\nexport const getMarkdown = async(projectDirRoot: string, templateId: string, locale: string): Promise<string> => {\n const tplDir = path.resolve(projectDirRoot, 'dist', templateId, locale);\n\n const { isTemplateExists } = await getStatus(tplDir);\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n\n const markdownPath = path.resolve(tplDir, 'template.md');\n return fs.readFileSync(markdownPath, { encoding: 'utf-8' });\n};\n"],"names":["getMarkdown","projectDirRoot","templateId","locale","tplDir","path","isTemplateExists","getStatus","markdownPath","fs"],"mappings":"sJAMaA,EAAc,MAAMC,EAAwBC,EAAoBC,IAAoC,CAC/G,MAAMC,EAASC,EAAK,QAAQJ,EAAgB,OAAQC,EAAYC,CAAM,EAEhE,CAAE,iBAAAG,CAAA,EAAqB,MAAMC,EAAAA,UAAUH,CAAM,EAEnD,GAAI,CAACE,EAAwB,MAAA,IAAI,MAAM,8BAA8B,EAErE,MAAME,EAAeH,EAAK,QAAQD,EAAQ,aAAa,EACvD,OAAOK,EAAG,aAAaD,EAAc,CAAE,SAAU,QAAS,CAC5D"}
|
|
@@ -3,8 +3,7 @@ import e from "path";
|
|
|
3
3
|
import { getStatus as m } from "./get-status.js";
|
|
4
4
|
const l = async (o, r, s) => {
|
|
5
5
|
const t = e.resolve(o, "dist", r, s), { isTemplateExists: n } = await m(t);
|
|
6
|
-
if (!n)
|
|
7
|
-
throw new Error("'template.md does not exist.");
|
|
6
|
+
if (!n) throw new Error("'template.md does not exist.");
|
|
8
7
|
const a = e.resolve(t, "template.md");
|
|
9
8
|
return i.readFileSync(a, { encoding: "utf-8" });
|
|
10
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-markdown.js","sources":["../../../../../src/v4/server/utils/template/get-markdown.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { getStatus } from './get-status';\n\n\nexport const getMarkdown = async(projectDirRoot: string, templateId: string, locale: string): Promise<string> => {\n const tplDir = path.resolve(projectDirRoot, 'dist', templateId, locale);\n\n const { isTemplateExists } = await getStatus(tplDir);\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n\n const markdownPath = path.resolve(tplDir, 'template.md');\n return fs.readFileSync(markdownPath, { encoding: 'utf-8' });\n};\n"],"names":["getMarkdown","projectDirRoot","templateId","locale","tplDir","path","isTemplateExists","getStatus","markdownPath","fs"],"mappings":";;;AAMO,MAAMA,IAAc,OAAMC,GAAwBC,GAAoBC,MAAoC;AAC/G,QAAMC,IAASC,EAAK,QAAQJ,GAAgB,QAAQC,GAAYC,CAAM,GAEhE,EAAE,kBAAAG,
|
|
1
|
+
{"version":3,"file":"get-markdown.js","sources":["../../../../../src/v4/server/utils/template/get-markdown.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { getStatus } from './get-status';\n\n\nexport const getMarkdown = async(projectDirRoot: string, templateId: string, locale: string): Promise<string> => {\n const tplDir = path.resolve(projectDirRoot, 'dist', templateId, locale);\n\n const { isTemplateExists } = await getStatus(tplDir);\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n\n const markdownPath = path.resolve(tplDir, 'template.md');\n return fs.readFileSync(markdownPath, { encoding: 'utf-8' });\n};\n"],"names":["getMarkdown","projectDirRoot","templateId","locale","tplDir","path","isTemplateExists","getStatus","markdownPath","fs"],"mappings":";;;AAMO,MAAMA,IAAc,OAAMC,GAAwBC,GAAoBC,MAAoC;AAC/G,QAAMC,IAASC,EAAK,QAAQJ,GAAgB,QAAQC,GAAYC,CAAM,GAEhE,EAAE,kBAAAG,EAAA,IAAqB,MAAMC,EAAUH,CAAM;AAEnD,MAAI,CAACE,EAAwB,OAAA,IAAI,MAAM,8BAA8B;AAErE,QAAME,IAAeH,EAAK,QAAQD,GAAQ,aAAa;AACvD,SAAOK,EAAG,aAAaD,GAAc,EAAE,UAAU,SAAS;AAC5D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-status.cjs","sources":["../../../../../src/v4/server/utils/template/get-status.ts"],"sourcesContent":["import fs, { readFileSync } from 'fs';\nimport path from 'path';\nimport { promisify } from 'util';\n\n\nconst statAsync = promisify(fs.stat);\n\n\ntype TemplateDirStatus = {\n isTemplateExists: boolean,\n meta?: { [key: string]: string },\n}\n\nexport async function getStatus(tplDir: string): Promise<TemplateDirStatus> {\n const markdownPath = path.resolve(tplDir, 'template.md');\n const statForMarkdown = await statAsync(markdownPath);\n const isTemplateExists = statForMarkdown.isFile();\n\n const metaDataPath = path.resolve(tplDir, 'meta.json');\n const statForMetaDataFile = await statAsync(metaDataPath);\n const isMetaDataFileExists = statForMetaDataFile.isFile();\n\n const result: TemplateDirStatus = {\n isTemplateExists,\n meta: isMetaDataFileExists ? JSON.parse(readFileSync(metaDataPath, 'utf-8')) : undefined,\n };\n\n return result;\n}\n"],"names":["statAsync","promisify","fs","getStatus","tplDir","markdownPath","path","isTemplateExists","metaDataPath","isMetaDataFileExists","readFileSync"],"mappings":"0IAKMA,EAAYC,
|
|
1
|
+
{"version":3,"file":"get-status.cjs","sources":["../../../../../src/v4/server/utils/template/get-status.ts"],"sourcesContent":["import fs, { readFileSync } from 'fs';\nimport path from 'path';\nimport { promisify } from 'util';\n\n\nconst statAsync = promisify(fs.stat);\n\n\ntype TemplateDirStatus = {\n isTemplateExists: boolean,\n meta?: { [key: string]: string },\n}\n\nexport async function getStatus(tplDir: string): Promise<TemplateDirStatus> {\n const markdownPath = path.resolve(tplDir, 'template.md');\n const statForMarkdown = await statAsync(markdownPath);\n const isTemplateExists = statForMarkdown.isFile();\n\n const metaDataPath = path.resolve(tplDir, 'meta.json');\n const statForMetaDataFile = await statAsync(metaDataPath);\n const isMetaDataFileExists = statForMetaDataFile.isFile();\n\n const result: TemplateDirStatus = {\n isTemplateExists,\n meta: isMetaDataFileExists ? JSON.parse(readFileSync(metaDataPath, 'utf-8')) : undefined,\n };\n\n return result;\n}\n"],"names":["statAsync","promisify","fs","getStatus","tplDir","markdownPath","path","isTemplateExists","metaDataPath","isMetaDataFileExists","readFileSync"],"mappings":"0IAKMA,EAAYC,EAAAA,UAAUC,EAAG,IAAI,EAQnC,eAAsBC,EAAUC,EAA4C,CAC1E,MAAMC,EAAeC,EAAK,QAAQF,EAAQ,aAAa,EAEjDG,GADkB,MAAMP,EAAUK,CAAY,GACX,OAAO,EAE1CG,EAAeF,EAAK,QAAQF,EAAQ,WAAW,EAE/CK,GADsB,MAAMT,EAAUQ,CAAY,GACP,OAAO,EAOjD,MAL2B,CAChC,iBAAAD,EACA,KAAME,EAAuB,KAAK,MAAMC,EAAAA,aAAaF,EAAc,OAAO,CAAC,EAAI,MACjF,CAGF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-status.js","sources":["../../../../../src/v4/server/utils/template/get-status.ts"],"sourcesContent":["import fs, { readFileSync } from 'fs';\nimport path from 'path';\nimport { promisify } from 'util';\n\n\nconst statAsync = promisify(fs.stat);\n\n\ntype TemplateDirStatus = {\n isTemplateExists: boolean,\n meta?: { [key: string]: string },\n}\n\nexport async function getStatus(tplDir: string): Promise<TemplateDirStatus> {\n const markdownPath = path.resolve(tplDir, 'template.md');\n const statForMarkdown = await statAsync(markdownPath);\n const isTemplateExists = statForMarkdown.isFile();\n\n const metaDataPath = path.resolve(tplDir, 'meta.json');\n const statForMetaDataFile = await statAsync(metaDataPath);\n const isMetaDataFileExists = statForMetaDataFile.isFile();\n\n const result: TemplateDirStatus = {\n isTemplateExists,\n meta: isMetaDataFileExists ? JSON.parse(readFileSync(metaDataPath, 'utf-8')) : undefined,\n };\n\n return result;\n}\n"],"names":["statAsync","promisify","fs","getStatus","tplDir","markdownPath","path","isTemplateExists","metaDataPath","isMetaDataFileExists","readFileSync"],"mappings":";;;AAKA,MAAMA,IAAYC,EAAUC,EAAG,IAAI;AAQnC,eAAsBC,EAAUC,GAA4C;AAC1E,QAAMC,IAAeC,EAAK,QAAQF,GAAQ,aAAa,GAEjDG,KADkB,MAAMP,EAAUK,CAAY,GACX,
|
|
1
|
+
{"version":3,"file":"get-status.js","sources":["../../../../../src/v4/server/utils/template/get-status.ts"],"sourcesContent":["import fs, { readFileSync } from 'fs';\nimport path from 'path';\nimport { promisify } from 'util';\n\n\nconst statAsync = promisify(fs.stat);\n\n\ntype TemplateDirStatus = {\n isTemplateExists: boolean,\n meta?: { [key: string]: string },\n}\n\nexport async function getStatus(tplDir: string): Promise<TemplateDirStatus> {\n const markdownPath = path.resolve(tplDir, 'template.md');\n const statForMarkdown = await statAsync(markdownPath);\n const isTemplateExists = statForMarkdown.isFile();\n\n const metaDataPath = path.resolve(tplDir, 'meta.json');\n const statForMetaDataFile = await statAsync(metaDataPath);\n const isMetaDataFileExists = statForMetaDataFile.isFile();\n\n const result: TemplateDirStatus = {\n isTemplateExists,\n meta: isMetaDataFileExists ? JSON.parse(readFileSync(metaDataPath, 'utf-8')) : undefined,\n };\n\n return result;\n}\n"],"names":["statAsync","promisify","fs","getStatus","tplDir","markdownPath","path","isTemplateExists","metaDataPath","isMetaDataFileExists","readFileSync"],"mappings":";;;AAKA,MAAMA,IAAYC,EAAUC,EAAG,IAAI;AAQnC,eAAsBC,EAAUC,GAA4C;AAC1E,QAAMC,IAAeC,EAAK,QAAQF,GAAQ,aAAa,GAEjDG,KADkB,MAAMP,EAAUK,CAAY,GACX,OAAO,GAE1CG,IAAeF,EAAK,QAAQF,GAAQ,WAAW,GAE/CK,KADsB,MAAMT,EAAUQ,CAAY,GACP,OAAO;AAOjD,SAL2B;AAAA,IAChC,kBAAAD;AAAA,IACA,MAAME,IAAuB,KAAK,MAAMC,EAAaF,GAAc,OAAO,CAAC,IAAI;AAAA,EACjF;AAGF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.cjs","sources":["../../../../../src/v4/server/utils/template/scan.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport type { GrowiTemplatePluginValidationData } from '../../../../model';\nimport { isTemplateStatusValid, type TemplateStatus, type TemplateSummary } from '../../../interfaces';\n\nimport { getStatus } from './get-status';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const scanTemplate = async(\n projectDirRoot: string,\n templateId: string,\n data: GrowiTemplatePluginValidationData,\n opts?: {\n pluginId?: string,\n },\n): Promise<TemplateStatus[]> => {\n const status: TemplateStatus[] = [];\n\n const tplRootDirPath = path.resolve(projectDirRoot, 'dist', templateId);\n\n let isDefaultPushed = false;\n for await (const locale of data.supportingLocales) {\n const tplDir = path.resolve(tplRootDirPath, locale);\n\n try {\n const stats = await getStatus(tplDir);\n const {\n isTemplateExists, meta,\n } = stats;\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n if (meta == null) throw new Error(\"'meta.md does not exist.\");\n if (meta?.title == null) throw new Error(\"'meta.md does not contain the title.\");\n\n const isDefault = !isDefaultPushed;\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: true,\n isDefault,\n title: meta.title,\n desc: meta.desc,\n });\n isDefaultPushed = true;\n }\n catch (err) {\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: false,\n invalidReason: (err as Error).message,\n });\n }\n }\n\n // eslint-disable-next-line no-console\n console.debug(`Template directory (${projectDirRoot}) has scanned`, { status });\n\n return status;\n};\n\nexport const scanAllTemplates = async(\n projectDirRoot: string,\n opts?: {\n data?: GrowiTemplatePluginValidationData,\n pluginId?: string,\n returnsInvalidTemplates?: boolean,\n },\n): Promise<TemplateSummary[]> => {\n\n const data = opts?.data ?? validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const summaries: TemplateSummary[] = [];\n\n const distDirPath = path.resolve(projectDirRoot, 'dist');\n const distDirFiles = fs.readdirSync(distDirPath);\n\n for await (const templateId of distDirFiles) {\n const status = (await scanTemplate(projectDirRoot, templateId, data, { pluginId: opts?.pluginId }))\n // omit invalid templates if `returnsInvalidTemplates` is true\n .filter(s => (opts?.returnsInvalidTemplates ? true : s.isValid));\n\n // determine default locale\n const defaultTemplateStatus = status.find(s => 'isDefault' in s && s.isDefault);\n\n if (defaultTemplateStatus == null || !isTemplateStatusValid(defaultTemplateStatus)) {\n continue;\n }\n\n summaries.push({\n // for the 'default' key\n default: defaultTemplateStatus,\n // for each locale keys\n ...Object.fromEntries(status.map(templateStatus => [templateStatus.locale, templateStatus])),\n });\n }\n\n return summaries;\n};\n"],"names":["scanTemplate","projectDirRoot","templateId","data","opts","status","tplRootDirPath","path","isDefaultPushed","locale","tplDir","stats","getStatus","isTemplateExists","meta","isDefault","err","scanAllTemplates","validateTemplatePluginGrowiDirective","summaries","distDirPath","distDirFiles","fs","s","defaultTemplateStatus","isTemplateStatusValid","templateStatus"],"mappings":"uPAUaA,EAAe,MACxBC,EACAC,EACAC,EACAC,IAG4B,CAC9B,MAAMC,EAA2B,
|
|
1
|
+
{"version":3,"file":"scan.cjs","sources":["../../../../../src/v4/server/utils/template/scan.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport type { GrowiTemplatePluginValidationData } from '../../../../model';\nimport { isTemplateStatusValid, type TemplateStatus, type TemplateSummary } from '../../../interfaces';\n\nimport { getStatus } from './get-status';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const scanTemplate = async(\n projectDirRoot: string,\n templateId: string,\n data: GrowiTemplatePluginValidationData,\n opts?: {\n pluginId?: string,\n },\n): Promise<TemplateStatus[]> => {\n const status: TemplateStatus[] = [];\n\n const tplRootDirPath = path.resolve(projectDirRoot, 'dist', templateId);\n\n let isDefaultPushed = false;\n for await (const locale of data.supportingLocales) {\n const tplDir = path.resolve(tplRootDirPath, locale);\n\n try {\n const stats = await getStatus(tplDir);\n const {\n isTemplateExists, meta,\n } = stats;\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n if (meta == null) throw new Error(\"'meta.md does not exist.\");\n if (meta?.title == null) throw new Error(\"'meta.md does not contain the title.\");\n\n const isDefault = !isDefaultPushed;\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: true,\n isDefault,\n title: meta.title,\n desc: meta.desc,\n });\n isDefaultPushed = true;\n }\n catch (err) {\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: false,\n invalidReason: (err as Error).message,\n });\n }\n }\n\n // eslint-disable-next-line no-console\n console.debug(`Template directory (${projectDirRoot}) has scanned`, { status });\n\n return status;\n};\n\nexport const scanAllTemplates = async(\n projectDirRoot: string,\n opts?: {\n data?: GrowiTemplatePluginValidationData,\n pluginId?: string,\n returnsInvalidTemplates?: boolean,\n },\n): Promise<TemplateSummary[]> => {\n\n const data = opts?.data ?? validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const summaries: TemplateSummary[] = [];\n\n const distDirPath = path.resolve(projectDirRoot, 'dist');\n const distDirFiles = fs.readdirSync(distDirPath);\n\n for await (const templateId of distDirFiles) {\n const status = (await scanTemplate(projectDirRoot, templateId, data, { pluginId: opts?.pluginId }))\n // omit invalid templates if `returnsInvalidTemplates` is true\n .filter(s => (opts?.returnsInvalidTemplates ? true : s.isValid));\n\n // determine default locale\n const defaultTemplateStatus = status.find(s => 'isDefault' in s && s.isDefault);\n\n if (defaultTemplateStatus == null || !isTemplateStatusValid(defaultTemplateStatus)) {\n continue;\n }\n\n summaries.push({\n // for the 'default' key\n default: defaultTemplateStatus,\n // for each locale keys\n ...Object.fromEntries(status.map(templateStatus => [templateStatus.locale, templateStatus])),\n });\n }\n\n return summaries;\n};\n"],"names":["scanTemplate","projectDirRoot","templateId","data","opts","status","tplRootDirPath","path","isDefaultPushed","locale","tplDir","stats","getStatus","isTemplateExists","meta","isDefault","err","scanAllTemplates","validateTemplatePluginGrowiDirective","summaries","distDirPath","distDirFiles","fs","s","defaultTemplateStatus","isTemplateStatusValid","templateStatus"],"mappings":"uPAUaA,EAAe,MACxBC,EACAC,EACAC,EACAC,IAG4B,CAC9B,MAAMC,EAA2B,CAAC,EAE5BC,EAAiBC,EAAK,QAAQN,EAAgB,OAAQC,CAAU,EAEtE,IAAIM,EAAkB,GACL,gBAAAC,KAAUN,EAAK,kBAAmB,CACjD,MAAMO,EAASH,EAAK,QAAQD,EAAgBG,CAAM,EAE9C,GAAA,CACI,MAAAE,EAAQ,MAAMC,EAAA,UAAUF,CAAM,EAC9B,CACJ,iBAAAG,EAAkB,KAAAC,CAAA,EAChBH,EAEJ,GAAI,CAACE,EAAwB,MAAA,IAAI,MAAM,8BAA8B,EACrE,GAAIC,GAAQ,KAAY,MAAA,IAAI,MAAM,0BAA0B,EAC5D,IAAIA,GAAA,YAAAA,EAAM,QAAS,KAAY,MAAA,IAAI,MAAM,sCAAsC,EAE/E,MAAMC,EAAY,CAACP,EACnBH,EAAO,KAAK,CACV,SAAUD,GAAA,YAAAA,EAAM,SAChB,GAAIF,EACJ,OAAAO,EACA,QAAS,GACT,UAAAM,EACA,MAAOD,EAAK,MACZ,KAAMA,EAAK,IAAA,CACZ,EACiBN,EAAA,SAEbQ,EAAK,CACVX,EAAO,KAAK,CACV,SAAUD,GAAA,YAAAA,EAAM,SAChB,GAAIF,EACJ,OAAAO,EACA,QAAS,GACT,cAAgBO,EAAc,OAAA,CAC/B,CAAA,CACH,CAIF,eAAQ,MAAM,uBAAuBf,CAAc,gBAAiB,CAAE,OAAAI,EAAQ,EAEvEA,CACT,EAEaY,EAAmB,MAC5BhB,EACAG,IAK6B,CAE/B,MAAMD,GAAOC,GAAA,YAAAA,EAAM,OAAQc,EAAAA,qCAAqCjB,CAAc,EAExEkB,EAA+B,CAAC,EAEhCC,EAAcb,EAAK,QAAQN,EAAgB,MAAM,EACjDoB,EAAeC,EAAG,YAAYF,CAAW,EAE/C,gBAAiBlB,KAAcmB,EAAc,CAC3C,MAAMhB,GAAU,MAAML,EAAaC,EAAgBC,EAAYC,EAAM,CAAE,SAAUC,GAAA,YAAAA,EAAM,QAAS,CAAC,GAE9F,OAAOmB,GAAMnB,GAAA,MAAAA,EAAM,wBAA0B,GAAOmB,EAAE,OAAQ,EAG3DC,EAAwBnB,EAAO,QAAU,cAAekB,GAAKA,EAAE,SAAS,EAE1EC,GAAyB,MAAQ,CAACC,EAAA,sBAAsBD,CAAqB,GAIjFL,EAAU,KAAK,CAEb,QAASK,EAET,GAAG,OAAO,YAAYnB,EAAO,IAAsBqB,GAAA,CAACA,EAAe,OAAQA,CAAc,CAAC,CAAC,CAAA,CAC5F,CAAA,CAGI,OAAAP,CACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TemplateStatus, TemplateSummary } from '../../../interfaces';
|
|
2
1
|
import { GrowiTemplatePluginValidationData } from '../../../../model';
|
|
2
|
+
import { TemplateStatus, TemplateSummary } from '../../../interfaces';
|
|
3
3
|
|
|
4
4
|
export declare const scanTemplate: (projectDirRoot: string, templateId: string, data: GrowiTemplatePluginValidationData, opts?: {
|
|
5
5
|
pluginId?: string;
|
|
@@ -13,12 +13,9 @@ const v = async (a, e, u, i) => {
|
|
|
13
13
|
isTemplateExists: m,
|
|
14
14
|
meta: s
|
|
15
15
|
} = t;
|
|
16
|
-
if (!m)
|
|
17
|
-
|
|
18
|
-
if (s == null)
|
|
19
|
-
throw new Error("'meta.md does not exist.");
|
|
20
|
-
if ((s == null ? void 0 : s.title) == null)
|
|
21
|
-
throw new Error("'meta.md does not contain the title.");
|
|
16
|
+
if (!m) throw new Error("'template.md does not exist.");
|
|
17
|
+
if (s == null) throw new Error("'meta.md does not exist.");
|
|
18
|
+
if ((s == null ? void 0 : s.title) == null) throw new Error("'meta.md does not contain the title.");
|
|
22
19
|
const f = !d;
|
|
23
20
|
l.push({
|
|
24
21
|
pluginId: i == null ? void 0 : i.pluginId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.js","sources":["../../../../../src/v4/server/utils/template/scan.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport type { GrowiTemplatePluginValidationData } from '../../../../model';\nimport { isTemplateStatusValid, type TemplateStatus, type TemplateSummary } from '../../../interfaces';\n\nimport { getStatus } from './get-status';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const scanTemplate = async(\n projectDirRoot: string,\n templateId: string,\n data: GrowiTemplatePluginValidationData,\n opts?: {\n pluginId?: string,\n },\n): Promise<TemplateStatus[]> => {\n const status: TemplateStatus[] = [];\n\n const tplRootDirPath = path.resolve(projectDirRoot, 'dist', templateId);\n\n let isDefaultPushed = false;\n for await (const locale of data.supportingLocales) {\n const tplDir = path.resolve(tplRootDirPath, locale);\n\n try {\n const stats = await getStatus(tplDir);\n const {\n isTemplateExists, meta,\n } = stats;\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n if (meta == null) throw new Error(\"'meta.md does not exist.\");\n if (meta?.title == null) throw new Error(\"'meta.md does not contain the title.\");\n\n const isDefault = !isDefaultPushed;\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: true,\n isDefault,\n title: meta.title,\n desc: meta.desc,\n });\n isDefaultPushed = true;\n }\n catch (err) {\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: false,\n invalidReason: (err as Error).message,\n });\n }\n }\n\n // eslint-disable-next-line no-console\n console.debug(`Template directory (${projectDirRoot}) has scanned`, { status });\n\n return status;\n};\n\nexport const scanAllTemplates = async(\n projectDirRoot: string,\n opts?: {\n data?: GrowiTemplatePluginValidationData,\n pluginId?: string,\n returnsInvalidTemplates?: boolean,\n },\n): Promise<TemplateSummary[]> => {\n\n const data = opts?.data ?? validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const summaries: TemplateSummary[] = [];\n\n const distDirPath = path.resolve(projectDirRoot, 'dist');\n const distDirFiles = fs.readdirSync(distDirPath);\n\n for await (const templateId of distDirFiles) {\n const status = (await scanTemplate(projectDirRoot, templateId, data, { pluginId: opts?.pluginId }))\n // omit invalid templates if `returnsInvalidTemplates` is true\n .filter(s => (opts?.returnsInvalidTemplates ? true : s.isValid));\n\n // determine default locale\n const defaultTemplateStatus = status.find(s => 'isDefault' in s && s.isDefault);\n\n if (defaultTemplateStatus == null || !isTemplateStatusValid(defaultTemplateStatus)) {\n continue;\n }\n\n summaries.push({\n // for the 'default' key\n default: defaultTemplateStatus,\n // for each locale keys\n ...Object.fromEntries(status.map(templateStatus => [templateStatus.locale, templateStatus])),\n });\n }\n\n return summaries;\n};\n"],"names":["scanTemplate","projectDirRoot","templateId","data","opts","status","tplRootDirPath","path","isDefaultPushed","locale","tplDir","stats","getStatus","isTemplateExists","meta","isDefault","err","scanAllTemplates","validateTemplatePluginGrowiDirective","summaries","distDirPath","distDirFiles","fs","s","defaultTemplateStatus","isTemplateStatusValid","templateStatus"],"mappings":";;;;;AAUO,MAAMA,IAAe,OACxBC,GACAC,GACAC,GACAC,MAG4B;AAC9B,QAAMC,IAA2B,
|
|
1
|
+
{"version":3,"file":"scan.js","sources":["../../../../../src/v4/server/utils/template/scan.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport type { GrowiTemplatePluginValidationData } from '../../../../model';\nimport { isTemplateStatusValid, type TemplateStatus, type TemplateSummary } from '../../../interfaces';\n\nimport { getStatus } from './get-status';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const scanTemplate = async(\n projectDirRoot: string,\n templateId: string,\n data: GrowiTemplatePluginValidationData,\n opts?: {\n pluginId?: string,\n },\n): Promise<TemplateStatus[]> => {\n const status: TemplateStatus[] = [];\n\n const tplRootDirPath = path.resolve(projectDirRoot, 'dist', templateId);\n\n let isDefaultPushed = false;\n for await (const locale of data.supportingLocales) {\n const tplDir = path.resolve(tplRootDirPath, locale);\n\n try {\n const stats = await getStatus(tplDir);\n const {\n isTemplateExists, meta,\n } = stats;\n\n if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n if (meta == null) throw new Error(\"'meta.md does not exist.\");\n if (meta?.title == null) throw new Error(\"'meta.md does not contain the title.\");\n\n const isDefault = !isDefaultPushed;\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: true,\n isDefault,\n title: meta.title,\n desc: meta.desc,\n });\n isDefaultPushed = true;\n }\n catch (err) {\n status.push({\n pluginId: opts?.pluginId,\n id: templateId,\n locale,\n isValid: false,\n invalidReason: (err as Error).message,\n });\n }\n }\n\n // eslint-disable-next-line no-console\n console.debug(`Template directory (${projectDirRoot}) has scanned`, { status });\n\n return status;\n};\n\nexport const scanAllTemplates = async(\n projectDirRoot: string,\n opts?: {\n data?: GrowiTemplatePluginValidationData,\n pluginId?: string,\n returnsInvalidTemplates?: boolean,\n },\n): Promise<TemplateSummary[]> => {\n\n const data = opts?.data ?? validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const summaries: TemplateSummary[] = [];\n\n const distDirPath = path.resolve(projectDirRoot, 'dist');\n const distDirFiles = fs.readdirSync(distDirPath);\n\n for await (const templateId of distDirFiles) {\n const status = (await scanTemplate(projectDirRoot, templateId, data, { pluginId: opts?.pluginId }))\n // omit invalid templates if `returnsInvalidTemplates` is true\n .filter(s => (opts?.returnsInvalidTemplates ? true : s.isValid));\n\n // determine default locale\n const defaultTemplateStatus = status.find(s => 'isDefault' in s && s.isDefault);\n\n if (defaultTemplateStatus == null || !isTemplateStatusValid(defaultTemplateStatus)) {\n continue;\n }\n\n summaries.push({\n // for the 'default' key\n default: defaultTemplateStatus,\n // for each locale keys\n ...Object.fromEntries(status.map(templateStatus => [templateStatus.locale, templateStatus])),\n });\n }\n\n return summaries;\n};\n"],"names":["scanTemplate","projectDirRoot","templateId","data","opts","status","tplRootDirPath","path","isDefaultPushed","locale","tplDir","stats","getStatus","isTemplateExists","meta","isDefault","err","scanAllTemplates","validateTemplatePluginGrowiDirective","summaries","distDirPath","distDirFiles","fs","s","defaultTemplateStatus","isTemplateStatusValid","templateStatus"],"mappings":";;;;;AAUO,MAAMA,IAAe,OACxBC,GACAC,GACAC,GACAC,MAG4B;AAC9B,QAAMC,IAA2B,CAAC,GAE5BC,IAAiBC,EAAK,QAAQN,GAAgB,QAAQC,CAAU;AAEtE,MAAIM,IAAkB;AACL,mBAAAC,KAAUN,EAAK,mBAAmB;AACjD,UAAMO,IAASH,EAAK,QAAQD,GAAgBG,CAAM;AAE9C,QAAA;AACI,YAAAE,IAAQ,MAAMC,EAAUF,CAAM,GAC9B;AAAA,QACJ,kBAAAG;AAAA,QAAkB,MAAAC;AAAA,MAAA,IAChBH;AAEJ,UAAI,CAACE,EAAwB,OAAA,IAAI,MAAM,8BAA8B;AACrE,UAAIC,KAAQ,KAAY,OAAA,IAAI,MAAM,0BAA0B;AAC5D,WAAIA,KAAA,gBAAAA,EAAM,UAAS,KAAY,OAAA,IAAI,MAAM,sCAAsC;AAE/E,YAAMC,IAAY,CAACP;AACnB,MAAAH,EAAO,KAAK;AAAA,QACV,UAAUD,KAAA,gBAAAA,EAAM;AAAA,QAChB,IAAIF;AAAA,QACJ,QAAAO;AAAA,QACA,SAAS;AAAA,QACT,WAAAM;AAAA,QACA,OAAOD,EAAK;AAAA,QACZ,MAAMA,EAAK;AAAA,MAAA,CACZ,GACiBN,IAAA;AAAA,aAEbQ,GAAK;AACV,MAAAX,EAAO,KAAK;AAAA,QACV,UAAUD,KAAA,gBAAAA,EAAM;AAAA,QAChB,IAAIF;AAAA,QACJ,QAAAO;AAAA,QACA,SAAS;AAAA,QACT,eAAgBO,EAAc;AAAA,MAAA,CAC/B;AAAA,IAAA;AAAA,EACH;AAIF,iBAAQ,MAAM,uBAAuBf,CAAc,iBAAiB,EAAE,QAAAI,GAAQ,GAEvEA;AACT,GAEaY,IAAmB,OAC5BhB,GACAG,MAK6B;AAE/B,QAAMD,KAAOC,KAAA,gBAAAA,EAAM,SAAQc,EAAqCjB,CAAc,GAExEkB,IAA+B,CAAC,GAEhCC,IAAcb,EAAK,QAAQN,GAAgB,MAAM,GACjDoB,IAAeC,EAAG,YAAYF,CAAW;AAE/C,mBAAiBlB,KAAcmB,GAAc;AAC3C,UAAMhB,KAAU,MAAML,EAAaC,GAAgBC,GAAYC,GAAM,EAAE,UAAUC,KAAA,gBAAAA,EAAM,SAAS,CAAC,GAE9F,OAAO,CAAAmB,MAAMnB,KAAA,QAAAA,EAAM,0BAA0B,KAAOmB,EAAE,OAAQ,GAG3DC,IAAwBnB,EAAO,KAAK,OAAK,eAAekB,KAAKA,EAAE,SAAS;AAE9E,IAAIC,KAAyB,QAAQ,CAACC,EAAsBD,CAAqB,KAIjFL,EAAU,KAAK;AAAA;AAAA,MAEb,SAASK;AAAA;AAAA,MAET,GAAG,OAAO,YAAYnB,EAAO,IAAI,CAAkBqB,MAAA,CAACA,EAAe,QAAQA,CAAc,CAAC,CAAC;AAAA,IAAA,CAC5F;AAAA,EAAA;AAGI,SAAAP;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-all-locales.cjs","sources":["../../../../../src/v4/server/utils/template/validate-all-locales.ts"],"sourcesContent":["import { scanAllTemplates } from './scan';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const validateAllTemplateLocales = async(projectDirRoot: string): Promise<boolean> => {\n const data = validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const results = await scanAllTemplates(projectDirRoot, { data, returnsInvalidTemplates: true });\n\n if (Object.keys(results).length === 0) {\n throw new Error('This plugin does not have any templates');\n }\n\n // construct map\n // key: id\n // value: isValid properties\n const idValidMap: { [id: string]: boolean[] } = {};\n results.forEach((summary) => {\n idValidMap[summary.default.id] = Object.values(summary).map(s => s?.isValid ?? false);\n });\n\n for (const [id, validMap] of Object.entries(idValidMap)) {\n // warn\n if (!validMap.every(bool => bool)) {\n // eslint-disable-next-line no-console\n console.warn(`[WARN] Template '${id}' has some locales that status is invalid`);\n }\n\n // This means the template directory does not have any valid template\n if (!validMap.some(bool => bool)) {\n return false;\n }\n }\n\n return true;\n};\n"],"names":["validateAllTemplateLocales","projectDirRoot","data","validateTemplatePluginGrowiDirective","results","scanAllTemplates","idValidMap","summary","s","id","validMap","bool"],"mappings":"iKAIaA,EAA6B,MAAMC,GAA6C,CACrF,MAAAC,EAAOC,uCAAqCF,CAAc,EAE1DG,EAAU,MAAMC,
|
|
1
|
+
{"version":3,"file":"validate-all-locales.cjs","sources":["../../../../../src/v4/server/utils/template/validate-all-locales.ts"],"sourcesContent":["import { scanAllTemplates } from './scan';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const validateAllTemplateLocales = async(projectDirRoot: string): Promise<boolean> => {\n const data = validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const results = await scanAllTemplates(projectDirRoot, { data, returnsInvalidTemplates: true });\n\n if (Object.keys(results).length === 0) {\n throw new Error('This plugin does not have any templates');\n }\n\n // construct map\n // key: id\n // value: isValid properties\n const idValidMap: { [id: string]: boolean[] } = {};\n results.forEach((summary) => {\n idValidMap[summary.default.id] = Object.values(summary).map(s => s?.isValid ?? false);\n });\n\n for (const [id, validMap] of Object.entries(idValidMap)) {\n // warn\n if (!validMap.every(bool => bool)) {\n // eslint-disable-next-line no-console\n console.warn(`[WARN] Template '${id}' has some locales that status is invalid`);\n }\n\n // This means the template directory does not have any valid template\n if (!validMap.some(bool => bool)) {\n return false;\n }\n }\n\n return true;\n};\n"],"names":["validateAllTemplateLocales","projectDirRoot","data","validateTemplatePluginGrowiDirective","results","scanAllTemplates","idValidMap","summary","s","id","validMap","bool"],"mappings":"iKAIaA,EAA6B,MAAMC,GAA6C,CACrF,MAAAC,EAAOC,uCAAqCF,CAAc,EAE1DG,EAAU,MAAMC,mBAAiBJ,EAAgB,CAAE,KAAAC,EAAM,wBAAyB,GAAM,EAE9F,GAAI,OAAO,KAAKE,CAAO,EAAE,SAAW,EAC5B,MAAA,IAAI,MAAM,yCAAyC,EAM3D,MAAME,EAA0C,CAAC,EACzCF,EAAA,QAASG,GAAY,CAC3BD,EAAWC,EAAQ,QAAQ,EAAE,EAAI,OAAO,OAAOA,CAAO,EAAE,IAAIC,IAAKA,GAAA,YAAAA,EAAG,UAAW,EAAK,CAAA,CACrF,EAED,SAAW,CAACC,EAAIC,CAAQ,IAAK,OAAO,QAAQJ,CAAU,EAQpD,GANKI,EAAS,MAAMC,GAAQA,CAAI,GAEtB,QAAA,KAAK,oBAAoBF,CAAE,2CAA2C,EAI5E,CAACC,EAAS,KAAKC,GAAQA,CAAI,EACtB,MAAA,GAIJ,MAAA,EACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-all-locales.js","sources":["../../../../../src/v4/server/utils/template/validate-all-locales.ts"],"sourcesContent":["import { scanAllTemplates } from './scan';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const validateAllTemplateLocales = async(projectDirRoot: string): Promise<boolean> => {\n const data = validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const results = await scanAllTemplates(projectDirRoot, { data, returnsInvalidTemplates: true });\n\n if (Object.keys(results).length === 0) {\n throw new Error('This plugin does not have any templates');\n }\n\n // construct map\n // key: id\n // value: isValid properties\n const idValidMap: { [id: string]: boolean[] } = {};\n results.forEach((summary) => {\n idValidMap[summary.default.id] = Object.values(summary).map(s => s?.isValid ?? false);\n });\n\n for (const [id, validMap] of Object.entries(idValidMap)) {\n // warn\n if (!validMap.every(bool => bool)) {\n // eslint-disable-next-line no-console\n console.warn(`[WARN] Template '${id}' has some locales that status is invalid`);\n }\n\n // This means the template directory does not have any valid template\n if (!validMap.some(bool => bool)) {\n return false;\n }\n }\n\n return true;\n};\n"],"names":["validateAllTemplateLocales","projectDirRoot","data","validateTemplatePluginGrowiDirective","results","scanAllTemplates","idValidMap","summary","s","id","validMap","bool"],"mappings":";;AAIa,MAAAA,IAA6B,OAAMC,MAA6C;AACrF,QAAAC,IAAOC,EAAqCF,CAAc,GAE1DG,IAAU,MAAMC,EAAiBJ,GAAgB,EAAE,MAAAC,GAAM,yBAAyB,IAAM;AAE9F,MAAI,OAAO,KAAKE,CAAO,EAAE,WAAW;AAC5B,UAAA,IAAI,MAAM,yCAAyC;AAM3D,QAAME,IAA0C,
|
|
1
|
+
{"version":3,"file":"validate-all-locales.js","sources":["../../../../../src/v4/server/utils/template/validate-all-locales.ts"],"sourcesContent":["import { scanAllTemplates } from './scan';\nimport { validateTemplatePluginGrowiDirective } from './validate-growi-plugin-directive';\n\n\nexport const validateAllTemplateLocales = async(projectDirRoot: string): Promise<boolean> => {\n const data = validateTemplatePluginGrowiDirective(projectDirRoot);\n\n const results = await scanAllTemplates(projectDirRoot, { data, returnsInvalidTemplates: true });\n\n if (Object.keys(results).length === 0) {\n throw new Error('This plugin does not have any templates');\n }\n\n // construct map\n // key: id\n // value: isValid properties\n const idValidMap: { [id: string]: boolean[] } = {};\n results.forEach((summary) => {\n idValidMap[summary.default.id] = Object.values(summary).map(s => s?.isValid ?? false);\n });\n\n for (const [id, validMap] of Object.entries(idValidMap)) {\n // warn\n if (!validMap.every(bool => bool)) {\n // eslint-disable-next-line no-console\n console.warn(`[WARN] Template '${id}' has some locales that status is invalid`);\n }\n\n // This means the template directory does not have any valid template\n if (!validMap.some(bool => bool)) {\n return false;\n }\n }\n\n return true;\n};\n"],"names":["validateAllTemplateLocales","projectDirRoot","data","validateTemplatePluginGrowiDirective","results","scanAllTemplates","idValidMap","summary","s","id","validMap","bool"],"mappings":";;AAIa,MAAAA,IAA6B,OAAMC,MAA6C;AACrF,QAAAC,IAAOC,EAAqCF,CAAc,GAE1DG,IAAU,MAAMC,EAAiBJ,GAAgB,EAAE,MAAAC,GAAM,yBAAyB,IAAM;AAE9F,MAAI,OAAO,KAAKE,CAAO,EAAE,WAAW;AAC5B,UAAA,IAAI,MAAM,yCAAyC;AAM3D,QAAME,IAA0C,CAAC;AACzC,EAAAF,EAAA,QAAQ,CAACG,MAAY;AAC3B,IAAAD,EAAWC,EAAQ,QAAQ,EAAE,IAAI,OAAO,OAAOA,CAAO,EAAE,IAAI,CAAAC,OAAKA,KAAA,gBAAAA,EAAG,YAAW,EAAK;AAAA,EAAA,CACrF;AAED,aAAW,CAACC,GAAIC,CAAQ,KAAK,OAAO,QAAQJ,CAAU;AAQpD,QANKI,EAAS,MAAM,CAAAC,MAAQA,CAAI,KAEtB,QAAA,KAAK,oBAAoBF,CAAE,2CAA2C,GAI5E,CAACC,EAAS,KAAK,CAAAC,MAAQA,CAAI;AACtB,aAAA;AAIJ,SAAA;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-growi-plugin-directive.cjs","sources":["../../../../../src/v4/server/utils/template/validate-growi-plugin-directive.ts"],"sourcesContent":["import { GrowiPluginType } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiTemplatePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for template plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateTemplatePluginGrowiDirective = (projectDirRoot: string): GrowiTemplatePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Template);\n\n const { growiPlugin } = data;\n\n // check supporting locales\n const supportingLocales: string[] | undefined = growiPlugin.locales;\n if (supportingLocales == null || supportingLocales.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData & { supportingLocales?: string[] }>(\n \"Template plugin must have 'supportingLocales' and that must have one or more locales\",\n {\n ...data,\n supportingLocales,\n },\n );\n }\n\n return {\n ...data,\n supportingLocales,\n };\n};\n"],"names":["validateTemplatePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","supportingLocales","GrowiPluginValidationError"],"mappings":"2OAWaA,EAAwCC,GAA8D,CACjH,MAAMC,EAAOC,EAAA,uBAAuBF,EAAgBG,
|
|
1
|
+
{"version":3,"file":"validate-growi-plugin-directive.cjs","sources":["../../../../../src/v4/server/utils/template/validate-growi-plugin-directive.ts"],"sourcesContent":["import { GrowiPluginType } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiTemplatePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for template plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateTemplatePluginGrowiDirective = (projectDirRoot: string): GrowiTemplatePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Template);\n\n const { growiPlugin } = data;\n\n // check supporting locales\n const supportingLocales: string[] | undefined = growiPlugin.locales;\n if (supportingLocales == null || supportingLocales.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData & { supportingLocales?: string[] }>(\n \"Template plugin must have 'supportingLocales' and that must have one or more locales\",\n {\n ...data,\n supportingLocales,\n },\n );\n }\n\n return {\n ...data,\n supportingLocales,\n };\n};\n"],"names":["validateTemplatePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","supportingLocales","GrowiPluginValidationError"],"mappings":"2OAWaA,EAAwCC,GAA8D,CACjH,MAAMC,EAAOC,EAAA,uBAAuBF,EAAgBG,EAAAA,gBAAgB,QAAQ,EAEtE,CAAE,YAAAC,GAAgBH,EAGlBI,EAA0CD,EAAY,QAC5D,GAAIC,GAAqB,MAAQA,EAAkB,SAAW,EAC5D,MAAM,IAAIC,EAAA,2BACR,uFACA,CACE,GAAGL,EACH,kBAAAI,CAAA,CAEJ,EAGK,MAAA,CACL,GAAGJ,EACH,kBAAAI,CACF,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-growi-plugin-directive.js","sources":["../../../../../src/v4/server/utils/template/validate-growi-plugin-directive.ts"],"sourcesContent":["import { GrowiPluginType } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiTemplatePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for template plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateTemplatePluginGrowiDirective = (projectDirRoot: string): GrowiTemplatePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Template);\n\n const { growiPlugin } = data;\n\n // check supporting locales\n const supportingLocales: string[] | undefined = growiPlugin.locales;\n if (supportingLocales == null || supportingLocales.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData & { supportingLocales?: string[] }>(\n \"Template plugin must have 'supportingLocales' and that must have one or more locales\",\n {\n ...data,\n supportingLocales,\n },\n );\n }\n\n return {\n ...data,\n supportingLocales,\n };\n};\n"],"names":["validateTemplatePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","supportingLocales","GrowiPluginValidationError"],"mappings":";;;AAWa,MAAAA,IAAuC,CAACC,MAA8D;AACjH,QAAMC,IAAOC,EAAuBF,GAAgBG,EAAgB,QAAQ,GAEtE,EAAE,aAAAC,
|
|
1
|
+
{"version":3,"file":"validate-growi-plugin-directive.js","sources":["../../../../../src/v4/server/utils/template/validate-growi-plugin-directive.ts"],"sourcesContent":["import { GrowiPluginType } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiTemplatePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for template plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateTemplatePluginGrowiDirective = (projectDirRoot: string): GrowiTemplatePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Template);\n\n const { growiPlugin } = data;\n\n // check supporting locales\n const supportingLocales: string[] | undefined = growiPlugin.locales;\n if (supportingLocales == null || supportingLocales.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData & { supportingLocales?: string[] }>(\n \"Template plugin must have 'supportingLocales' and that must have one or more locales\",\n {\n ...data,\n supportingLocales,\n },\n );\n }\n\n return {\n ...data,\n supportingLocales,\n };\n};\n"],"names":["validateTemplatePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","supportingLocales","GrowiPluginValidationError"],"mappings":";;;AAWa,MAAAA,IAAuC,CAACC,MAA8D;AACjH,QAAMC,IAAOC,EAAuBF,GAAgBG,EAAgB,QAAQ,GAEtE,EAAE,aAAAC,MAAgBH,GAGlBI,IAA0CD,EAAY;AAC5D,MAAIC,KAAqB,QAAQA,EAAkB,WAAW;AAC5D,UAAM,IAAIC;AAAA,MACR;AAAA,MACA;AAAA,QACE,GAAGL;AAAA,QACH,mBAAAI;AAAA,MAAA;AAAA,IAEJ;AAGK,SAAA;AAAA,IACL,GAAGJ;AAAA,IACH,mBAAAI;AAAA,EACF;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-growi-plugin-directive.cjs","sources":["../../../../../src/v4/server/utils/theme/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiThemeMetadata } from '@growi/core';\nimport { GrowiPluginType, isGrowiThemeMetadata } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiThemePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for theme plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateThemePluginGrowiDirective = (projectDirRoot: string): GrowiThemePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Theme);\n\n const { growiPlugin } = data;\n\n // check themes\n if (growiPlugin.themes == null || !Array.isArray(growiPlugin.themes) || growiPlugin.themes.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n \"Theme plugin must have 'themes' array and that must have one or more theme metadata\",\n );\n }\n\n const validMetadatas: GrowiThemeMetadata[] = [];\n const invalidObjects: unknown[] = [];\n growiPlugin.themes.forEach((theme: unknown) => {\n if (isGrowiThemeMetadata(theme)) {\n validMetadatas.push(theme);\n }\n else {\n invalidObjects.push(theme);\n }\n });\n\n if (invalidObjects.length > 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n `Some of theme metadata are invalid: ${invalidObjects.toString()}`,\n );\n }\n\n return {\n ...data,\n themes: validMetadatas,\n };\n};\n"],"names":["validateThemePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","GrowiPluginValidationError","validMetadatas","invalidObjects","theme","isGrowiThemeMetadata"],"mappings":"2OAYaA,EAAqCC,GAA2D,CAC3G,MAAMC,EAAOC,EAAA,uBAAuBF,EAAgBG,
|
|
1
|
+
{"version":3,"file":"validate-growi-plugin-directive.cjs","sources":["../../../../../src/v4/server/utils/theme/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiThemeMetadata } from '@growi/core';\nimport { GrowiPluginType, isGrowiThemeMetadata } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiThemePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for theme plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateThemePluginGrowiDirective = (projectDirRoot: string): GrowiThemePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Theme);\n\n const { growiPlugin } = data;\n\n // check themes\n if (growiPlugin.themes == null || !Array.isArray(growiPlugin.themes) || growiPlugin.themes.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n \"Theme plugin must have 'themes' array and that must have one or more theme metadata\",\n );\n }\n\n const validMetadatas: GrowiThemeMetadata[] = [];\n const invalidObjects: unknown[] = [];\n growiPlugin.themes.forEach((theme: unknown) => {\n if (isGrowiThemeMetadata(theme)) {\n validMetadatas.push(theme);\n }\n else {\n invalidObjects.push(theme);\n }\n });\n\n if (invalidObjects.length > 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n `Some of theme metadata are invalid: ${invalidObjects.toString()}`,\n );\n }\n\n return {\n ...data,\n themes: validMetadatas,\n };\n};\n"],"names":["validateThemePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","GrowiPluginValidationError","validMetadatas","invalidObjects","theme","isGrowiThemeMetadata"],"mappings":"2OAYaA,EAAqCC,GAA2D,CAC3G,MAAMC,EAAOC,EAAA,uBAAuBF,EAAgBG,EAAAA,gBAAgB,KAAK,EAEnE,CAAE,YAAAC,GAAgBH,EAGxB,GAAIG,EAAY,QAAU,MAAQ,CAAC,MAAM,QAAQA,EAAY,MAAM,GAAKA,EAAY,OAAO,SAAW,EACpG,MAAM,IAAIC,EAAA,2BACR,qFACF,EAGF,MAAMC,EAAuC,CAAC,EACxCC,EAA4B,CAAC,EAU/B,GATQH,EAAA,OAAO,QAASI,GAAmB,CACzCC,EAAAA,qBAAqBD,CAAK,EAC5BF,EAAe,KAAKE,CAAK,EAGzBD,EAAe,KAAKC,CAAK,CAC3B,CACD,EAEGD,EAAe,OAAS,EAC1B,MAAM,IAAIF,EAAA,2BACR,uCAAuCE,EAAe,UAAU,EAClE,EAGK,MAAA,CACL,GAAGN,EACH,OAAQK,CACV,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-growi-plugin-directive.js","sources":["../../../../../src/v4/server/utils/theme/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiThemeMetadata } from '@growi/core';\nimport { GrowiPluginType, isGrowiThemeMetadata } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiThemePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for theme plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateThemePluginGrowiDirective = (projectDirRoot: string): GrowiThemePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Theme);\n\n const { growiPlugin } = data;\n\n // check themes\n if (growiPlugin.themes == null || !Array.isArray(growiPlugin.themes) || growiPlugin.themes.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n \"Theme plugin must have 'themes' array and that must have one or more theme metadata\",\n );\n }\n\n const validMetadatas: GrowiThemeMetadata[] = [];\n const invalidObjects: unknown[] = [];\n growiPlugin.themes.forEach((theme: unknown) => {\n if (isGrowiThemeMetadata(theme)) {\n validMetadatas.push(theme);\n }\n else {\n invalidObjects.push(theme);\n }\n });\n\n if (invalidObjects.length > 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n `Some of theme metadata are invalid: ${invalidObjects.toString()}`,\n );\n }\n\n return {\n ...data,\n themes: validMetadatas,\n };\n};\n"],"names":["validateThemePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","GrowiPluginValidationError","validMetadatas","invalidObjects","theme","isGrowiThemeMetadata"],"mappings":";;;AAYa,MAAAA,IAAoC,CAACC,MAA2D;AAC3G,QAAMC,IAAOC,EAAuBF,GAAgBG,EAAgB,KAAK,GAEnE,EAAE,aAAAC,
|
|
1
|
+
{"version":3,"file":"validate-growi-plugin-directive.js","sources":["../../../../../src/v4/server/utils/theme/validate-growi-plugin-directive.ts"],"sourcesContent":["import type { GrowiThemeMetadata } from '@growi/core';\nimport { GrowiPluginType, isGrowiThemeMetadata } from '@growi/core';\n\nimport type { GrowiPluginValidationData, GrowiThemePluginValidationData } from '../../../../model';\nimport { GrowiPluginValidationError } from '../../../../model';\nimport { validateGrowiDirective } from '../common';\n\n\n/**\n * An utility for theme plugin which wrap 'validateGrowiDirective' of './common' module\n * @param projectDirRoot\n */\nexport const validateThemePluginGrowiDirective = (projectDirRoot: string): GrowiThemePluginValidationData => {\n const data = validateGrowiDirective(projectDirRoot, GrowiPluginType.Theme);\n\n const { growiPlugin } = data;\n\n // check themes\n if (growiPlugin.themes == null || !Array.isArray(growiPlugin.themes) || growiPlugin.themes.length === 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n \"Theme plugin must have 'themes' array and that must have one or more theme metadata\",\n );\n }\n\n const validMetadatas: GrowiThemeMetadata[] = [];\n const invalidObjects: unknown[] = [];\n growiPlugin.themes.forEach((theme: unknown) => {\n if (isGrowiThemeMetadata(theme)) {\n validMetadatas.push(theme);\n }\n else {\n invalidObjects.push(theme);\n }\n });\n\n if (invalidObjects.length > 0) {\n throw new GrowiPluginValidationError<GrowiPluginValidationData>(\n `Some of theme metadata are invalid: ${invalidObjects.toString()}`,\n );\n }\n\n return {\n ...data,\n themes: validMetadatas,\n };\n};\n"],"names":["validateThemePluginGrowiDirective","projectDirRoot","data","validateGrowiDirective","GrowiPluginType","growiPlugin","GrowiPluginValidationError","validMetadatas","invalidObjects","theme","isGrowiThemeMetadata"],"mappings":";;;AAYa,MAAAA,IAAoC,CAACC,MAA2D;AAC3G,QAAMC,IAAOC,EAAuBF,GAAgBG,EAAgB,KAAK,GAEnE,EAAE,aAAAC,MAAgBH;AAGxB,MAAIG,EAAY,UAAU,QAAQ,CAAC,MAAM,QAAQA,EAAY,MAAM,KAAKA,EAAY,OAAO,WAAW;AACpG,UAAM,IAAIC;AAAA,MACR;AAAA,IACF;AAGF,QAAMC,IAAuC,CAAC,GACxCC,IAA4B,CAAC;AAU/B,MATQH,EAAA,OAAO,QAAQ,CAACI,MAAmB;AACzC,IAAAC,EAAqBD,CAAK,IAC5BF,EAAe,KAAKE,CAAK,IAGzBD,EAAe,KAAKC,CAAK;AAAA,EAC3B,CACD,GAEGD,EAAe,SAAS;AAC1B,UAAM,IAAIF;AAAA,MACR,uCAAuCE,EAAe,UAAU;AAAA,IAClE;AAGK,SAAA;AAAA,IACL,GAAGN;AAAA,IACH,QAAQK;AAAA,EACV;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@growi/pluginkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-next.d1faecac6ad3d0a42733cf62fa2f066a876e8d2e",
|
|
4
4
|
"description": "Plugin kit for GROWI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -10,19 +10,21 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@growi/core": "^1.5.0",
|
|
15
|
+
"extensible-custom-error": "^0.0.7"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "^18.2.14"
|
|
19
|
+
},
|
|
13
20
|
"scripts": {
|
|
14
21
|
"build": "vite build",
|
|
15
22
|
"clean": "shx rm -rf dist",
|
|
16
23
|
"dev": "vite build --mode dev",
|
|
17
|
-
"watch": "
|
|
18
|
-
"lint:js": "
|
|
19
|
-
"lint:typecheck": "tsc",
|
|
24
|
+
"watch": "pnpm run dev -w --emptyOutDir=false",
|
|
25
|
+
"lint:js": "eslint **/*.{js,ts}",
|
|
26
|
+
"lint:typecheck": "vue-tsc --noEmit",
|
|
20
27
|
"lint": "npm-run-all -p lint:*",
|
|
21
28
|
"test": "vitest run --coverage"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
"@growi/core": "^1.0.0",
|
|
25
|
-
"extensible-custom-error": "^0.0.7"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {}
|
|
28
|
-
}
|
|
29
|
+
}
|
|
30
|
+
}
|