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/with-firebase-hosting-and-typescript/package.json
Oscar Busk 4345343d88 Update/fix "examples/with-firebase-hosting-and-typescript" (#5864)
There were several issues with the example [examples/with-firebase-hosting-and-typescript](https://github.com/zeit/next.js/tree/canary/examples/with-firebase-hosting-and-typescript)
* `npm run serve`
  * Has no `pre` task that actually builds the app. Requires manual running of all build scripts.
  * Will choke on windows because trying to set environment variables with `NODE_ENV=production`
* Outdated Typescript and Tslint
* Not being able to deploy because `firebase-tools` being of a deprecated version.
* Structure, which I understand is based on `firebase-tools` generation, is confising with `src/functions/src` being generally bad structuring.

I remedied this and also improved some other factors:

* Remove dependency `prettier` as it is unused (f4d6f54)
* Upgrade all dependencies (09a9193)
  * Use upgraded firebase dependencies to deploy to node 8 environment (87e1e09, 7d8055b)
  * Remove deprecated tslint rule `no-unused-variable` (9392162)
* Flattened filestructure in `src/functions` (097a25a)
* Use ES import when importing next (6c99adb)
* Fixed incorrect name and added somewhat to the description in package.json.
  `with-firebase-hosting` → `with-firebase-hosting-and-typescript` (1ffa0b5)
* Fixed `serve` script by building before running, using [`cross-env`](https://www.npmjs.com/package/cross-env) to set environment variables and remove unecessary flag. (3a1e221, 422ccee, 8811e44)
* Add `.firebase` cache to `.gitignore` (4d7cbe4)
* Add `-C` (clean) flag when copying dependency files `copy-deps` (0826708)
* Use `strict: true` in the functions tsconfig (229b04f)

This was tested by running serve on windows and linx(WSL) and deploy on linux(WSL)

---

This is based on #5819 but correctly based from `canary`
2018-12-11 23:24:18 +01:00

43 lines
1.5 KiB
JSON

{
"name": "with-firebase-hosting-and-typescript",
"version": "1.0.0",
"description": "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects. Built with typescript.",
"engines": {
"node": "8"
},
"scripts": {
"dev": "next src/app",
"preserve": "npm run build-public && npm run build-functions && npm run build-app && npm run copy-deps && npm run install-deps",
"serve": "cross-env NODE_ENV=production firebase serve",
"deploy": "firebase deploy",
"clean": "rimraf \"dist/functions\" && rimraf \"dist/public\"",
"build-app": "next build \"src/app\"",
"build-public": "cpx \"src/public/**/*.*\" \"dist/public\" -C",
"build-functions": "tsc --project src/functions",
"lint-app": "tslint --project src/app",
"typecheck-app": "tsc --project src/app",
"lint-functions": "tslint --project src/functions",
"copy-deps": "cpx \"*{package.json,package-lock.json,yarn.lock}\" \"dist/functions\" -C",
"install-deps": "cd \"dist/functions\" && npm i"
},
"dependencies": {
"@zeit/next-typescript": "^1.1.0",
"firebase-admin": "^6.3.0",
"firebase-functions": "^2.1.0",
"next": "^7.0.0",
"react": "^16.6.0",
"react-dom": "^16.6.0"
},
"devDependencies": {
"@types/next": "^7.0.0",
"@types/react": "^16.6.0",
"cpx": "1.5.0",
"cross-env": "5.2.0",
"firebase-tools": "^6.1.0",
"rimraf": "2.6.2",
"tslint": "^5.11.0",
"tslint-react": "^3.6.0",
"typescript": "^3.2.0"
}
}