Firebase-tools: ๋ฐฐํฌํ•  ๋Œ€์ƒ์„ ์ดํ•ดํ•  ์ˆ˜ ์—†์Œ ์˜ค๋ฅ˜

์— ๋งŒ๋“  2019๋…„ 01์›” 14์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: firebase/firebase-tools

๋ฒ„์ „ ์ •๋ณด

6.2.2

ํ”Œ๋žซํผ ์ •๋ณด

OSX

์žฌํ˜„ ๋‹จ๊ณ„

$ firebase init

๊ธฐ๋Šฅ๊ณผ ํ˜ธ์ŠคํŒ… ๋ชจ๋‘์— ๋Œ€ํ•œ ๊ตฌ์„ฑ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ TSLint๋ฅผ ์ž…๋ ฅํ•˜๊ณ  yes๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์•„๋ž˜ ๋ณต์‚ฌ ๋ถ™์—ฌ๋„ฃ๊ธฐ๋ฅผ functions/src/index.ts์— ๋ณต์‚ฌํ•˜์‹ญ์‹œ์˜ค.

import * as functions from 'firebase-functions';

import * as admin from 'firebase-admin';
admin.initializeApp();

// Most basic HTTP Funtion
export const basicHTTP = functions.https.onRequest((request, response) => {
  const name = request.query.name;

  if (!name) {
    response.status(400).send('ERROR you must supply a name :(');
  }

  response.send(`hello ${name}`);
});

$ firebase deploy --only functions

์˜ˆ์ƒ๋˜๋Š” ํ–‰๋™

์„ ํƒํ•œ Firebase ํ”„๋กœ์ ํŠธ์— ํ•จ์ˆ˜๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ๋ฐฐํฌ๋˜๊ธฐ๋ฅผ ๊ธฐ๋Œ€ํ•ฉ๋‹ˆ๋‹ค.

์‹ค์ œ ํ–‰๋™

"๋ฐฐํฌํ•  ๋Œ€์ƒ์„ ์ดํ•ดํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. --only ๋˜๋Š” --except ํ”Œ๋ž˜๊ทธ๋ฅผ ์‚ฌ์šฉํ•œ ๊ฒฝ์šฐ ์œ ํšจํ•œ ๋Œ€์ƒ์„ ์ง€์ •ํ–ˆ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด firebase.json์„ ํ™•์ธํ•˜์—ฌ ํ”„๋กœ์ ํŠธ๊ฐ€ ์›ํ•˜๋Š” ๊ธฐ๋Šฅ์— ๋Œ€ํ•ด ์ดˆ๊ธฐํ™”๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค. ."

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๋‚˜๋Š” ์ถ”๊ฐ€ํ–ˆ๋‹ค

"files": [
    "node_modules/typescript/lib/lib.es6.d.ts"
],
"exclude": [
    "node_modules"
]

ํ•จ์ˆ˜์—์„œ ๋‚ด tsconfig ํŒŒ์ผ์— ์ถ”๊ฐ€ํ•˜๊ณ  ํŠธ๋ฆญ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์˜€์Šต๋‹ˆ๋‹ค. ๊ดœ์ฐฎ์œผ๋ฉด ์•Œ๋ ค์ฃผ์„ธ์š”.

๋ชจ๋“  3 ๋Œ“๊ธ€

๋‚˜๋Š” ๊ทธ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ–ˆ์ง€๋งŒ ์ด์ œ ๋ฐฐํฌํ•˜๋ ค๊ณ  ํ•  ๋•Œ ์ด๊ฒƒ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.

../node_modules/@types/cordova/index.d.ts(35,58): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(36,52): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(37,53): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(38,57): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(39,57): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(40,59): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(41,62): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(42,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(43,63): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(44,61): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(46,61): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(47,55): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(48,56): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(49,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(50,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(51,62): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(52,65): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(53,63): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(54,66): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(55,64): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(57,51): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(58,54): error TS2304: Cannot find name 'Event'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

์ด๊ฒƒ์ด TSLint์™€ ๊ด€๋ จ์ด ์žˆ์Šต๋‹ˆ๊นŒ?

๋‚˜๋Š” ์ถ”๊ฐ€ํ–ˆ๋‹ค

"files": [
    "node_modules/typescript/lib/lib.es6.d.ts"
],
"exclude": [
    "node_modules"
]

ํ•จ์ˆ˜์—์„œ ๋‚ด tsconfig ํŒŒ์ผ์— ์ถ”๊ฐ€ํ•˜๊ณ  ํŠธ๋ฆญ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์˜€์Šต๋‹ˆ๋‹ค. ๊ดœ์ฐฎ์œผ๋ฉด ์•Œ๋ ค์ฃผ์„ธ์š”.

๊ทธ๊ฒŒ ์™œ ๋ฌธ์ œ์ธ์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๊ฒฐํ•˜์…จ๋‹ค๋‹ˆ ๋‹คํ–‰์ž…๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰