chore(plugin): Update project

This commit is contained in:
robin
2023-09-25 10:39:59 +08:00
parent a94ea23d53
commit 82ad68d538
3 changed files with 2038 additions and 3459 deletions
-2
View File
@@ -15,8 +15,6 @@
"clean": "rm -rf node_modules && rm -rf src/plugins/**/node_modules"
},
"dependencies": {
"answer-chart": "workspace:^",
"answer-formula": "workspace:^",
"axios": "^0.27.2",
"bootstrap": "^5.3.0",
"bootstrap-icons": "^1.10.5",
+2027 -3457
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -43,6 +43,7 @@ pluginFolders.forEach((folder) => {
const slugName = tsFile.match(/slug_name: '(.*)'/)[1];
const pluginName = humps.pascalize(slugName) + 'Plugin';
const packageJson = require(path.join(pluginFolder, 'package.json'));
const author = packageJson.author;
const version = packageJson.version;
const content = template
@@ -51,5 +52,15 @@ pluginFolders.forEach((folder) => {
.replace(/{{author}}/g, author)
.replace(/{{version}}/g, version);
fs.writeFileSync(path.join(pluginFolder, `${slugName}.go`), content);
const packageName = packageJson.name;
// update package.json dependencies
const packageJsonPath = path.join(__dirname, 'package.json');
const packageJsonContent = require(packageJsonPath);
packageJsonContent.dependencies[packageName] = 'workspace:*';
fs.writeFileSync(
packageJsonPath,
JSON.stringify(packageJsonContent, null, 2),
);
}
});