@gxp-dev/tools 2.0.50 → 2.0.51

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.
@@ -12,9 +12,23 @@ const { exportCmd } = require("../constants");
12
12
  const { findProjectRoot, resolveGxPaths } = require("../utils");
13
13
 
14
14
  /**
15
- * Get the plugin name from package.json
15
+ * Get the plugin name from app-manifest.json (preferred) or package.json
16
16
  */
17
17
  function getPluginName(projectPath) {
18
+ // Check app-manifest.json first
19
+ try {
20
+ const manifestPath = path.join(projectPath, "app-manifest.json");
21
+ if (fs.existsSync(manifestPath)) {
22
+ const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
23
+ if (manifest.name) {
24
+ return manifest.name.replace(/[^a-zA-Z0-9-_]/g, "-");
25
+ }
26
+ }
27
+ } catch (error) {
28
+ console.warn("Could not read app-manifest.json, falling back to package.json");
29
+ }
30
+
31
+ // Fall back to package.json
18
32
  try {
19
33
  const packageJsonPath = path.join(projectPath, "package.json");
20
34
  if (fs.existsSync(packageJsonPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gxp-dev/tools",
3
- "version": "2.0.50",
3
+ "version": "2.0.51",
4
4
  "description": "Dev tools to create platform plugins",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {