33 |
34 |
35 |
36 |
37 |
38 |
53 |
83 |
--------------------------------------------------------------------------------
/components/README.md:
--------------------------------------------------------------------------------
1 | # COMPONENTS
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | The components directory contains your Vue.js Components.
6 |
7 | _Nuxt.js doesn't supercharge these components._
8 |
--------------------------------------------------------------------------------
/firebase.config.js.template:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | apiKey: '',
3 | authDomain: '',
4 | databaseURL: '',
5 | projectId: '',
6 | storageBucket: '',
7 | messagingSenderId: '',
8 | appId: ''
9 | }
10 |
--------------------------------------------------------------------------------
/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "functions": {
3 | "source": "functions",
4 | "predeploy": [
5 | "npm run build && rm -rf functions/nuxt && cp -r .nuxt/ functions/nuxt/ && cp nuxt.config.js functions/"
6 | ]
7 | },
8 | "hosting": {
9 | "predeploy": [
10 | "rm -rf public/* && mkdir -p public/_nuxt && cp -r .nuxt/dist/client/ public/_nuxt && cp -a static/. public/"
11 | ],
12 | "public": "public",
13 | "ignore": [
14 | "firebase.json",
15 | "**/.*",
16 | "**/node_modules/**"
17 | ],
18 | "rewrites": [
19 | {
20 | "source": "**",
21 | "function": "nuxtApp"
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/functions/.gitignore:
--------------------------------------------------------------------------------
1 | ## Compiled JavaScript files
2 | **/*.js
3 | **/*.js.map
4 |
5 | # Typescript v1 declaration files
6 | typings/
7 |
8 | node_modules/
--------------------------------------------------------------------------------
/functions/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "functions",
3 | "scripts": {
4 | "lint": "tslint --project tsconfig.json",
5 | "build": "tsc",
6 | "serve": "npm run build && firebase serve --only functions",
7 | "shell": "npm run build && firebase functions:shell",
8 | "start": "npm run shell",
9 | "deploy": "firebase deploy --only functions",
10 | "logs": "firebase functions:log"
11 | },
12 | "engines": {
13 | "node": "8"
14 | },
15 | "main": "lib/index.js",
16 | "dependencies": {
17 | "firebase-admin": "~7.0.0",
18 | "firebase-functions": "^2.3.0",
19 | "@nuxtjs/pwa": "^2.6.0",
20 | "bootstrap": "^4.1.3",
21 | "bootstrap-vue": "^2.0.0-rc.11",
22 | "cross-env": "^5.2.0",
23 | "dotprop": "^1.2.0",
24 | "express": "^4.16.4",
25 | "firebase": "^6.0.4",
26 | "firebaseui": "^4.0.0",
27 | "nuxt": "^2.6.2",
28 | "nuxt-svg-loader": "^1.0.1"
29 | },
30 | "devDependencies": {
31 | "tslint": "^5.12.0",
32 | "typescript": "^3.2.2",
33 | "babel-eslint": "^10.0.1",
34 | "eslint": "^5.3.0",
35 | "eslint-plugin-import": "^2.14.0"
36 | },
37 | "private": true
38 | }
39 |
--------------------------------------------------------------------------------
/functions/src/index.ts:
--------------------------------------------------------------------------------
1 | // from: https://medium.com/likecoin/quick-nuxt-js-ssr-prototyping-with-firebase-cloud-functions-5277553610a8
2 | const functions = require('firebase-functions')
3 | const { Nuxt } = require('nuxt-start')
4 |
5 | const nuxtConfig = require('./nuxt.config.js')
6 |
7 | const config = {
8 | ...nuxtConfig,
9 | dev: false,
10 | debug: false,
11 | buildDir: 'nuxt'
12 | }
13 | const nuxt = new Nuxt(config)
14 |
15 | exports.nuxtApp = functions.https.onRequest((req: any, res: any) =>
16 | nuxt.render(req, res)
17 | )
18 |
--------------------------------------------------------------------------------
/functions/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "noImplicitReturns": true,
5 | "noUnusedLocals": true,
6 | "outDir": "lib",
7 | "sourceMap": true,
8 | "strict": true,
9 | "target": "es2017"
10 | },
11 | "compileOnSave": true,
12 | "include": [
13 | "src"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/functions/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | // -- Strict errors --
4 | // These lint rules are likely always a good idea.
5 |
6 | // Force function overloads to be declared together. This ensures readers understand APIs.
7 | "adjacent-overload-signatures": true,
8 |
9 | // Do not allow the subtle/obscure comma operator.
10 | "ban-comma-operator": true,
11 |
12 | // Do not allow internal modules or namespaces . These are deprecated in favor of ES6 modules.
13 | "no-namespace": true,
14 |
15 | // Do not allow parameters to be reassigned. To avoid bugs, developers should instead assign new values to new vars.
16 | "no-parameter-reassignment": true,
17 |
18 | // Force the use of ES6-style imports instead of /// imports.
19 | "no-reference": true,
20 |
21 | // Do not allow type assertions that do nothing. This is a big warning that the developer may not understand the
22 | // code currently being edited (they may be incorrectly handling a different type case that does not exist).
23 | "no-unnecessary-type-assertion": true,
24 |
25 | // Disallow nonsensical label usage.
26 | "label-position": true,
27 |
28 | // Disallows the (often typo) syntax if (var1 = var2). Replace with if (var2) { var1 = var2 }.
29 | "no-conditional-assignment": true,
30 |
31 | // Disallows constructors for primitive types (e.g. new Number('123'), though Number('123') is still allowed).
32 | "no-construct": true,
33 |
34 | // Do not allow super() to be called twice in a constructor.
35 | "no-duplicate-super": true,
36 |
37 | // Do not allow the same case to appear more than once in a switch block.
38 | "no-duplicate-switch-case": true,
39 |
40 | // Do not allow a variable to be declared more than once in the same block. Consider function parameters in this
41 | // rule.
42 | "no-duplicate-variable": [true, "check-parameters"],
43 |
44 | // Disallows a variable definition in an inner scope from shadowing a variable in an outer scope. Developers should
45 | // instead use a separate variable name.
46 | "no-shadowed-variable": true,
47 |
48 | // Empty blocks are almost never needed. Allow the one general exception: empty catch blocks.
49 | "no-empty": [true, "allow-empty-catch"],
50 |
51 | // Functions must either be handled directly (e.g. with a catch() handler) or returned to another function.
52 | // This is a major source of errors in Cloud Functions and the team strongly recommends leaving this rule on.
53 | "no-floating-promises": true,
54 |
55 | // Do not allow any imports for modules that are not in package.json. These will almost certainly fail when
56 | // deployed.
57 | "no-implicit-dependencies": true,
58 |
59 | // The 'this' keyword can only be used inside of classes.
60 | "no-invalid-this": true,
61 |
62 | // Do not allow strings to be thrown because they will not include stack traces. Throw Errors instead.
63 | "no-string-throw": true,
64 |
65 | // Disallow control flow statements, such as return, continue, break, and throw in finally blocks.
66 | "no-unsafe-finally": true,
67 |
68 | // Do not allow variables to be used before they are declared.
69 | "no-use-before-declare": true,
70 |
71 | // Expressions must always return a value. Avoids common errors like const myValue = functionReturningVoid();
72 | "no-void-expression": [true, "ignore-arrow-function-shorthand"],
73 |
74 | // Disallow duplicate imports in the same file.
75 | "no-duplicate-imports": true,
76 |
77 |
78 | // -- Strong Warnings --
79 | // These rules should almost never be needed, but may be included due to legacy code.
80 | // They are left as a warning to avoid frustration with blocked deploys when the developer
81 | // understand the warning and wants to deploy anyway.
82 |
83 | // Warn when an empty interface is defined. These are generally not useful.
84 | "no-empty-interface": {"severity": "warning"},
85 |
86 | // Warn when an import will have side effects.
87 | "no-import-side-effect": {"severity": "warning"},
88 |
89 | // Warn when variables are defined with var. Var has subtle meaning that can lead to bugs. Strongly prefer const for
90 | // most values and let for values that will change.
91 | "no-var-keyword": {"severity": "warning"},
92 |
93 | // Prefer === and !== over == and !=. The latter operators support overloads that are often accidental.
94 | "triple-equals": {"severity": "warning"},
95 |
96 | // Warn when using deprecated APIs.
97 | "deprecation": {"severity": "warning"},
98 |
99 | // -- Light Warnings --
100 | // These rules are intended to help developers use better style. Simpler code has fewer bugs. These would be "info"
101 | // if TSLint supported such a level.
102 |
103 | // prefer for( ... of ... ) to an index loop when the index is only used to fetch an object from an array.
104 | // (Even better: check out utils like .map if transforming an array!)
105 | "prefer-for-of": {"severity": "warning"},
106 |
107 | // Warns if function overloads could be unified into a single function with optional or rest parameters.
108 | "unified-signatures": {"severity": "warning"},
109 |
110 | // Prefer const for values that will not change. This better documents code.
111 | "prefer-const": {"severity": "warning"},
112 |
113 | // Multi-line object literals and function calls should have a trailing comma. This helps avoid merge conflicts.
114 | "trailing-comma": {"severity": "warning"}
115 | },
116 |
117 | "defaultSeverity": "error"
118 | }
119 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | moduleNameMapper: {
3 | '^@/(.*)$': '/$1',
4 | '^~/(.*)$': '/$1',
5 | '^vue$': 'vue/dist/vue.common.js'
6 | },
7 | moduleFileExtensions: ['js', 'vue', 'json'],
8 | transform: {
9 | '^.+\\.js$': 'babel-jest',
10 | '.*\\.(vue)$': 'vue-jest'
11 | },
12 | collectCoverage: true,
13 | collectCoverageFrom: [
14 | '/components/**/*.vue',
15 | '/pages/**/*.vue'
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/layouts/README.md:
--------------------------------------------------------------------------------
1 | # LAYOUTS
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your Application Layouts.
6 |
7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
8 |
--------------------------------------------------------------------------------
/layouts/default.vue:
--------------------------------------------------------------------------------
1 |
2 |