@mexty/cli 1.0.1 ā 1.1.0
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/README.md +5 -5
- package/package.json +4 -2
- package/src/commands/create.ts +109 -41
- package/src/commands/save.ts +213 -0
- package/src/commands/sync.ts +2 -2
- package/src/index.ts +98 -84
- package/src/utils/api.ts +241 -239
- package/src/utils/git.ts +28 -26
- package/dist/commands/create.d.ts +0 -7
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -80
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/delete.d.ts +0 -2
- package/dist/commands/delete.d.ts.map +0 -1
- package/dist/commands/delete.js +0 -54
- package/dist/commands/delete.js.map +0 -1
- package/dist/commands/fork.d.ts +0 -2
- package/dist/commands/fork.d.ts.map +0 -1
- package/dist/commands/fork.js +0 -52
- package/dist/commands/fork.js.map +0 -1
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -12
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/publish.d.ts +0 -2
- package/dist/commands/publish.d.ts.map +0 -1
- package/dist/commands/publish.js +0 -139
- package/dist/commands/publish.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -2
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -140
- package/dist/commands/sync.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -60
- package/dist/index.js.map +0 -1
- package/dist/utils/api.d.ts +0 -55
- package/dist/utils/api.d.ts.map +0 -1
- package/dist/utils/api.js +0 -68
- package/dist/utils/api.js.map +0 -1
- package/dist/utils/git.d.ts +0 -41
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js +0 -171
- package/dist/utils/git.js.map +0 -1
package/README.md
CHANGED
@@ -30,7 +30,7 @@ npm install -g mexty
|
|
30
30
|
|
31
31
|
- Node.js 16+ installed
|
32
32
|
- Git installed and configured
|
33
|
-
- MEXT server running (default:
|
33
|
+
- MEXT server running (default: https://api.v2.mext.app)
|
34
34
|
- GitHub access for repository operations
|
35
35
|
|
36
36
|
## Commands
|
@@ -193,7 +193,7 @@ After publishing or syncing, you can use components with full type safety:
|
|
193
193
|
|
194
194
|
```tsx
|
195
195
|
// Full TypeScript support with IntelliSense
|
196
|
-
import { MyAmazingBlock } from '
|
196
|
+
import { MyAmazingBlock } from '@mexty/block';
|
197
197
|
|
198
198
|
// Props are fully typed - you get autocompletion and error checking
|
199
199
|
<MyAmazingBlock
|
@@ -252,7 +252,7 @@ mexty publish # Automatically parses props and syncs registry locally
|
|
252
252
|
mexty sync
|
253
253
|
|
254
254
|
# Then use in your React app with full TypeScript support
|
255
|
-
import { TeamComponent } from '
|
255
|
+
import { TeamComponent } from '@mexty/block';
|
256
256
|
|
257
257
|
<TeamComponent
|
258
258
|
props={{
|
@@ -307,7 +307,7 @@ Gets converted to JSON schema automatically for runtime validation and type gene
|
|
307
307
|
For advanced use cases, you can create strongly typed components:
|
308
308
|
|
309
309
|
```tsx
|
310
|
-
import { createTypedBlock } from '
|
310
|
+
import { createTypedBlock } from '@mexty/block';
|
311
311
|
|
312
312
|
interface GameProps {
|
313
313
|
level: number;
|
@@ -333,7 +333,7 @@ const TypedGame = createTypedBlock<GameProps>('VirtualGame', {
|
|
333
333
|
|
334
334
|
The CLI uses the following default settings:
|
335
335
|
|
336
|
-
- **Server URL**:
|
336
|
+
- **Server URL**: https://api.v2.mext.app
|
337
337
|
- **Timeout**: 30 seconds for API requests
|
338
338
|
- **Props Parsing**: Automatic on publish/push
|
339
339
|
- **Type Generation**: Automatic on sync
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mexty/cli",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.1.0",
|
4
4
|
"description": "MEXT CLI for managing blocks and repositories",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"bin": {
|
@@ -12,9 +12,11 @@
|
|
12
12
|
"start": "node dist/index.js"
|
13
13
|
},
|
14
14
|
"dependencies": {
|
15
|
-
"
|
15
|
+
"@types/inquirer": "^9.0.8",
|
16
16
|
"axios": "^1.6.0",
|
17
17
|
"chalk": "^4.1.2",
|
18
|
+
"commander": "^11.1.0",
|
19
|
+
"inquirer": "^12.6.3",
|
18
20
|
"simple-git": "^3.20.0"
|
19
21
|
},
|
20
22
|
"devDependencies": {
|
package/src/commands/create.ts
CHANGED
@@ -1,97 +1,165 @@
|
|
1
|
-
import chalk from
|
2
|
-
import path from
|
3
|
-
import { apiClient, CreateBlockRequest } from
|
4
|
-
import { GitManager } from
|
5
|
-
import { createInterface } from
|
6
|
-
import { requireAuthentication, getAuthenticatedUser } from
|
1
|
+
import chalk from "chalk";
|
2
|
+
import path from "path";
|
3
|
+
import { apiClient, CreateBlockRequest } from "../utils/api";
|
4
|
+
import { GitManager } from "../utils/git";
|
5
|
+
import { createInterface } from "readline";
|
6
|
+
import { requireAuthentication, getAuthenticatedUser } from "../utils/auth";
|
7
7
|
|
8
8
|
interface CreateOptions {
|
9
9
|
description?: string;
|
10
10
|
type?: string;
|
11
|
+
name?: string;
|
12
|
+
category?: string;
|
11
13
|
}
|
12
14
|
|
13
15
|
// Simple prompt function to replace inquirer
|
14
|
-
async function prompt(
|
16
|
+
async function prompt(
|
17
|
+
question: string,
|
18
|
+
defaultValue?: string
|
19
|
+
): Promise<string> {
|
15
20
|
return new Promise((resolve) => {
|
16
21
|
const rl = createInterface({
|
17
22
|
input: process.stdin,
|
18
|
-
output: process.stdout
|
23
|
+
output: process.stdout,
|
19
24
|
});
|
20
25
|
|
21
|
-
const promptText = defaultValue
|
22
|
-
|
26
|
+
const promptText = defaultValue
|
27
|
+
? `${question} (${defaultValue}): `
|
28
|
+
: `${question}: `;
|
29
|
+
|
23
30
|
rl.question(promptText, (answer) => {
|
24
31
|
rl.close();
|
25
|
-
resolve(answer.trim() || defaultValue ||
|
32
|
+
resolve(answer.trim() || defaultValue || "");
|
26
33
|
});
|
27
34
|
});
|
28
35
|
}
|
29
36
|
|
30
|
-
export async function createCommand(
|
37
|
+
export async function createCommand(
|
38
|
+
subcommand?: string,
|
39
|
+
options: CreateOptions = {}
|
40
|
+
): Promise<void> {
|
31
41
|
try {
|
32
42
|
// Check authentication first
|
33
43
|
requireAuthentication();
|
34
|
-
|
44
|
+
|
35
45
|
const user = getAuthenticatedUser();
|
36
|
-
console.log(chalk.blue(`š Creating new block: ${name}`));
|
37
|
-
console.log(chalk.gray(` User: ${user?.fullName || user?.email || 'Unknown'}`));
|
38
46
|
|
39
|
-
//
|
40
|
-
let
|
41
|
-
|
42
|
-
|
47
|
+
// Handle both old and new syntax
|
48
|
+
let blockName: string;
|
49
|
+
let blockDescription: string;
|
50
|
+
let blockType: string;
|
51
|
+
|
52
|
+
if (subcommand === "block") {
|
53
|
+
// New syntax: mexty create block --name "..." --description "..." --category "..."
|
54
|
+
if (!options.name) {
|
55
|
+
console.error(
|
56
|
+
chalk.red('ā --name is required when using "mexty create block"')
|
57
|
+
);
|
58
|
+
console.log(
|
59
|
+
chalk.yellow(
|
60
|
+
' Usage: mexty create block --name "Block Name" --description "Description" --category "category"'
|
61
|
+
)
|
62
|
+
);
|
63
|
+
process.exit(1);
|
64
|
+
}
|
65
|
+
|
66
|
+
blockName = options.name;
|
67
|
+
blockDescription = options.description || `Custom block: ${blockName}`;
|
68
|
+
blockType = options.category || options.type || "custom";
|
69
|
+
} else {
|
70
|
+
// Old syntax: mexty create "Block Name" --description "..." --type "..."
|
71
|
+
if (!subcommand) {
|
72
|
+
console.error(chalk.red("ā Block name is required"));
|
73
|
+
console.log(
|
74
|
+
chalk.yellow(' Usage: mexty create "Block Name" [options]')
|
75
|
+
);
|
76
|
+
console.log(
|
77
|
+
chalk.yellow(
|
78
|
+
' Or: mexty create block --name "Block Name" [options]'
|
79
|
+
)
|
80
|
+
);
|
81
|
+
process.exit(1);
|
82
|
+
}
|
83
|
+
|
84
|
+
blockName = subcommand;
|
85
|
+
blockDescription = options.description || `Custom block: ${blockName}`;
|
86
|
+
blockType = options.type || "custom";
|
43
87
|
}
|
44
88
|
|
89
|
+
console.log(chalk.blue(`š Creating new block: ${blockName}`));
|
90
|
+
console.log(
|
91
|
+
chalk.gray(` User: ${user?.fullName || user?.email || "Unknown"}`)
|
92
|
+
);
|
93
|
+
console.log(chalk.gray(` Category: ${blockType}`));
|
94
|
+
|
45
95
|
// Prepare block data
|
46
96
|
const blockData: CreateBlockRequest = {
|
47
|
-
blockType:
|
48
|
-
title:
|
49
|
-
description:
|
50
|
-
allowedBrickTypes: [
|
51
|
-
scope: [
|
52
|
-
content: []
|
97
|
+
blockType: blockType,
|
98
|
+
title: blockName,
|
99
|
+
description: blockDescription,
|
100
|
+
allowedBrickTypes: ["text", "image", "video", "code", "quiz"], // Default allowed types
|
101
|
+
scope: ["user-store"], // Default scope for CLI-created blocks
|
102
|
+
content: [],
|
53
103
|
};
|
54
104
|
|
55
|
-
console.log(chalk.yellow(
|
56
|
-
|
105
|
+
console.log(chalk.yellow("š” Creating block on server..."));
|
106
|
+
|
57
107
|
// Create the block
|
58
108
|
const block = await apiClient.createBlock(blockData);
|
59
|
-
|
109
|
+
|
60
110
|
console.log(chalk.green(`ā
Block created successfully!`));
|
61
111
|
console.log(chalk.gray(` Block ID: ${block._id}`));
|
62
112
|
console.log(chalk.gray(` Block Type: ${block.blockType}`));
|
63
|
-
|
113
|
+
|
64
114
|
if (block.gitUrl) {
|
65
115
|
console.log(chalk.gray(` GitHub URL: ${block.gitUrl}`));
|
66
|
-
|
116
|
+
|
67
117
|
// Clone the repository
|
68
118
|
const repoName = GitManager.extractRepoName(block.gitUrl);
|
69
119
|
const targetDir = path.join(process.cwd(), repoName);
|
70
|
-
|
120
|
+
|
71
121
|
console.log(chalk.yellow(`š¦ Cloning repository to ./${repoName}...`));
|
72
|
-
|
122
|
+
|
73
123
|
try {
|
74
124
|
const gitManager = new GitManager();
|
75
125
|
await gitManager.cloneRepository(block.gitUrl, targetDir);
|
76
|
-
|
77
|
-
console.log(
|
126
|
+
|
127
|
+
console.log(
|
128
|
+
chalk.green(`š Block created and repository cloned successfully!`)
|
129
|
+
);
|
78
130
|
console.log(chalk.blue(`\nNext steps:`));
|
79
131
|
console.log(chalk.gray(` 1. cd ${repoName}`));
|
80
132
|
console.log(chalk.gray(` 2. Make your changes`));
|
81
|
-
console.log(chalk.gray(` 3.
|
82
|
-
|
83
|
-
|
133
|
+
console.log(chalk.gray(` 3. mexty save`));
|
134
|
+
|
135
|
+
// Change to the cloned directory
|
136
|
+
try {
|
137
|
+
process.chdir(targetDir);
|
138
|
+
console.log(chalk.green(`š Changed to directory: ${repoName}`));
|
139
|
+
} catch (chdirError: any) {
|
140
|
+
console.warn(
|
141
|
+
chalk.yellow(
|
142
|
+
`ā ļø Could not change to directory: ${chdirError.message}`
|
143
|
+
)
|
144
|
+
);
|
145
|
+
console.log(chalk.gray(` Please manually run: cd ${repoName}`));
|
146
|
+
}
|
84
147
|
} catch (cloneError: any) {
|
85
|
-
console.error(
|
148
|
+
console.error(
|
149
|
+
chalk.red(`ā Failed to clone repository: ${cloneError.message}`)
|
150
|
+
);
|
86
151
|
console.log(chalk.yellow(`You can manually clone it later:`));
|
87
152
|
console.log(chalk.gray(` git clone ${block.gitUrl}`));
|
88
153
|
}
|
89
154
|
} else {
|
90
|
-
console.log(
|
155
|
+
console.log(
|
156
|
+
chalk.yellow(
|
157
|
+
"ā ļø No GitHub repository was created (GitHub not configured)"
|
158
|
+
)
|
159
|
+
);
|
91
160
|
}
|
92
|
-
|
93
161
|
} catch (error: any) {
|
94
162
|
console.error(chalk.red(`ā Failed to create block: ${error.message}`));
|
95
163
|
process.exit(1);
|
96
164
|
}
|
97
|
-
}
|
165
|
+
}
|
@@ -0,0 +1,213 @@
|
|
1
|
+
import chalk from "chalk";
|
2
|
+
import fs from "fs";
|
3
|
+
import path from "path";
|
4
|
+
import { apiClient } from "../utils/api";
|
5
|
+
import { GitManager } from "../utils/git";
|
6
|
+
import { createInterface } from "readline";
|
7
|
+
import { requireAuthentication, getAuthenticatedUser } from "../utils/auth";
|
8
|
+
|
9
|
+
// Simple prompt function
|
10
|
+
async function prompt(
|
11
|
+
question: string,
|
12
|
+
defaultValue?: string
|
13
|
+
): Promise<string> {
|
14
|
+
return new Promise((resolve) => {
|
15
|
+
const rl = createInterface({
|
16
|
+
input: process.stdin,
|
17
|
+
output: process.stdout,
|
18
|
+
});
|
19
|
+
|
20
|
+
const promptText = defaultValue
|
21
|
+
? `${question} (${defaultValue}): `
|
22
|
+
: `${question}: `;
|
23
|
+
|
24
|
+
rl.question(promptText, (answer) => {
|
25
|
+
rl.close();
|
26
|
+
resolve(answer.trim() || defaultValue || "");
|
27
|
+
});
|
28
|
+
});
|
29
|
+
}
|
30
|
+
|
31
|
+
// Extract block ID from package.json or git URL
|
32
|
+
async function findBlockId(): Promise<string | null> {
|
33
|
+
const packageJsonPath = path.join(process.cwd(), "package.json");
|
34
|
+
|
35
|
+
if (fs.existsSync(packageJsonPath)) {
|
36
|
+
try {
|
37
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
38
|
+
|
39
|
+
// Look for block ID in package.json name or description
|
40
|
+
if (packageJson.name && packageJson.name.startsWith("block-")) {
|
41
|
+
return packageJson.name.replace("block-", "");
|
42
|
+
}
|
43
|
+
|
44
|
+
// Look in description for block ID pattern
|
45
|
+
if (packageJson.description) {
|
46
|
+
const match = packageJson.description.match(
|
47
|
+
/block[:\s]+([a-f0-9]{24})/i
|
48
|
+
);
|
49
|
+
if (match) {
|
50
|
+
return match[1];
|
51
|
+
}
|
52
|
+
}
|
53
|
+
} catch (error) {
|
54
|
+
console.warn(chalk.yellow("ā ļø Could not parse package.json"));
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
// Try to extract from git remote URL
|
59
|
+
try {
|
60
|
+
const gitManager = new GitManager();
|
61
|
+
const remoteUrl = await gitManager.getRemoteUrl();
|
62
|
+
|
63
|
+
if (remoteUrl) {
|
64
|
+
const match = remoteUrl.match(/block-([a-f0-9]{24})/);
|
65
|
+
if (match) {
|
66
|
+
return match[1];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
} catch (error) {
|
70
|
+
// Ignore git errors
|
71
|
+
}
|
72
|
+
|
73
|
+
return null;
|
74
|
+
}
|
75
|
+
|
76
|
+
export async function saveCommand(): Promise<void> {
|
77
|
+
try {
|
78
|
+
// Check authentication first
|
79
|
+
requireAuthentication();
|
80
|
+
|
81
|
+
const user = getAuthenticatedUser();
|
82
|
+
console.log(chalk.blue("š¾ Saving and publishing block..."));
|
83
|
+
console.log(
|
84
|
+
chalk.gray(` User: ${user?.fullName || user?.email || "Unknown"}`)
|
85
|
+
);
|
86
|
+
|
87
|
+
// Check if we're in a git repository
|
88
|
+
const gitManager = new GitManager();
|
89
|
+
const isGitRepo = await gitManager.isGitRepository();
|
90
|
+
|
91
|
+
if (!isGitRepo) {
|
92
|
+
console.error(
|
93
|
+
chalk.red(
|
94
|
+
"ā Not a git repository. Please run this command from a block repository."
|
95
|
+
)
|
96
|
+
);
|
97
|
+
process.exit(1);
|
98
|
+
}
|
99
|
+
|
100
|
+
// Get repository information
|
101
|
+
const repoInfo = await gitManager.getRepositoryInfo();
|
102
|
+
console.log(chalk.gray(` Current branch: ${repoInfo.branch}`));
|
103
|
+
console.log(chalk.gray(` Remote URL: ${repoInfo.remoteUrl}`));
|
104
|
+
|
105
|
+
// Find block ID
|
106
|
+
const blockId = await findBlockId();
|
107
|
+
if (!blockId) {
|
108
|
+
console.error(
|
109
|
+
chalk.red("ā Could not determine block ID from repository.")
|
110
|
+
);
|
111
|
+
console.error(
|
112
|
+
chalk.yellow(
|
113
|
+
" Make sure you are in a block repository created with mexty"
|
114
|
+
)
|
115
|
+
);
|
116
|
+
process.exit(1);
|
117
|
+
}
|
118
|
+
|
119
|
+
console.log(chalk.gray(` Block ID: ${blockId}`));
|
120
|
+
|
121
|
+
// Check if there are changes to commit
|
122
|
+
if (repoInfo.hasChanges) {
|
123
|
+
console.log(
|
124
|
+
chalk.yellow("š Found uncommitted changes, preparing to commit...")
|
125
|
+
);
|
126
|
+
|
127
|
+
// Get commit message from user
|
128
|
+
const commitMessage = await prompt(
|
129
|
+
"Enter commit message",
|
130
|
+
"Update block content"
|
131
|
+
);
|
132
|
+
|
133
|
+
if (!commitMessage.trim()) {
|
134
|
+
console.error(chalk.red("ā Commit message cannot be empty"));
|
135
|
+
process.exit(1);
|
136
|
+
}
|
137
|
+
|
138
|
+
// Stage all changes
|
139
|
+
console.log(chalk.yellow("š Staging changes (git add .)..."));
|
140
|
+
try {
|
141
|
+
await gitManager.git.add(".");
|
142
|
+
console.log(chalk.green("ā
Changes staged successfully"));
|
143
|
+
} catch (addError: any) {
|
144
|
+
console.error(
|
145
|
+
chalk.red(`ā Failed to stage changes: ${addError.message}`)
|
146
|
+
);
|
147
|
+
process.exit(1);
|
148
|
+
}
|
149
|
+
|
150
|
+
// Commit changes
|
151
|
+
console.log(chalk.yellow(`š¬ Committing changes: "${commitMessage}"...`));
|
152
|
+
try {
|
153
|
+
await gitManager.git.commit(commitMessage);
|
154
|
+
console.log(chalk.green("ā
Changes committed successfully"));
|
155
|
+
} catch (commitError: any) {
|
156
|
+
console.error(
|
157
|
+
chalk.red(`ā Failed to commit changes: ${commitError.message}`)
|
158
|
+
);
|
159
|
+
process.exit(1);
|
160
|
+
}
|
161
|
+
} else {
|
162
|
+
console.log(chalk.green("ā
No uncommitted changes found"));
|
163
|
+
}
|
164
|
+
|
165
|
+
// Push changes to remote
|
166
|
+
console.log(
|
167
|
+
chalk.yellow(`š¤ Pushing changes to remote (${repoInfo.branch})...`)
|
168
|
+
);
|
169
|
+
try {
|
170
|
+
await gitManager.pushToRemote();
|
171
|
+
console.log(chalk.green("ā
Changes pushed successfully"));
|
172
|
+
} catch (pushError: any) {
|
173
|
+
console.error(
|
174
|
+
chalk.red(`ā Failed to push changes: ${pushError.message}`)
|
175
|
+
);
|
176
|
+
console.log(
|
177
|
+
chalk.yellow(
|
178
|
+
" Please check your network connection and GitHub permissions"
|
179
|
+
)
|
180
|
+
);
|
181
|
+
process.exit(1);
|
182
|
+
}
|
183
|
+
|
184
|
+
// Trigger save and bundle
|
185
|
+
console.log(chalk.yellow("šļø Triggering build and bundle process..."));
|
186
|
+
|
187
|
+
try {
|
188
|
+
const result = await apiClient.saveAndBundle({ blockId });
|
189
|
+
|
190
|
+
console.log(chalk.green("š Block saved and published successfully!"));
|
191
|
+
console.log(chalk.gray(` Bundle Path: ${result.bundlePath}`));
|
192
|
+
console.log(chalk.gray(` Federation URL: ${result.federationUrl}`));
|
193
|
+
|
194
|
+
if (result.message) {
|
195
|
+
console.log(chalk.blue(` ${result.message}`));
|
196
|
+
}
|
197
|
+
|
198
|
+
console.log(
|
199
|
+
chalk.blue("\nš Your block is now building in the background.")
|
200
|
+
);
|
201
|
+
console.log(
|
202
|
+
chalk.gray(" You can check the build status in the web interface.")
|
203
|
+
);
|
204
|
+
} catch (buildError: any) {
|
205
|
+
console.error(chalk.red(`ā Build failed: ${buildError.message}`));
|
206
|
+
console.log(chalk.yellow(" Check the server logs for more details."));
|
207
|
+
process.exit(1);
|
208
|
+
}
|
209
|
+
} catch (error: any) {
|
210
|
+
console.error(chalk.red(`ā Failed to save block: ${error.message}`));
|
211
|
+
process.exit(1);
|
212
|
+
}
|
213
|
+
}
|
package/src/commands/sync.ts
CHANGED
@@ -30,7 +30,7 @@ export async function syncCommand(): Promise<void> {
|
|
30
30
|
|
31
31
|
// Fetch registry from server
|
32
32
|
console.log(chalk.yellow('š” Fetching registry from server...'));
|
33
|
-
const response = await fetch('
|
33
|
+
const response = await fetch('https://api.v2.mext.app/api/blocks/registry');
|
34
34
|
|
35
35
|
if (!response.ok) {
|
36
36
|
throw new Error(`Server responded with ${response.status}: ${response.statusText}`);
|
@@ -114,7 +114,7 @@ function findMextBlockPath(): string | null {
|
|
114
114
|
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
115
115
|
try {
|
116
116
|
const packageJson = JSON.parse(fs.readFileSync(path.join(possiblePath, 'package.json'), 'utf8'));
|
117
|
-
if (packageJson.name === '@mexty/block' || packageJson.name === '
|
117
|
+
if (packageJson.name === '@mexty/block' || packageJson.name === '@mexty/block') {
|
118
118
|
return possiblePath;
|
119
119
|
}
|
120
120
|
} catch (error) {
|