@scenid/react-formulator 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/firebase.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "hosting": {
3
- "site": "react-formulator",
4
3
  "public": "storybook-static",
5
4
  "ignore": [
6
5
  "firebase.json",
@@ -13,5 +12,10 @@
13
12
  "destination": "/index.html"
14
13
  }
15
14
  ]
15
+ },
16
+ "functions": {
17
+ "predeploy": [
18
+ "npm --prefix \"$RESOURCE_DIR\" run lint"
19
+ ]
16
20
  }
17
21
  }
@@ -0,0 +1 @@
1
+ .eslintrc.js
@@ -0,0 +1,29 @@
1
+ module.exports = {
2
+ "root": true,
3
+ "parser": "babel-eslint",
4
+ "parserOptions": {
5
+ "ecmaVersion": 6,
6
+ "sourceType": "module",
7
+ "allowImportExportEverywhere": true
8
+ },
9
+ "extends": [
10
+ "standard"
11
+ ],
12
+ "env": {
13
+ "node": true,
14
+ "mocha": true
15
+ },
16
+ "rules": {
17
+ "operator-linebreak": ["error", "before"],
18
+ "space-before-function-paren": ["error", {
19
+ "anonymous": "always",
20
+ "named": "never",
21
+ "asyncArrow": "always"
22
+ }]
23
+ },
24
+ "plugins": [
25
+ "import",
26
+ "promise",
27
+ "compat"
28
+ ]
29
+ }
@@ -0,0 +1,32 @@
1
+ const functions = require('firebase-functions')
2
+
3
+ const express = require('express')
4
+ const cors = require('cors')
5
+
6
+ const app = express()
7
+
8
+ // Automatically allow cross-origin requests
9
+ app.use(cors({ origin: true }))
10
+
11
+ app.get('/cats', (req, res) => {
12
+ const catalog = [
13
+ { entry: 'Abyssinian' },
14
+ { entry: 'Bengal' },
15
+ { entry: 'Birman' },
16
+ { entry: 'Burmese' },
17
+ { entry: 'Chartreux' },
18
+ { entry: 'Egyptian Mau' },
19
+ { entry: 'German Rex' },
20
+ { entry: 'Khao Manee' },
21
+ { entry: 'Korean Bobtail' },
22
+ { entry: 'Maine Coon' },
23
+ { entry: 'Nebelung' },
24
+ { entry: 'Ocicat' },
25
+ { entry: 'Oriental Shorthair' },
26
+ { entry: 'Siamese' }
27
+ ].map(e => ({ ...e, count: Math.floor(Math.random() * 100) }))
28
+
29
+ res.json(catalog)
30
+ })
31
+
32
+ exports.catalog = functions.https.onRequest(app)