cloudcommerce 0.0.16 → 0.0.19
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/CHANGELOG.md +11 -0
- package/package.json +3 -4
- package/packages/api/package.json +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/cli/bin/run.mjs +2 -24
- package/packages/cli/config/firebase.json +47 -0
- package/packages/cli/config/firestore.indexes.json +4 -0
- package/packages/cli/config/firestore.rules +8 -0
- package/packages/cli/config/remoteconfig.template.json +1 -0
- package/packages/cli/config/storage.rules +15 -0
- package/packages/cli/lib/index.js +31 -0
- package/packages/cli/package.json +5 -1
- package/packages/cli/src/index.ts +33 -0
- package/packages/cli/tsconfig.json +6 -0
- package/packages/firebase/package.json +1 -1
- package/packages/storefront/package.json +1 -1
- package/pnpm-lock.yaml +2 -2
- package/packages/api/scripts/build.sh +0 -6
- package/packages/cli/src/index.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.19](https://github.com/ecomplus/cloud-commerce/compare/v0.0.18...v0.0.19) (2022-06-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **cli:** Copy Firebase config files before running command ([210d9d5](https://github.com/ecomplus/cloud-commerce/commit/210d9d52c1e1fb1b61d5716382e325b96aaf5f67))
|
|
11
|
+
|
|
12
|
+
### [0.0.18](https://github.com/ecomplus/cloud-commerce/compare/v0.0.17...v0.0.18) (2022-06-29)
|
|
13
|
+
|
|
14
|
+
### [0.0.17](https://github.com/ecomplus/cloud-commerce/compare/v0.0.16...v0.0.17) (2022-06-29)
|
|
15
|
+
|
|
5
16
|
### [0.0.16](https://github.com/ecomplus/cloud-commerce/compare/v0.0.14...v0.0.16) (2022-06-29)
|
|
6
17
|
|
|
7
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.19",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"standard-version": {
|
|
14
14
|
"scripts": {
|
|
15
|
-
"precommit": "
|
|
16
|
-
"posttag": "zx scripts/release.mjs --publish"
|
|
15
|
+
"precommit": "bash scripts/on-version.sh"
|
|
17
16
|
}
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
@@ -42,6 +41,6 @@
|
|
|
42
41
|
"new-pkg": "bash scripts/new-package.sh",
|
|
43
42
|
"build": "turbo run build",
|
|
44
43
|
"test": "turbo run test",
|
|
45
|
-
"release": "
|
|
44
|
+
"release": "bash scripts/version-and-release.sh"
|
|
46
45
|
}
|
|
47
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.19",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce APIs client/adapter",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/api#readme",
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "sh scripts/build.sh",
|
|
20
|
+
"build": "sh ../../scripts/build-lib.sh && cp -r src/types lib/",
|
|
21
21
|
"test": "tsc -p ../../tsconfig.test.json && vitest run"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/packages/cli/bin/run.mjs
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import run from '../lib/index.js';
|
|
3
3
|
|
|
4
|
-
(
|
|
5
|
-
const options = Object.keys(argv).reduce((opts, key) => {
|
|
6
|
-
if (key !== '_') {
|
|
7
|
-
// eslint-disable-next-line no-param-reassign
|
|
8
|
-
opts += `--${key} ${argv[key]}\n`;
|
|
9
|
-
}
|
|
10
|
-
return opts;
|
|
11
|
-
}, '');
|
|
12
|
-
const $firebase = async (cmd) => $`npx firebase-tools ${cmd} ${options}`;
|
|
13
|
-
if (argv._.includes('serve')) {
|
|
14
|
-
return $firebase('emulators:start');
|
|
15
|
-
}
|
|
16
|
-
if (argv._.find((cmd) => /^(\w+:)?(shell|start)$/.test(cmd))) {
|
|
17
|
-
return $firebase('functions:shell');
|
|
18
|
-
}
|
|
19
|
-
if (argv._.find((cmd) => /^(\w+:)?logs?$/.test(cmd))) {
|
|
20
|
-
return $firebase('functions:log');
|
|
21
|
-
}
|
|
22
|
-
if (argv._.includes('deploy')) {
|
|
23
|
-
return $firebase('deploy');
|
|
24
|
-
}
|
|
25
|
-
return $`echo 'Hello from @cloudcommerce/cli'`;
|
|
26
|
-
})();
|
|
4
|
+
run();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"firestore": {
|
|
3
|
+
"rules": "firestore.rules",
|
|
4
|
+
"indexes": "firestore.indexes.json"
|
|
5
|
+
},
|
|
6
|
+
"functions": {
|
|
7
|
+
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build",
|
|
8
|
+
"source": "functions"
|
|
9
|
+
},
|
|
10
|
+
"hosting": {
|
|
11
|
+
"public": "public",
|
|
12
|
+
"ignore": [
|
|
13
|
+
"firebase.json",
|
|
14
|
+
"**/.*",
|
|
15
|
+
"**/node_modules/**"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"storage": {
|
|
19
|
+
"rules": "storage.rules"
|
|
20
|
+
},
|
|
21
|
+
"emulators": {
|
|
22
|
+
"auth": {
|
|
23
|
+
"port": 9099
|
|
24
|
+
},
|
|
25
|
+
"functions": {
|
|
26
|
+
"port": 5001
|
|
27
|
+
},
|
|
28
|
+
"firestore": {
|
|
29
|
+
"port": 8080
|
|
30
|
+
},
|
|
31
|
+
"hosting": {
|
|
32
|
+
"port": 5000
|
|
33
|
+
},
|
|
34
|
+
"pubsub": {
|
|
35
|
+
"port": 8085
|
|
36
|
+
},
|
|
37
|
+
"storage": {
|
|
38
|
+
"port": 9199
|
|
39
|
+
},
|
|
40
|
+
"ui": {
|
|
41
|
+
"enabled": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"remoteconfig": {
|
|
45
|
+
"template": "remoteconfig.template.json"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
rules_version = '2';
|
|
2
|
+
service firebase.storage {
|
|
3
|
+
match /b/{bucket}/o {
|
|
4
|
+
match /public/{allPaths=**} {
|
|
5
|
+
allow read;
|
|
6
|
+
allow write: if false;
|
|
7
|
+
}
|
|
8
|
+
match /usr/{userId}/{allPaths=**} {
|
|
9
|
+
allow read, write: if request.auth != null && request.auth.uid == userId;
|
|
10
|
+
}
|
|
11
|
+
match /{allPaths=**} {
|
|
12
|
+
allow read, write: if false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import url from 'url';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { $, argv, fs } from 'zx';
|
|
4
|
+
|
|
5
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
6
|
+
const pwd = process.cwd();
|
|
7
|
+
|
|
8
|
+
export default async () => {
|
|
9
|
+
fs.copySync(path.join(__dirname, '..', 'config'), pwd);
|
|
10
|
+
const options = Object.keys(argv).reduce((opts, key) => {
|
|
11
|
+
if (key !== '_') {
|
|
12
|
+
// eslint-disable-next-line no-param-reassign
|
|
13
|
+
opts += ` --${key} ${argv[key]}`;
|
|
14
|
+
}
|
|
15
|
+
return opts;
|
|
16
|
+
}, '');
|
|
17
|
+
const $firebase = async (cmd) => $`npx firebase-tools ${cmd}${options}`;
|
|
18
|
+
if (argv._.includes('serve')) {
|
|
19
|
+
return $firebase('emulators:start');
|
|
20
|
+
}
|
|
21
|
+
if (argv._.find((cmd) => /^(\w+:)?(shell|start)$/.test(cmd))) {
|
|
22
|
+
return $firebase('functions:shell');
|
|
23
|
+
}
|
|
24
|
+
if (argv._.find((cmd) => /^(\w+:)?logs?$/.test(cmd))) {
|
|
25
|
+
return $firebase('functions:log');
|
|
26
|
+
}
|
|
27
|
+
if (argv._.includes('deploy')) {
|
|
28
|
+
return $firebase('deploy');
|
|
29
|
+
}
|
|
30
|
+
return $`echo 'Hello from @cloudcommerce/cli'`;
|
|
31
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.19",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce CLI tools",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cloudcommerce": "./bin/run.mjs"
|
|
8
8
|
},
|
|
9
|
+
"main": "lib/index.js",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "git+https://github.com/ecomplus/cloud-commerce.git",
|
|
@@ -17,6 +18,9 @@
|
|
|
17
18
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
18
19
|
},
|
|
19
20
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/cli#readme",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "sh ../../scripts/build-lib.sh"
|
|
23
|
+
},
|
|
20
24
|
"dependencies": {
|
|
21
25
|
"zx": "^7.0.3"
|
|
22
26
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import url from 'url';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { $, argv, fs } from 'zx';
|
|
4
|
+
|
|
5
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
6
|
+
const pwd = process.cwd();
|
|
7
|
+
|
|
8
|
+
export default async () => {
|
|
9
|
+
fs.copySync(path.join(__dirname, '..', 'config'), pwd);
|
|
10
|
+
|
|
11
|
+
const options = Object.keys(argv).reduce((opts, key) => {
|
|
12
|
+
if (key !== '_') {
|
|
13
|
+
// eslint-disable-next-line no-param-reassign
|
|
14
|
+
opts += ` --${key} ${argv[key]}`;
|
|
15
|
+
}
|
|
16
|
+
return opts;
|
|
17
|
+
}, '');
|
|
18
|
+
const $firebase = async (cmd: string) => $`npx firebase-tools ${cmd}${options}`;
|
|
19
|
+
|
|
20
|
+
if (argv._.includes('serve')) {
|
|
21
|
+
return $firebase('emulators:start');
|
|
22
|
+
}
|
|
23
|
+
if (argv._.find((cmd) => /^(\w+:)?(shell|start)$/.test(cmd))) {
|
|
24
|
+
return $firebase('functions:shell');
|
|
25
|
+
}
|
|
26
|
+
if (argv._.find((cmd) => /^(\w+:)?logs?$/.test(cmd))) {
|
|
27
|
+
return $firebase('functions:log');
|
|
28
|
+
}
|
|
29
|
+
if (argv._.includes('deploy')) {
|
|
30
|
+
return $firebase('deploy');
|
|
31
|
+
}
|
|
32
|
+
return $`echo 'Hello from @cloudcommerce/cli'`;
|
|
33
|
+
};
|
package/pnpm-lock.yaml
CHANGED
|
@@ -88,13 +88,13 @@ importers:
|
|
|
88
88
|
|
|
89
89
|
store:
|
|
90
90
|
specifiers:
|
|
91
|
-
'@cloudcommerce/cli': ^0.0.
|
|
91
|
+
'@cloudcommerce/cli': ^0.0.18
|
|
92
92
|
dependencies:
|
|
93
93
|
'@cloudcommerce/cli': link:../packages/cli
|
|
94
94
|
|
|
95
95
|
store/functions:
|
|
96
96
|
specifiers:
|
|
97
|
-
'@cloudcommerce/firebase': ^0.0.
|
|
97
|
+
'@cloudcommerce/firebase': ^0.0.18
|
|
98
98
|
dependencies:
|
|
99
99
|
'@cloudcommerce/firebase': link:../../packages/firebase
|
|
100
100
|
|
|
File without changes
|