Skip to content

Commit

Permalink
build: Yarn -> NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Mar 27, 2020
1 parent 56a2efc commit b1f2d60
Show file tree
Hide file tree
Showing 8 changed files with 20,439 additions and 16,205 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.cache
node_modules
yarn-error.log
package-lock.json

# Build directory
/public
Expand All @@ -13,3 +12,4 @@ package-lock.json
coverage
.vscode
.history
yarn.lock
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ env:
- COMMAND=build
- COMMAND=test-ci

before_install:
- npm install -g yarn

install: yarn --frozen-lockfile

cache:
yarn: true
npm: true
directories:
- 'node_modules'

script:
- yarn run $COMMAND
- npm run $COMMAND
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,21 @@

## 🚀 Get Started

1. **Install Yarn (if Yarn Package Manager is not available on your machine).**

Yarn has an [installation guide](https://yarnpkg.com/en/docs/install) for your specific configuration. Happy knitting!

2. **Install dependencies.**
1. **Install dependencies.**

```sh
# install the dependencies
yarn install
npm install
```

3. **Start developing.**
1. **Start developing.**

```sh
# "start": "gatsby develop"
yarn start
npm start
```

4. **Open the source code and start editing!**
1. **Open the source code and start editing!**

Your site is now running at `http://localhost:8000`!

Expand Down Expand Up @@ -77,7 +73,7 @@ A quick look at the top-level files and directories you'll see in a Gatsby proje
1. **`/node_modules`**: The directory where all of the modules of code that your project depends on (npm packages) are automatically installed.
2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser), like your site header, or a page template. Src is a convention for source code.
2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser), like your site header, or a page template. "Src" is a convention for "source code."
3. **`.gitignore`**: This file tells git which files it should not track/not maintain a version history.
Expand All @@ -89,17 +85,17 @@ A quick look at the top-level files and directories you'll see in a Gatsby proje
7. **`gatsby-browser.tsx`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://next.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser.
6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins youd like to include, etc. (Check out the [config docs](https://next.gatsbyjs.org/docs/gatsby-config/) for more detail).
6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you'd like to include, etc. (Check out the [config docs](https://next.gatsbyjs.org/docs/gatsby-config/) for more detail).

8. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby node APIs](https://next.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.

9. **`gatsby-ssr.tsx`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://next.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering.

10. **`LICENSE`**: Gatsby is licensed under the MIT license.

11. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You wont change this file directly).
11. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won't change this file directly).
12. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the projects name, author, etc.). This manifest is how npm knows which packages to install for your project.
12. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project's name, author, etc.). This manifest is how npm knows which packages to install for your project.

13. **`README.md`**: A text file containing useful reference information about your project.

Expand All @@ -123,7 +119,7 @@ Looking for more guidance? Full documentation for Gatsby lives [on the website](

- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://next.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process.

- **To dive straight into code samples head [to our documentation](https://next.gatsbyjs.org/docs/).** In particular, check out the Guides, API reference, and Advanced Tutorials sections in the sidebar.
- **To dive straight into code samples head [to our documentation](https://next.gatsbyjs.org/docs/).** In particular, check out the "Guides", API reference, and "Advanced Tutorials" sections in the sidebar.

## 🏛 Governance

Expand Down
10 changes: 5 additions & 5 deletions cloudbuild-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Google Cloud Build config for deploying site to Firebase hosting
#
#
# PREREQUISITES:
# You must enable firebase and allow Cloud Build to publish to it
# 1. Enable the following APIs:
Expand All @@ -9,15 +9,15 @@
# 2. Grant the following roles to the Cloud Build service account (<your-project-id>@cloudbuild.gserviceaccount.com):
# - Firebase Admin
# - API Keys Admin
# (Alternativey, use a (Firebase Token)[https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/firebase#with-token]
# (Alternativey, use a (Firebase Token)[https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/firebase#with-token]
# to grant publishing access to Cloud Build.)

steps:
- name: 'node:10'
entrypoint: yarn
args: ['install']
entrypoint: npm
args: ['ci']
- name: 'node:10'
entrypoint: yarn
entrypoint: npm
args: ['run', 'build']
- name: 'gcr.io/$PROJECT_ID/firebase'
args: ['deploy', "--project", "$PROJECT_ID", "--only", "hosting"]
6 changes: 3 additions & 3 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
steps:
- name: 'node:10'
entrypoint: yarn
args: ['install']
entrypoint: npm
args: ['ci']
- name: 'node:10'
entrypoint: yarn
entrypoint: npm
args: ['run', 'build-ci']
env:
- 'PATH_PREFIX=staging.nodejs.dev/$SHORT_SHA'
Expand Down
Loading

0 comments on commit b1f2d60

Please sign in to comment.