Skip to content

Commit

Permalink
add app-root-path
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswon committed Mar 18, 2023
1 parent 3fa257d commit ffca793
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
5 changes: 4 additions & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"predeploy": "cp $INIT_CWD/../.env.production $INIT_CWD/.",
"deploy": "npm run predeploy; NODE_ENV=production firebase deploy --only functions; npm run postdeploy",
"postdeploy": "rm -rf $INIT_CWD/.env*",
"logs": "firebase functions:log",
"docs": "yarn build && node lib/index.js",
"test": "mocha --exit --require ts-node/register 'test/*.ts' --timeout 240000"
Expand All @@ -18,6 +20,7 @@
"main": "lib/src/index.js",
"dependencies": {
"@moralisweb3/common-core": "^2.12.0",
"app-root-path": "^3.1.0",
"cors": "^2.8.5",
"dotenv": "^16.0.1",
"envalid": "7.3.1",
Expand Down
2 changes: 2 additions & 0 deletions functions/src/api/proxyGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export class ProxyGenerator {
};
if (!data.cursor) {
ret.cursor = null;
} else {
ret.cursor = data.cursor;
}
let metadatas = data.items.map((item: KasNftItem) => {
return getTokenMetadata(item.extras.tokenUri);
Expand Down
2 changes: 1 addition & 1 deletion functions/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default config;
function readEnv(name: string): string {
const value = process.env[name];
if (!value) {
throw new Error(`The environment variable '${name}' is not set`);
throw new Error(`The environment variable '${name}' is not set.`);
}
return value;
}
Expand Down
5 changes: 5 additions & 0 deletions functions/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,11 @@ anymatch@^3.0.3, anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

app-root-path@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.1.0.tgz#5971a2fc12ba170369a7a1ef018c71e6e47c2e86"
integrity sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==

arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"app-root-path": "^3.1.0",
"eslint": "^8.32.0",
"eslint-plugin-etc": "^2.0.2",
"eslint-plugin-import": "^2.27.5",
Expand All @@ -31,6 +32,6 @@
"dev": "tsnd --respawn src/index.ts",
"build": "tsc",
"lint": "eslint --ext .js,.ts src",
"deploy": "firebase deploy --only hosting"
"deploy": "NODE_ENV=production firebase deploy --only hosting"
}
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

app-root-path@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.1.0.tgz#5971a2fc12ba170369a7a1ef018c71e6e47c2e86"
integrity sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==

arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
Expand Down

0 comments on commit ffca793

Please sign in to comment.