Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
chore(deployment): add dynamic deployment with now.sh (#1260)
Browse files Browse the repository at this point in the history
* chore(deployment): add dynamic deployment with now.sh

* update list of ignored files
  • Loading branch information
layershifter committed Jul 10, 2019
1 parent 384f296 commit d20f4a4
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 4 deletions.
1 change: 0 additions & 1 deletion .eslintignore
@@ -1,4 +1,3 @@
.awcache/
coverage/
dist/
node_modules/
1 change: 0 additions & 1 deletion .gitignore
@@ -1,4 +1,3 @@
.awcache
*.log*
*.iml

Expand Down
28 changes: 28 additions & 0 deletions .nowignore
@@ -0,0 +1,28 @@
.circleci
coverage
dll
docs/dist
docs/src/componentInfo
docs/src/componentMenu.json
docs/src/behaviorMenu.json
docs/src/currentBundleStats.json
docs/src/exampleMenus
docs/src/exampleSources
e2e
node_modules
packages/**/dist
packages/**/test
perf/dist

.editorconfig
.gitignore
.prettierignore
.snyk
codecov.yml
dangerfile.ts
jest.config.js
lerna-debug.log
CHANGELOG.md
LICENSE.md
MANIFESTO.md
README.md
7 changes: 6 additions & 1 deletion build/gulp/plugins/gulp-doctoc.ts
@@ -1,10 +1,15 @@
import fs from 'fs'
import through2 from 'through2'

import config from '../../../config'
import sh from '../sh'

const insideGitRepo = fs.existsSync(config.paths.base('.git'))

export default () =>
through2.obj((file, enc, done) => {
sh(`doctoc ${file.path} --github --maxlevel 4`)
.then(() => sh(`git add ${file.path}`))
.then(() => insideGitRepo && sh(`git add ${file.path}`))
.then(() => {
done(null, file)
})
Expand Down
3 changes: 2 additions & 1 deletion config.ts
Expand Up @@ -6,9 +6,10 @@ import * as _ from 'lodash'
// ------------------------------------
const env = process.env.NODE_ENV || 'development'
const __DEV__ = env === 'development'
const __NOW__ = !!process.env.NOW
const __PERF__ = !!process.env.PERF
const __PROD__ = env === 'production'
const __BASENAME__ = __PROD__ ? '/react/' : '/'
const __BASENAME__ = __PROD__ && !__NOW__ ? '/react/' : '/'

const __SKIP_ERRORS__ = !!process.env.SKIP_ERRORS

Expand Down
40 changes: 40 additions & 0 deletions now.json
@@ -0,0 +1,40 @@
{
"version": 2,
"name": "stardust-react",
"builds": [
{
"src": "package.json",
"use": "@now/static-build",
"config": { "distDir": "docs/dist" }
}
],
"github": {
"autoJobCancelation": true
},
"public": true,
"routes": [
{
"src": "/public/(.*)",
"headers": {
"cache-control": "s-maxage=31536000,immutable"
},
"dest": "/public/$1"
},
{
"src": "/(.*).js",
"headers": {
"cache-control": "s-maxage=31536000,immutable"
},
"dest": "/$1.js"
},
{
"src": "/logo.png",
"dest": "/logo.png"
},
{
"src": "/(.*)",
"dest": "/index.html",
"headers": { "cache-control": "s-maxage=0" }
}
]
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -11,6 +11,7 @@
"lint": "eslint \"**/*.{js,ts,tsx}\" && yarn lint:old",
"lint:fix": "yarn lint --fix && yarn lint:old --fix",
"lint:old": "tslint -t stylish -p .",
"now-build": "cross-env NOW=true yarn predeploy:docs",
"perf": "cross-env PERF=true gulp perf --times=50",
"perf:debug": "cross-env PERF=true gulp perf:debug --debug",
"prettier": "prettier --list-different \"**/*.{ts,tsx}\"",
Expand Down

1 comment on commit d20f4a4

@vercel
Copy link

@vercel vercel bot commented on d20f4a4 Jul 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.