Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo/starters2 #5

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
090c7f5
chore: internalize starters into the monorepo
DSchau Dec 3, 2018
6a2310b
ci: remove config (this commit will be reverted)
DSchau Dec 3, 2018
8c88814
chore: Add clone folders script
DSchau Dec 3, 2018
609191b
chore: minor tweaks
DSchau Dec 3, 2018
e188bcc
chore: remove filter
DSchau Dec 3, 2018
a3eb507
chore: add gatsby bot
DSchau Dec 3, 2018
f01e191
chore: add correct var
DSchau Dec 3, 2018
39f2ecf
chore: add lerna integration
DSchau Dec 3, 2018
c364344
chore: start working on script
DSchau Dec 3, 2018
fff1c27
chore: add build step
DSchau Dec 3, 2018
ad3ce6d
chore: tweakst
DSchau Dec 3, 2018
0ee67dd
chore: minor tweaks
DSchau Dec 3, 2018
885b015
chore: remove from lerna/workspaces
DSchau Dec 5, 2018
4167692
chore: make sure ci passes
DSchau Dec 5, 2018
5c81240
chore: making a change
DSchau Dec 5, 2018
d6eb243
chore: sync back
DSchau Dec 5, 2018
9f4504e
chore: use commit message
DSchau Dec 5, 2018
98c4520
chore: add a comment
DSchau Dec 5, 2018
e43056c
chore: sync with remote repos
DSchau Dec 5, 2018
af537ed
chore: add markdown sync task
DSchau Dec 5, 2018
edc77b1
chore: add autogenerated content
DSchau Dec 5, 2018
b79858e
chore: sync
DSchau Dec 5, 2018
e9bfc5d
chore: sync with upstream
DSchau Dec 12, 2018
5aa5d3d
chore: sync with upstream
DSchau Dec 12, 2018
a4142ee
ci: add back ci tasks
DSchau Dec 12, 2018
1e92deb
chore: update
DSchau Dec 12, 2018
2eac9b3
fix: handle deletions as well
DSchau Dec 14, 2018
ca15f40
choire: tweak
DSchau Dec 14, 2018
b060ccd
chore: test deleting code
DSchau Dec 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: add markdown sync task
DSchau committed Dec 5, 2018
commit af537ed3d9f40dbdff7a0563b3427273c99efc45
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -137,7 +137,11 @@ jobs:
executor: node
steps:
- checkout
- <<: *restore_cache
- <<: *install_node_modules
- <<: *persist_cache
- run: ./scripts/assert-changed-files.sh "starters/*"
- run: yarn markdown
- run: sudo apt-get update && sudo apt-get install jq # jq is helpful for parsing json
- run: git config --global user.name "GatsbyJS Bot"
- run: git config --global user.email "admin@gatsbyjs.com"
45 changes: 45 additions & 0 deletions markdown.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const fs = require(`fs-extra`)
const path = require(`path`)
const _ = require(`lodash`)

module.exports = {
transforms: {
LIST_STARTERS() {
const base = path.join(process.cwd(), `starters`)
const starters = fs
.readdirSync(base)
.filter(dir => fs.statSync(path.join(base, dir)).isDirectory())
.reduce((merged, dir) => {
merged[dir] = JSON.parse(
fs.readFileSync(path.join(base, dir, `package.json`), `utf8`)
)
return merged
}, {})

return `
|Name|Demo|Description|
|:--:|----|-----------|
${Object.keys(starters)
.map(name => {
const starter = starters[name]
return `
|[${name}](https://github.com/gatsbyjs/gatsby-starter-${name})|[gatsby-starter-${name}-demo.netlify.com](https://gatsby-starter-${name}-demo.netlify.com/)|${
starter.description
}|
`.trim()
})
.join(`\n`)}
`.replace(/^[^|]+/gm, ``)
},
STARTER(content, options, { originalPath }) {
const starter = path.basename(path.dirname(originalPath))
const template = fs.readFileSync(
path.join(process.cwd(), `starters`, `README-template.md`),
`utf8`
)
return _.template(template)({
name: starter,
})
},
},
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
"jest-junit": "^5.0.0",
"lerna": "^3.3.0",
"lint-staged": "^8.0.4",
"markdown-magic": "^0.1.25",
"npm-run-all": "4.1.5",
"plop": "^1.8.1",
"prettier": "^1.14.3",
@@ -71,6 +72,8 @@
"lint:code": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .js,.jsx .",
"lint:flow": "babel-node scripts/flow-check.js",
"lint:other": "npm run prettier -- --list-different",
"markdown": "md-magic --path \"starters/**/*.md\"",
"postmarkdown": "prettier --write \"starters/**/*.md\"",
"plop": "plop",
"prebootstrap": "yarn",
"prettier": "prettier \"**/*.{md,css,scss,yaml,yml}\"",
Loading