@initx-plugin/core 0.0.14 → 0.0.15

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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -4
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
+ import fs from 'fs-extra';
2
3
  import { c } from '@initx-plugin/utils';
3
- import { readdirSync, existsSync, readFileSync } from 'fs-extra';
4
4
 
5
5
  class InitxHandler {
6
6
  run(options, ...others) {
@@ -81,9 +81,9 @@ class InitxHandler {
81
81
  async function loadPlugins() {
82
82
  const { stdout: npmPath } = await c("npm", ["config", "get", "prefix"]);
83
83
  const nodeModules = path.join(npmPath, "node_modules");
84
- const communityPlugins = readdirSync(nodeModules);
84
+ const communityPlugins = fs.readdirSync(nodeModules);
85
85
  const officialPluginPath = path.join(nodeModules, "@initx-plugin");
86
- const officialPlugins = existsSync(officialPluginPath) ? readdirSync(officialPluginPath).map((name) => `@initx-plugin/${name}`) : [];
86
+ const officialPlugins = fs.existsSync(officialPluginPath) ? fs.readdirSync(officialPluginPath).map((name) => `@initx-plugin/${name}`) : [];
87
87
  const pluginsName = [
88
88
  ...officialPlugins,
89
89
  ...communityPlugins
@@ -92,7 +92,7 @@ async function loadPlugins() {
92
92
  );
93
93
  return Promise.all(pluginsName.map(async (dirname) => {
94
94
  const InitxHandlerClass = await import('importx').then((x) => x.import(path.join(nodeModules, dirname), import.meta.url)).then((x) => x.default);
95
- const packageAll = JSON.parse(readFileSync(path.join(nodeModules, dirname, "package.json"), "utf-8"));
95
+ const packageAll = JSON.parse(fs.readFileSync(path.join(nodeModules, dirname, "package.json"), "utf-8"));
96
96
  const packageInfo = {
97
97
  name: packageAll.name,
98
98
  version: packageAll.version,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@initx-plugin/core",
3
3
  "type": "module",
4
- "version": "0.0.14",
4
+ "version": "0.0.15",
5
5
  "description": "core module for initx plugins",
6
6
  "author": "imba97",
7
7
  "license": "MIT",