- Initialized
npm
project withpackage.json
file. See: Getting started withnpm
. express
installed as project dependency.- Entry page (i.e.
server.js
) present in the project root.
project-root
npm
project with package.json
file. See: Getting started with npm
.express
installed as project dependency.server.js
) present in the project root.project-root
project-root
├── node_modules
├── package-lock.json
// | |
// `npx expo install cuid` | |
// | |
import {myStorage} from '../myFirebase'; | |
import {getAuth} from 'firebase/auth'; | |
import {ref, child, put} from 'firebase/storage'; | |
import cuid from 'cuid'; | |
/** |
/* What? | |
* A configuration for standard-version-expo that updates multiple config files | |
* by dynamically identifying them from a sub-directory when you bump the | |
* version using the `standard-version` tool | |
* | |
* How? | |
* Modelled from the post by @bycedric: https://dev.to/bycedric/simplify-expo-releases-with-standard-version-2f4o | |
* Follow the setup instructions listed at the URL above or at https://github.com/expo-community/standard-version-expo | |
* | |
* Why? |
/** | |
* A script that: | |
* 1. loads Google Sheets API keys and spreadsheet IDs (see GOOGLE_API_KEY) | |
* 2. connects to the identifed Google Sheet | |
* 3. grabs the data from a named Worksheet (see SHEET_TO_GET) | |
* 4. iterates over each row (see processUserRows()) | |
* 5. puts them into a JSON structure | |
* 6. and writes that out to a file (see FILE_NAME) | |
* | |
* To run this script, I have this in my package.json: |
const functions = require('firebase-functions'); | |
const firestore = require('@google-cloud/firestore'); | |
const client = new firestore.v1.FirestoreAdminClient(); | |
// | |
// Add config values with CLI command: | |
// firebase functions:config:set my_app_name='{"fsBackupBucket":"gs://my-fs-backup-bucket"}' | |
// | |
const config = functions.config(); |
import React, {createContext, useEffect, useState} from "react"; | |
import i18next from "i18next"; | |
import {initReactI18next} from "react-i18next"; | |
import Backend from "i18next-node-firestore-backend"; | |
import {FIRESTORE} from "../myFirebase"; | |
// export const I18NEXT_FS_BKEND_LANGUAGE_LIST_FIELD_NAME = 'languages'; | |
const I18NEXT_DEFAULT_NAMESPACE = "core"; | |
const I18NEXT_FS_BKEND_COLLECTION_NAME = "config/type/i18n"; |
// version.json: | |
// | |
// { | |
// "version": "3.0.23" | |
// } | |
let VERSION_JSON = `${PROJECT_CONFIG_DIR}/version.json`; | |
versionString = getVersionString(VERSION_JSON); |
import React from "react"; | |
import {FirebaseProvider} from "contexts/FirebaseContext"; | |
import {AuthProvider} from "contexts/AuthProvider"; | |
const App = () => { | |
return ( | |
<FirebaseProvider> | |
<AuthProvider> | |
/** | |
* firestore_add_doc.js | |
* | |
* This script is assumed to live in an existing Javascript project that has its own package.json. | |
* I store this script in <PROJECT_ROOT>/tools/misc/. | |
* | |
* To use: | |
* 1. npm init -y | |
* 2. npm install firebase esm | |
* 3. Edit this code to set for USER1 and FIREBASE_CONFIG |