Skip to content

Commit

Permalink
move everything to a package or gists
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Feb 26, 2020
1 parent 99f2002 commit 2d934ce
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 2,718 deletions.
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"npm": ">=6"
},
"dependencies": {
"@kentcdodds/react-workshop-app": "^1.0.1",
"@testing-library/jest-dom": "^5.1.1",
"@testing-library/react": "^9.4.1",
"chalk": "^3.0.0",
Expand Down Expand Up @@ -44,7 +45,7 @@
"test": "react-scripts test --env=jsdom",
"test:coverage": "npm run test -- --watchAll=false --coverage",
"test:exercises": "npm run test -- testing.*exercises\\/ --onlyChanged",
"setup": "node ./scripts/setup && npm run validate && node ./scripts/autofill-feedback-email.js",
"setup": "node ./scripts/setup",
"lint": "eslint .",
"validate": "npm-run-all --parallel build test:coverage lint"
},
Expand Down
61 changes: 0 additions & 61 deletions scripts/autofill-feedback-email.js

This file was deleted.

37 changes: 20 additions & 17 deletions scripts/setup.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
var path = require('path')
var pkg = require(path.join(process.cwd(), 'package.json'))
var spawnSync = require('child_process').spawnSync

// if you install it then this should be require('workshop-setup')
// but that... doesn't really make sense.
require('./workshop-setup')
.setup(pkg.engines)
.then(
() => {
console.log(`💯 You're all set up! 👏`)
},
error => {
console.error(`🚨 There was a problem:`)
console.error(error)
console.error(
`\nIf you would like to just ignore this error, then feel free to do so and install dependencies as you normally would in "${process.cwd()}". Just know that things may not work properly if you do...`,
)
},
console.log('▶️ Starting workshop setup...')

var error = spawnSync('npx --version', {shell: true})
.stderr.toString()
.trim()
if (error) {
console.error(
'🚨 npx is not available on this computer. Please install npm@5.2.0 or greater',
)
throw error
}

var result = spawnSync(
'npx "https://gist.github.com/kentcdodds/bb452ffe53a5caa3600197e1d8005733" -q',
{stdio: 'inherit', shell: true},
)

if (result.status === 0) {
console.log('✅ Workshop setup complete...')
}
Loading

0 comments on commit 2d934ce

Please sign in to comment.