@cloudcommerce/cli 0.0.18 → 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.
@@ -0,0 +1,5 @@
1
+ @cloudcommerce/cli:build: cache hit, replaying output b3c939d33e198bdb
2
+ @cloudcommerce/cli:build: 
3
+ @cloudcommerce/cli:build: > @cloudcommerce/cli@0.0.18 build /home/leo/code/ecomplus/cloud-commerce/packages/cli
4
+ @cloudcommerce/cli:build: > sh ../../scripts/build-lib.sh
5
+ @cloudcommerce/cli:build: 
package/bin/run.mjs CHANGED
@@ -1,26 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { $, argv } from 'zx';
2
+ import run from '../lib/index.js';
3
3
 
4
- (async () => {
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,4 @@
1
+ {
2
+ "indexes": [],
3
+ "fieldOverrides": []
4
+ }
@@ -0,0 +1,8 @@
1
+ rules_version = '2';
2
+ service cloud.firestore {
3
+ match /databases/{database}/documents {
4
+ match /{document=**} {
5
+ allow read, write: if false;
6
+ }
7
+ }
8
+ }
@@ -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
+ }
package/lib/index.js ADDED
@@ -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
+ };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.18",
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",
@@ -19,5 +20,8 @@
19
20
  "homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/cli#readme",
20
21
  "dependencies": {
21
22
  "zx": "^7.0.3"
23
+ },
24
+ "scripts": {
25
+ "build": "sh ../../scripts/build-lib.sh"
22
26
  }
23
27
  }
package/src/index.ts ADDED
@@ -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/tsconfig.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "sourceMap": false
5
+ }
6
+ }
package/src/index.js DELETED
File without changes