nice setup with v2 with typescript and now ready to just hound out functions

This commit is contained in:
Arjun Patel
2022-01-27 17:56:20 -08:00
parent 36092e8af7
commit 1ac2dcc3a6
25 changed files with 14020 additions and 2684 deletions
+29
View File
@@ -0,0 +1,29 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json", "tsconfig.dev.json"],
sourceType: "module",
tsconfigRootDir: __dirname,
},
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: ["@typescript-eslint", "import"],
rules: {
"quotes": ["error", "double"],
"import/no-unresolved": 0,
},
};
+9
View File
@@ -0,0 +1,9 @@
# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map
# TypeScript v1 declaration files
typings/
# Node.js dependency directory
node_modules/
+7644
View File
File diff suppressed because it is too large Load Diff
+32
View File
@@ -0,0 +1,32 @@
{
"name": "functions",
"scripts": {
"lint": "eslint --ext .js,.ts .",
"build": "npm run lint && tsc",
"serve": "npm run build && firebase emulators:start --only functions & tsc --watch",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log",
"hotReload": "tsc --watch"
},
"engines": {
"node": "16"
},
"main": "lib/index.js",
"dependencies": {
"agora-access-token": "^2.0.4",
"firebase-admin": "^9.8.0",
"firebase-functions": "^3.14.1"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.8.0",
"eslint": "^7.6.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.22.0",
"firebase-functions-test": "^0.2.0",
"typescript": "^3.8.0"
},
"private": true
}
+23
View File
@@ -0,0 +1,23 @@
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp();
// // Start writing Firebase Functions
// // https://firebase.google.com/docs/functions/typescript
//
export const helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello no!", {structuredData: true});
response.send("Hello from woahhhhhh!");
});
// exports.agoraToken = functions.https.onCall((data, context) => {
// console.log(data);
// console.log("user's id: " + context.auth?.uid);
// const channelName = data.channelName;
// let token = agora.getAgoraToken(channelName);
// return { token };
// });
+3
View File
@@ -0,0 +1,3 @@
{
"include": [".eslintrc.js"]
}
+15
View File
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": [
"src"
]
}