1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples
Oscar Busk 82c5cc38d5 Update/fix "examples/with-firebase-hosting" (#5853)
Hello! 
I was looking at the [`with-firebase-hosting`](/zeit/next.js/tree/canary/examples/with-firebase-hosting) example and was having some various issues running it:

* `npm run serve` will choke on windows because trying to set enviroment variables with `NODE_ENV=production`
* `npm run build-funcs` failing because of babeljs mismatches between `@babel/cli@^7.0.0-rc.1` and `next@^6.0.3`
* Not being able to deploy because `firebase-tools` being a deprecated version.

I remedied this and also improved some other factors:

* Use standard JSON formatting on `package.json` so that `npm install` doesn't cause changes on every run. (a83e930)
* Remove "prettier" as a devDependency as there is no use of it in the example and most other examples does not have it as a dependency. (6095663)
* Update all dependencies. The simple usecase in this example didn't really require any changes to the code. (ccde086)
  * [`firebase-admin@6`](https://github.com/firebase/firebase-admin-node/releases/tag/v6.0.0)
  * [`firebase-functions@2`](https://github.com/firebase/firebase-functions/releases/tag/v2.0.0) 
  * [`firebase-tools@4`](https://github.com/firebase/firebase-tools/releases/tag/v4.0.0)
  * [`firebase-tools@5`](https://github.com/firebase/firebase-tools/releases/tag/v5.0.0)
  * [`firebase-tools@6`](https://github.com/firebase/firebase-tools/releases/tag/v6.0.0)
* Make `npm run serve` runnable on windows using [`cross-env`](https://www.npmjs.com/package/cross-env). (b20dda7)
* Update `.gitignore` to ignore firebase cache (bf761b7)
* Remove `src/app/.babelrc` that seems to have been added as a previous bugfix but doesn't seem to do anything currently. (1b02045)
* Remove point from [`README.md`](https://github.com/zeit/next.js/blob/canary/examples/with-firebase-hosting/README.md) that was mentioning any `predeploy` hooks in `firebase.json` as they were removed in 4f4b7a1bce. (5636d9f)
* Use the possibility added by upgrading `firebase-tools` to [`>=4.0.0`](https://github.com/firebase/firebase-tools/releases/tag/v4.0.0) and `firebase-functions` to [`>=2.0.0`](https://github.com/firebase/firebase-functions/releases/tag/v2.0.0) to make the deployable functions use node 8 rather than node 6. Also make babel compile with node 8 as target for less polyfills etc. (c954cc2)
  * Added comment to [`README.md`](https://github.com/zeit/next.js/blob/canary/examples/with-firebase-hosting/README.md) explaining how firebase deploys to node 8 and that babel will compile code for node 8. (d8b2e65, 91953dc)

This was tested to `serve` on windows, linux(WSL) and on mac. Deploy was tested on linux(WSL) and mac.

---

This PR is a based on #5806 with correct base.

---

🔔 @jthegedus @timneutkens
2018-12-11 11:45:58 +01:00
..
active-class-name #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
analyze-bundles Add analyze bundles example (#5332) 2018-10-01 01:24:27 +02:00
basic-css #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
basic-export #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-charset #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server-actionhero Update with-mobx-state-tree-typescript example (#5266) 2018-09-27 16:39:11 +02:00
custom-server-express #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server-fastify improve custom-server-fastify example (#4805) 2018-07-19 21:27:22 +02:00
custom-server-hapi #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server-koa #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server-micro #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server-nodemon #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
custom-server-polka Fix linter (#5350) 2018-10-20 17:00:01 +02:00
custom-server-typescript Fix location of production server file (#5731) 2018-11-22 16:55:47 +01:00
data-fetch #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
form-handler #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
gh-pages #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
head-elements #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
hello-world #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
layout-component #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
nested-components #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
only-client-render-external-dependencies update client-only-render-external-dependency example (#4822) 2018-07-22 20:53:22 +02:00
page-transitions Remove page-transitions example 2018-05-25 14:19:40 +02:00
parameterized-routing #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
pass-server-data #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
progressive-render Remove broken link from progressive-render example (#5552) 2018-10-30 11:35:41 +01:00
root-static-files Fix Example Deploy Links (#5216) 2018-09-20 11:32:16 +02:00
shared-modules #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
ssr-caching Added length calculation for insert of cache rather then default to 1… (#5835) 2018-12-06 23:17:59 +01:00
svg-components Use more recent version of svg plugin (#5788) 2018-12-10 14:45:15 +01:00
using-inferno #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
using-nerv #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
using-preact #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
using-router #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
using-with-router #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-absolute-imports Simplify with-absolute-imports example (#5812) 2018-12-04 16:38:39 +01:00
with-algolia-react-instantsearch #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-amp #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-ant-design Remove transform-decorators plugin & Bump deps (#5232) 2018-09-27 23:42:06 +02:00
with-ant-design-less improved ant-design with less (#5847) 2018-12-10 12:20:01 +01:00
with-antd-mobile Update examples/with-antd-mobile (#5495) 2018-11-02 19:50:30 +01:00
with-aphrodite remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-apollo withApollo example - move from old HOC APIs to new function-as-child APIs (#5241) 2018-09-26 01:32:41 +02:00
with-apollo-and-redux Add with style-sheet example (#5572) 2018-11-01 14:05:39 +01:00
with-apollo-and-redux-saga Fix Example Deploy Links (#5216) 2018-09-20 11:32:16 +02:00
with-apollo-auth Remove unused vars and fix typo. (#5752) 2018-11-27 12:28:34 +01:00
with-app-layout #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-asset-imports update with-asset-import example (#4830) 2018-07-24 19:11:21 +02:00
with-babel-macros Fix with-babel-macros by upgrading packages (#5762) 2018-11-28 20:34:46 +01:00
with-carbon-components Upgrade next plugins to the latest version in examples 2018-09-20 16:04:32 +02:00
with-cerebral #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-cloud9 Run yarn lint —fix 2018-10-20 19:37:42 +02:00
with-componentdidcatch #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-configured-preset-env removed deprecated useBuiltIns from .babelrc (#5486) 2018-10-20 21:09:03 +02:00
with-context-api Add with-context-api example (#5154) 2018-09-14 12:04:29 +02:00
with-custom-babel-config Upgrade Babel to 7.0.0-rc.1 (major) (#4937) 2018-08-13 10:34:08 -07:00
with-custom-reverse-proxy Fix with-custom-reverse-proxy example (#5064) 2018-08-30 23:32:19 +02:00
with-cxs remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-data-prefetch #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-docker 🐳️ multistage: remove devDependencies (#5477) 2018-10-19 00:36:04 +02:00
with-dotenv Rewrite with-dotenv example (#4924) 2018-08-08 09:01:00 -07:00
with-draft-js #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-dynamic-app-layout feat: add dynamic layouts with _app.js example (#5420) 2018-10-10 09:49:22 +02:00
with-dynamic-import Fix typos on comments (#5457) 2018-10-16 01:25:16 +02:00
with-electron #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-emotion fix typo (#5813) 2018-12-04 12:48:15 +01:00
with-emotion-fiber remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-external-scoped-css Deprecate css examples 2018-01-31 11:19:34 +01:00
with-external-styled-jsx-sass Add with-external-styled-jsx-sass (#5618) 2018-11-07 18:42:44 +01:00
with-fela remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-firebase-authentication Update for use with Firestore (#5793) 2018-12-10 14:25:40 +01:00
with-firebase-cloud-messaging firebase cloud messaging example (#5689) 2018-11-25 16:37:34 +01:00
with-firebase-hosting Update/fix "examples/with-firebase-hosting" (#5853) 2018-12-11 11:45:58 +01:00
with-firebase-hosting-and-docker Fix linting 2018-12-10 22:05:53 +01:00
with-firebase-hosting-and-typescript #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-flow Remove unused flow definitions (#5094) 2018-09-05 13:38:28 +02:00
with-freactal #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-glamor remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-glamorous remove glamorous example since its no longer maintained (#5738) 2018-11-23 21:18:13 +01:00
with-global-stylesheet Remove with-global-stylesheet example (#4913) 2018-08-07 18:36:28 -07:00
with-global-stylesheet-simple Remove with-global-stylesheet example (#4913) 2018-08-07 18:36:28 -07:00
with-google-analytics Lint examples (#4985) 2018-08-20 08:31:24 +02:00
with-hashed-statics Merge branch 'canary' 2018-09-19 18:15:57 +02:00
with-higher-order-component Lint examples (#4985) 2018-08-20 08:31:24 +02:00
with-immutable-redux-wrapper #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-ioc Replace deprecated props.url in examples (#4953) 2018-08-13 14:12:03 -07:00
with-jest Remove outdated note from with-jest example (#5820) 2018-12-05 11:34:40 +01:00
with-jest-typescript #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-kea Update with-kea example (#5259) 2018-09-23 16:01:37 +02:00
with-loading Update routing samples (#4864) 2018-08-13 14:17:39 -07:00
with-markdown update with-markdown example (#4839) 2018-07-25 20:06:40 +02:00
with-material-ui docs: removes npx info & moves src link up (#4972) 2018-08-19 22:26:50 +02:00
with-mdx MDX example app (#5796) 2018-12-03 19:41:12 +01:00
with-mobx Run initializeStore() only once per route on server (#5644) 2018-11-20 15:53:28 +01:00
with-mobx-state-tree mobx-state-tree examples should use _app (#5362) 2018-10-14 10:04:58 +02:00
with-mobx-state-tree-typescript mobx-state-tree examples should use _app (#5362) 2018-10-14 10:04:58 +02:00
with-mocha add mocha example (#5182) 2018-09-17 00:12:39 +02:00
with-next-css Upgrade next plugins to the latest version in examples 2018-09-20 16:04:32 +02:00
with-next-i18next Add next-i18next as the solution to integrate i18next into next.js (#5761) 2018-11-28 20:39:54 +01:00
with-next-less Upgrade next plugins to the latest version in examples 2018-09-20 16:04:32 +02:00
with-next-page-transitions #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-next-routes Replace deprecated props.url in examples (#4953) 2018-08-13 14:12:03 -07:00
with-next-sass Upgrade next plugins to the latest version in examples 2018-09-20 16:04:32 +02:00
with-noscript #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-now-env #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-pkg #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-polyfills Update polyfills (#5814) 2018-12-04 14:53:24 +01:00
with-portals Fix bug report with-portals example #5694 (#5714) 2018-11-21 09:25:00 +01:00
with-prefetching update with-prefetching example (#4850) 2018-07-27 22:08:09 +02:00
with-pretty-url-routing #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-react-ga update with-react-ga example (#4816) 2018-07-21 19:27:48 +02:00
with-react-helmet #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-react-intl Fix for locale.split is not a function. (#5794) 2018-12-03 09:10:31 -08:00
with-react-jss Fix Example Deploy Links (#5216) 2018-09-20 11:32:16 +02:00
with-react-md #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-react-native-web [change] Update react-native-web example (#5489) 2018-10-22 22:32:24 +02:00
with-react-relay-network-modern feat(example): add react-relay-network-modern example (#5349) 2018-11-25 15:14:36 +01:00
with-react-toolbox #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-react-useragent feat: Added react-useragent example (#5507) 2018-10-23 23:33:41 +02:00
with-react-uwp remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-react-with-styles #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-reasonml update with-reasonml dependencies (#5651) 2018-11-10 08:09:51 +01:00
with-rebass remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-recompose #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-redux Lint examples (#4985) 2018-08-20 08:31:24 +02:00
with-redux-code-splitting Fix failing linter tests (#5257) 2018-09-22 21:41:07 +02:00
with-redux-observable Examples: Update with-redux-observable example packages (#5412) 2018-10-09 12:47:26 +02:00
with-redux-reselect-recompose Fix Example Deploy Links (#5216) 2018-09-20 11:32:16 +02:00
with-redux-saga FIX #5234 (#5235) 2018-09-20 21:09:29 +02:00
with-redux-wrapper #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-reflux #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-refnux #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-relay-modern Fixed package.json (#4654) 2018-09-04 17:50:44 +02:00
with-relay-modern-server-express Fix linting 2018-12-10 22:05:53 +01:00
with-rematch Fix the bug with not passing props to wrapped element of with-rematch example (#5483) 2018-10-20 14:31:26 +02:00
with-scoped-stylesheets-and-postcss Deprecate css examples 2018-01-31 11:19:34 +01:00
with-segment-analytics #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-semantic-ui Update next.config.js (#5593) 2018-11-04 19:42:53 +01:00
with-sentry Fixed broken link (#5479) 2018-10-19 14:52:41 +02:00
with-shallow-routing Fix shallow routing examples using old React lifecycle and deprecated props.url (#4950) 2018-08-13 11:09:45 -07:00
with-sitemap-and-robots-express-server Update example: with-sitemap-and-robots-express-server (#4579) 2018-09-04 17:18:05 +02:00
with-sitemap-and-robots-express-server-typescript Add with-sitemap-and-robots-express-server-typescript example (#5076) 2018-09-03 16:43:19 +02:00
with-slate Add slate.js example (#4899) 2018-08-06 21:00:31 -07:00
with-socket.io #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-static-export Upgrade serve (#4857) 2018-07-27 21:13:55 +02:00
with-storybook #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-strict-csp Add with-strict-csp example (#4858) 2018-08-06 20:19:16 -07:00
with-strict-csp-hash Factor out NextScript inline source (#4934) (#4939) 2018-08-14 11:05:25 -07:00
with-style-sheet Add with style-sheet example (#5572) 2018-11-01 14:05:39 +01:00
with-styled-components Simplify styled-components example (#5631) 2018-11-08 12:43:16 +01:00
with-styled-jsx-plugins #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-styled-jsx-postcss Make styled-jsx configurable (#3050) 2017-10-15 19:54:57 +02:00
with-styled-jsx-scss #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-styletron update styletron example (#5573) 2018-12-10 15:04:58 +01:00
with-sw-precache Missing babel configuration in sw-precache example (#4856) 2018-07-27 22:54:01 +02:00
with-tailwindcss Refactor with tailwindcss example to use next-css (#5461) 2018-11-08 14:42:55 +01:00
with-ts-node Added with-ts-node with Next js 7 example (#5204) 2018-09-28 21:18:50 +02:00
with-typescript Examples: fix <title> warning in the TypeScript example (#5549) 2018-10-29 19:32:01 +01:00
with-typestyle remove <title> in _document.js in examples (#5679) 2018-11-15 16:31:56 +01:00
with-typings-for-css-modules Examples: with-typings-for-css-modules (#5446) 2018-11-02 23:21:59 +01:00
with-universal-configuration #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-universal-configuration-runtime Fix Example Deploy Links (#5216) 2018-09-20 11:32:16 +02:00
with-unstated improve Unstated example so that it can shares state when switching pages (#5822) 2018-12-05 11:32:45 +01:00
with-url-object-routing #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-videojs Upgrade next plugins to the latest version in examples 2018-09-20 16:04:32 +02:00
with-webassembly doc: fix deploy link (#5223) 2018-09-20 11:30:23 +02:00
with-webpack-bundle-analyzer Add analyze bundles example (#5332) 2018-10-01 01:24:27 +02:00
with-webpack-bundle-size-analyzer #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00
with-yarn-workspaces Add with-yarn-workspaces example (#5034) 2018-09-03 23:41:45 +02:00
with-zones #4751 - Explicitly mention install when cloning examples (#4758) 2018-07-11 23:56:15 +02:00