@embeddable.com/sdk-core 3.14.0-next.7 → 3.14.1-next.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/lib/index.esm.js +22 -6
- package/lib/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/push.test.ts +3 -3
- package/src/push.ts +29 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embeddable.com/sdk-core",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.1-next.0",
|
|
4
4
|
"description": "Core Embeddable SDK module responsible for web-components bundling and publishing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"embeddable",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@embeddable.com/sdk-utils": "0.8.0
|
|
43
|
+
"@embeddable.com/sdk-utils": "0.8.0",
|
|
44
44
|
"@inquirer/prompts": "^7.2.1",
|
|
45
45
|
"@stencil/core": "^4.23.0",
|
|
46
46
|
"@swc-node/register": "^1.10.9",
|
package/src/push.test.ts
CHANGED
|
@@ -249,7 +249,7 @@ describe("push", () => {
|
|
|
249
249
|
// Should include component build directory
|
|
250
250
|
expect(mockArchiver.directory).toHaveBeenCalled();
|
|
251
251
|
// Should not include model files (except global.css which is part of components)
|
|
252
|
-
expect(mockArchiver.file).toHaveBeenCalledTimes(
|
|
252
|
+
expect(mockArchiver.file).toHaveBeenCalledTimes(2);
|
|
253
253
|
expect(mockArchiver.file).toHaveBeenCalledWith(expect.anything(), {
|
|
254
254
|
name: "global.css",
|
|
255
255
|
});
|
|
@@ -506,8 +506,8 @@ describe("push", () => {
|
|
|
506
506
|
name: "global.css",
|
|
507
507
|
},
|
|
508
508
|
);
|
|
509
|
-
// Should
|
|
510
|
-
expect(findFiles).
|
|
509
|
+
// Should only find client context files
|
|
510
|
+
expect(findFiles).toHaveBeenCalledOnce();
|
|
511
511
|
});
|
|
512
512
|
|
|
513
513
|
it("should search in custom directories for model files", async () => {
|
package/src/push.ts
CHANGED
|
@@ -43,8 +43,21 @@ export default async () => {
|
|
|
43
43
|
if (process.argv.includes("--api-key") || process.argv.includes("-k")) {
|
|
44
44
|
spinnerPushing = ora("Using API key...").start();
|
|
45
45
|
breadcrumbs.push("push by api key");
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
try {
|
|
47
|
+
await pushByApiKey(config, spinnerPushing);
|
|
48
|
+
} catch (error: any) {
|
|
49
|
+
if (error.response?.data?.errorCode === "BUILDER-998") {
|
|
50
|
+
spinnerPushing.fail(
|
|
51
|
+
`Authentication failure. Server responded with: "${error.response?.data?.errorMessage}". Ensure that your API key is valid for the region specified in the embeddable.config.ts|js file.
|
|
52
|
+
You are trying to push to the following app url: ${config.previewBaseUrl}
|
|
53
|
+
Read more about deployment regions at https://docs.embeddable.com/deployment/deployment-regions`,
|
|
54
|
+
);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
spinnerPushing.fail("Publishing failed");
|
|
58
|
+
console.log(error.response?.data || error);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
48
61
|
publishedSectionFeedback(config, spinnerPushing);
|
|
49
62
|
spinnerPushing.succeed("Published using API key");
|
|
50
63
|
|
|
@@ -164,10 +177,7 @@ export async function buildArchive(config: ResolvedEmbeddableConfig) {
|
|
|
164
177
|
config.client.modelsSrc || config.client.srcDir,
|
|
165
178
|
CUBE_FILES,
|
|
166
179
|
);
|
|
167
|
-
|
|
168
|
-
config.client.presetsSrc || config.client.srcDir,
|
|
169
|
-
CLIENT_CONTEXT_FILES,
|
|
170
|
-
);
|
|
180
|
+
|
|
171
181
|
const securityContextFilesList = await findFiles(
|
|
172
182
|
config.client.presetsSrc || config.client.srcDir,
|
|
173
183
|
SECURITY_CONTEXT_FILES,
|
|
@@ -178,11 +188,22 @@ export async function buildArchive(config: ResolvedEmbeddableConfig) {
|
|
|
178
188
|
path.basename(entry[1]),
|
|
179
189
|
entry[1],
|
|
180
190
|
]),
|
|
181
|
-
|
|
191
|
+
|
|
192
|
+
...securityContextFilesList.map((entry): [string, string] => [
|
|
182
193
|
path.basename(entry[1]),
|
|
183
194
|
entry[1],
|
|
184
195
|
]),
|
|
185
|
-
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (config.pushComponents) {
|
|
200
|
+
const clientContextFilesList = await findFiles(
|
|
201
|
+
config.client.presetsSrc || config.client.srcDir,
|
|
202
|
+
CLIENT_CONTEXT_FILES,
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
filesList.push(
|
|
206
|
+
...clientContextFilesList.map((entry): [string, string] => [
|
|
186
207
|
path.basename(entry[1]),
|
|
187
208
|
entry[1],
|
|
188
209
|
]),
|