cloudcommerce 0.0.18 → 0.0.21

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 CHANGED
@@ -2,6 +2,23 @@
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.21](https://github.com/ecomplus/cloud-commerce/compare/v0.0.20...v0.0.21) (2022-07-09)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deps:** Update dependency firebase-admin to v11 ([#27](https://github.com/ecomplus/cloud-commerce/issues/27)) ([a258b84](https://github.com/ecomplus/cloud-commerce/commit/a258b84cb26415063b7807a42b8eb937d2ff8452))
11
+ * **gh-action:** Checks `github.event_name` instead of branch to decide live or preview ([b0affe6](https://github.com/ecomplus/cloud-commerce/commit/b0affe6069e23bc57b4b9ce5ff86992430f0f52e))
12
+
13
+ ### [0.0.20](https://github.com/ecomplus/cloud-commerce/compare/v0.0.19...v0.0.20) (2022-06-29)
14
+
15
+ ### [0.0.19](https://github.com/ecomplus/cloud-commerce/compare/v0.0.18...v0.0.19) (2022-06-29)
16
+
17
+
18
+ ### Features
19
+
20
+ * **cli:** Copy Firebase config files before running command ([210d9d5](https://github.com/ecomplus/cloud-commerce/commit/210d9d52c1e1fb1b61d5716382e325b96aaf5f67))
21
+
5
22
  ### [0.0.18](https://github.com/ecomplus/cloud-commerce/compare/v0.0.17...v0.0.18) (2022-06-29)
6
23
 
7
24
  ### [0.0.17](https://github.com/ecomplus/cloud-commerce/compare/v0.0.16...v0.0.17) (2022-06-29)
package/action.yml CHANGED
@@ -14,24 +14,20 @@ outputs: {}
14
14
  runs:
15
15
  using: "composite"
16
16
  steps:
17
- - name: Get current branch
18
- id: get-branch
19
- env:
20
- GITHUB_REF: ${{ github.ref }}
21
- run: echo "::set-output name=name::${GITHUB_REF#refs/heads/}"
22
-
23
- - if: steps.get-branch.outputs.name == main
17
+ - if: github.event_name == 'push'
24
18
  uses: actions/setup-node@v3
25
19
  with:
26
20
  node-version: 16
27
21
  cache: 'npm'
28
- # cache-dependency-path: ${{ github.action_path }}/scripts/store/package-lock.json
29
22
 
30
- - if: steps.get-branch.outputs.name == main
23
+ - if: github.event_name == 'push'
31
24
  shell: bash
32
- run: npm i -g firebase-tools
25
+ run: npm i -g firebase-tools && npm ci
26
+
27
+ - shell: bash
28
+ run: npm run build
33
29
 
34
- - if: steps.get-branch.outputs.name == main
30
+ - if: github.event_name == 'push'
35
31
  name: Deploy to Firebase live
36
32
  shell: bash
37
33
  env:
@@ -39,9 +35,9 @@ runs:
39
35
  run: |
40
36
  export GAC_FILENAME=".gac-$RANDOM.json";
41
37
  echo $FIREBASE_SERVICE_ACCOUNT > $GAC_FILENAME;
42
- GOOGLE_APPLICATION_CREDENTIALS=$GAC_FILENAME npx firebase deploy;
38
+ GOOGLE_APPLICATION_CREDENTIALS=$GAC_FILENAME npm run deploy;
43
39
 
44
- - if: steps.get-branch.outputs.name != main
40
+ - if: github.event_name == 'pull_request'
45
41
  name: Deploy Firebase Hosting PR preview
46
42
  uses: FirebaseExtended/action-hosting-deploy@v0
47
43
  with:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.21",
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>",
@@ -19,22 +19,22 @@
19
19
  "@commitlint/cli": "^17.0.3",
20
20
  "@commitlint/config-conventional": "^17.0.3",
21
21
  "@commitlint/rules": "^17.0.0",
22
- "@types/node": "^17.0.45",
23
- "@typescript-eslint/eslint-plugin": "^5.30.0",
24
- "@typescript-eslint/parser": "^5.30.0",
25
- "esbuild": "^0.14.47",
26
- "eslint": "^8.18.0",
22
+ "@types/node": "^18.0.3",
23
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
24
+ "@typescript-eslint/parser": "^5.30.5",
25
+ "esbuild": "^0.14.48",
26
+ "eslint": "^8.19.0",
27
27
  "eslint-config-airbnb-base": "^15.0.0",
28
28
  "eslint-plugin-import": "^2.26.0",
29
- "eslint-plugin-vue": "^9.1.1",
29
+ "eslint-plugin-vue": "^9.2.0",
30
30
  "husky": "^8.0.1",
31
31
  "node-fetch": "^3.2.6",
32
32
  "standard-version": "^9.5.0",
33
33
  "turbo": "^1.3.1",
34
34
  "typescript": "^4.7.4",
35
- "vite": "^2.9.13",
36
- "vitest": "^0.15.2",
37
- "zx": "^7.0.3"
35
+ "vite": "^2.9.14",
36
+ "vitest": "^0.17.1",
37
+ "zx": "^7.0.7"
38
38
  },
39
39
  "scripts": {
40
40
  "postinstall": "husky install",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.21",
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
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.21",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "functions/dist/index.js",
7
7
  "repository": {
@@ -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,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.18",
4
+ "version": "0.0.21",
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,7 +18,10 @@
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
- "zx": "^7.0.3"
25
+ "zx": "^7.0.7"
22
26
  }
23
27
  }
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "sourceMap": false
5
+ }
6
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.21",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@cloudcommerce/api": "workspace:*",
23
- "firebase-admin": "^10.3.0",
24
- "firebase-functions": "^3.21.2"
23
+ "firebase-admin": "^11.0.0",
24
+ "firebase-functions": "^3.22.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@firebase/app-types": "^0.7.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.21",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@cloudcommerce/api": "workspace:*",
23
- "astro": "1.0.0-beta.46"
23
+ "astro": "1.0.0-beta.63"
24
24
  }
25
25
  }