Skip to content

Commit

Permalink
Merge pull request #9 from flutteruniv/develop
Browse files Browse the repository at this point in the history
バージョン0.1
  • Loading branch information
kenta-wakasa committed Jun 29, 2023
2 parents 78f0e23 + 28fcf59 commit 986b677
Show file tree
Hide file tree
Showing 46 changed files with 12,083 additions and 158 deletions.
27 changes: 21 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,37 @@
"request": "launch",
"type": "dart",
"args": [
"--web-port", "5500",
"--web-renderer","html",
"--web-port",
"5000",
"--web-renderer",
"html",
"--dart-define=FLAVOR=dev"
]
},
{
"name": "anaba (profile mode)",
"name": "本番版デバッグビルド",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
"args": [
"--web-port",
"5000",
"--web-renderer",
"html",
"--dart-define=FLAVOR=prod"
]
},
{
"name": "anaba (release mode)",
"name": "本番版リリースビルド",
"request": "launch",
"type": "dart",
"args": [
"--web-port",
"5000",
"--web-renderer",
"html",
"--dart-define=FLAVOR=prod"
],
"flutterMode": "release"
}
]
}
}
20 changes: 16 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cSpell.words": [
"anaba"
]
}
"cSpell.words": ["anaba"],
"eslint.workingDirectories": ["./functions"],
"editor.tabSize": 2,
"eslint.validate": ["javascript", "typescript"],
// ファイル保存時の自動フォーマット有効
"editor.formatOnSave": true,
// デフォルトフォーマッターをPrettierに指定
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
// ファイル保存時に ESLint でフォーマット
"source.fixAll.eslint": true
},
"[markdown]": {
"files.trimTrailingWhitespace": false
}
}
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ linter:
prefer_relative_imports: true
lines_longer_than_80_chars: false
sort_pub_dependencies: false
avoid_classes_with_only_static_members: false
depend_on_referenced_packages: false

analyzer:
exclude:
Expand Down
6 changes: 6 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Freezed

```
dart run build_runner watch
```
35 changes: 35 additions & 0 deletions docs/functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 環境変数

## deploy

### 開発版

`firebase deploy --only functions --project anaba-dev`

### 本番版

`firebase deploy --only functions --project anaba-prod`

## 環境変数の設定

### 開発版

`firebase --project anaba-dev functions:config:set secret.key=value`

### 本番版

`firebase --project anaba-prod functions:config:set secret.key=value`

## どんな変数が set されているか確認したい

### 開発版

`firebase --project anaba-dev functions:config:get`

### 本番版

`firebase --project anaba-prod functions:config:get`

## TS での環境変数の読み込み

`functions.config().secret.key`
18 changes: 17 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,21 @@
"destination": "/index.html"
}
]
}
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
]
}
34 changes: 34 additions & 0 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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`
},
ignorePatterns: [
`/lib/**/*` // Ignore built files.
],
plugins: [`@typescript-eslint`, `import`],
rules: {
quotes: [`error`, `backtick`]
// indent: [`error`, 2]
},
extends: [`prettier`],
settings: {
'import/resolver': {
typescript: { project: `./` }
}
}
}
9 changes: 9 additions & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map

# TypeScript v1 declaration files
typings/

# Node.js dependency directory
node_modules/
7 changes: 7 additions & 0 deletions functions/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 120,
"bracketSpacing": true
}
Loading

0 comments on commit 986b677

Please sign in to comment.