@cloudcommerce/cli 0.0.125 → 0.0.127
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/.turbo/turbo-build.log +1 -1
- package/bin/run.mjs +1 -1
- package/lib/build.js +14 -7
- package/lib/{index.js → cli.js} +2 -2
- package/lib/setup-gcloud.js +1 -1
- package/package.json +5 -5
- package/src/build.ts +17 -10
- package/src/{index.ts → cli.ts} +2 -2
- package/src/setup-gcloud.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
package/bin/run.mjs
CHANGED
package/lib/build.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { join as joinPath } from 'node:path';
|
|
2
2
|
import { fs } from 'zx';
|
|
3
3
|
|
|
4
4
|
const copyFunctionsConfig = async () => {
|
|
5
|
-
const functionsDir =
|
|
6
|
-
const filesToCopy = ['.env', 'config.json'];
|
|
5
|
+
const functionsDir = joinPath(process.cwd(), 'functions');
|
|
6
|
+
const filesToCopy = ['.env', 'config.json', 'ssr/content/settings.json'];
|
|
7
7
|
const dirents = await fs.readdir(functionsDir, { withFileTypes: true });
|
|
8
8
|
for (let i = 0; i < dirents.length; i++) {
|
|
9
9
|
if (dirents[i].isDirectory() && dirents[i].name.charAt(0) !== '.') {
|
|
10
|
+
const codebase = dirents[i].name;
|
|
11
|
+
const codebaseDir = joinPath(functionsDir, codebase);
|
|
12
|
+
// eslint-disable-next-line no-await-in-loop
|
|
13
|
+
await fs.ensureDir(joinPath(codebaseDir, 'content'));
|
|
10
14
|
for (let ii = 0; ii < filesToCopy.length; ii++) {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const fileToCopy = filesToCopy[ii];
|
|
16
|
+
if (codebase !== 'ssr' || !fileToCopy.includes('ssr/')) {
|
|
17
|
+
const srcPath = joinPath(functionsDir, fileToCopy);
|
|
18
|
+
if (fs.existsSync(srcPath) && srcPath) {
|
|
19
|
+
// eslint-disable-next-line no-await-in-loop
|
|
20
|
+
await fs.copy(srcPath, joinPath(codebaseDir, fileToCopy.replace('ssr/', '')));
|
|
21
|
+
}
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
24
|
}
|
package/lib/{index.js → cli.js}
RENAMED
package/lib/setup-gcloud.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.127",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce CLI tools",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cloudcommerce": "./bin/run.mjs"
|
|
8
8
|
},
|
|
9
|
-
"main": "lib/
|
|
9
|
+
"main": "lib/cli.js",
|
|
10
10
|
"exports": {
|
|
11
|
-
".": "./lib/
|
|
11
|
+
".": "./lib/cli.js",
|
|
12
12
|
"./create-auth": "./create-auth.js"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/cli#readme",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/api": "0.0.125",
|
|
27
26
|
"libsodium-wrappers": "^0.7.10",
|
|
28
27
|
"md5": "^2.3.0",
|
|
29
|
-
"zx": "^7.1.1"
|
|
28
|
+
"zx": "^7.1.1",
|
|
29
|
+
"@cloudcommerce/api": "0.0.127"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "sh ../../scripts/build-lib.sh"
|
package/src/build.ts
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { join as joinPath } from 'node:path';
|
|
2
2
|
import { fs } from 'zx';
|
|
3
3
|
|
|
4
4
|
const copyFunctionsConfig = async () => {
|
|
5
|
-
const functionsDir =
|
|
6
|
-
const filesToCopy = ['.env', 'config.json'];
|
|
5
|
+
const functionsDir = joinPath(process.cwd(), 'functions');
|
|
6
|
+
const filesToCopy = ['.env', 'config.json', 'ssr/content/settings.json'];
|
|
7
7
|
const dirents = await fs.readdir(functionsDir, { withFileTypes: true });
|
|
8
8
|
for (let i = 0; i < dirents.length; i++) {
|
|
9
9
|
if (dirents[i].isDirectory() && dirents[i].name.charAt(0) !== '.') {
|
|
10
|
+
const codebase = dirents[i].name;
|
|
11
|
+
const codebaseDir = joinPath(functionsDir, codebase);
|
|
12
|
+
// eslint-disable-next-line no-await-in-loop
|
|
13
|
+
await fs.ensureDir(joinPath(codebaseDir, 'content'));
|
|
10
14
|
for (let ii = 0; ii < filesToCopy.length; ii++) {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const fileToCopy = filesToCopy[ii];
|
|
16
|
+
if (codebase !== 'ssr' || !fileToCopy.includes('ssr/')) {
|
|
17
|
+
const srcPath = joinPath(functionsDir, fileToCopy);
|
|
18
|
+
if (fs.existsSync(srcPath) && srcPath) {
|
|
19
|
+
// eslint-disable-next-line no-await-in-loop
|
|
20
|
+
await fs.copy(
|
|
21
|
+
srcPath,
|
|
22
|
+
joinPath(codebaseDir, fileToCopy.replace('ssr/', '')),
|
|
23
|
+
);
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
27
|
}
|
package/src/{index.ts → cli.ts}
RENAMED
package/src/setup-gcloud.ts
CHANGED