Skip to content

Commit 6dca71c

Browse files
committed
Make npm the default to make release non-breaking
Avoid breaking workflow of users using the new version.
1 parent 7932557 commit 6dca71c

File tree

8 files changed

+50
-30
lines changed

8 files changed

+50
-30
lines changed

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@
1717
},
1818
"author": "Geovani Souza <[email protected]>",
1919
"contributors": [
20-
{ "name": "Geovani Souza", "email": "[email protected]" },
21-
{ "name": "Nick Balestra", "email": "[email protected]" }
20+
{
21+
"name": "Geovani Souza",
22+
"email": "[email protected]"
23+
},
24+
{
25+
"name": "Nick Balestra",
26+
"email": "[email protected]"
27+
}
2228
],
2329
"license": "ISC",
2430
"bugs": {

packages/create-cycle-app/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const VERSION = require(path.resolve(__dirname, 'package.json')).version
1010
const validCommands = {
1111
'verbose': true,
1212
'flavor': true,
13-
'noyarn': true,
13+
'yarn': true,
1414
'forceprompt': true
1515
}
1616

@@ -21,7 +21,7 @@ if (commands.length === 0) {
2121
console.log(chalk.green(`create-cycle-app version: ${VERSION}`))
2222
process.exit()
2323
}
24-
console.error(chalk.red('Usage: create-cycle-app <project-directory> [--flavor] [--verbose]'))
24+
console.error(chalk.red('Usage: create-cycle-app <project-directory> [--flavor] [--verbose] [--yarn]'))
2525
process.exit(1)
2626
}
2727

@@ -38,9 +38,9 @@ Object.keys(argv)
3838

3939
const flavor = argv.flavor || 'core'
4040
const verbose = argv.verbose || false
41-
const noyarn = argv.noyarn || false
41+
const yarn = argv.yarn || false
4242
const forceprompt = argv.forceprompt || false
4343
const name = commands[0]
4444

4545
// Parse the command line options and run the setup
46-
createApp(name, verbose, flavor, noyarn, forceprompt)
46+
createApp(name, verbose, flavor, yarn, forceprompt)

packages/create-cycle-app/package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,26 @@
2222
"create-cycle-app": "./index.js"
2323
},
2424
"dependencies": {
25+
"@cycle/dom": "^18.0.0",
26+
"@cycle/http": "^14.0.0",
27+
"@cycle/isolate": "^3.0.0",
28+
"@cycle/run": "^3.1.0",
29+
"@cycle/time": "^0.8.0",
2530
"chalk": "^1.1.3",
2631
"cross-spawn": "^4.0.2",
27-
"inquirer": "^3.0.6",
28-
"minimist": "^1.2.0"
32+
"cycle-onionify": "^3.3.0",
33+
"inquirer": "^3.3.0",
34+
"minimist": "^1.2.0",
35+
"xstream": "^10.9.0"
2936
},
3037
"devDependencies": {
31-
"fs-extra": "^2.0.0",
32-
"jest": "^18.1.0"
38+
"cycle-restart": "^0.2.2",
39+
"cyclejs-test-helpers": "^1.3.0",
40+
"fs-extra": "^2.1.2",
41+
"html-looks-like": "^1.0.3",
42+
"jest": "^18.1.0",
43+
"jsverify": "^0.8.2",
44+
"snabbdom-to-html": "^3.2.0"
3345
},
3446
"repository": {
3547
"type": "git",

packages/create-cycle-app/src/createApp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ const installScripts = require('./installScripts')
88
const createPackageJson = require('./createPackageJson')
99
const shouldUseYarn = require('./shouldUseYarn')
1010

11-
module.exports = function createApp (name, verbose, flavor, noyarn, forceprompt) {
11+
module.exports = function createApp (name, verbose, flavor, yarn, forceprompt) {
1212
// The path where the cycle app will be created
1313
const appPath = path.resolve(name)
1414
// The name of the cycle app to create
1515
const appName = path.basename(appPath)
1616
// Which CLi to use (yarn or npm)
1717
let cli = 'npm'
18-
if (!noyarn && shouldUseYarn()) {
18+
if (yarn || shouldUseYarn()) {
1919
cli = 'yarn'
2020
}
2121
// console.log(cli)

packages/create-cycle-app/src/getPackageName.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
const path = require('path')
44

5+
const packageRegex = /(@[\w-]+\/)?[\w-]+/
6+
57
module.exports = function getPackageName (installPackage) {
68
if (/.tgz$/.test(installPackage)) {
79
return installPackage.match(/^(.*)-.*tgz$/)[1]
8-
} else if (~installPackage.indexOf('@')) {
9-
return installPackage.split('@')[0]
10+
} else if (/^\.\/|\//.test(installPackage)) {
11+
return require(path.resolve(installPackage, 'package.json')).name
12+
} else {
13+
return installPackage.match(packageRegex)[0]
1014
}
11-
return path.basename(installPackage)
1215
}

packages/create-cycle-app/src/shouldUseYarn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ const execSync = require('child_process').execSync
22

33
module.exports = function shouldUseYarn () {
44
try {
5-
execSync('yarnpkg --version', { stdio: 'ignore' })
6-
return true
7-
} catch (e) {
5+
execSync('npm --version', { stdio: 'ignore' })
86
return false
7+
} catch (e) {
8+
return true
99
}
1010
}

packages/create-cycle-app/test/integration/createCycleApp.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ describe('create-cycle-app', () => {
3636
path.resolve(__dirname, '../../index.js'),
3737
appName,
3838
'--flavor',
39-
40-
'--noyarn'
39+
4140
])
4241
dir = fs.readdirSync(appName)
4342
done()
@@ -48,13 +47,13 @@ describe('create-cycle-app', () => {
4847
})
4948

5049
test('it generate the correct folder structure and install dependencies', () => {
51-
expect(dir).toMatchObject([
50+
expect(dir).toEqual(expect.arrayContaining([
5251
'.gitignore',
5352
'node_modules',
5453
'package.json',
5554
'public',
5655
'src'
57-
])
56+
]))
5857
})
5958

6059
test('it generate a correct package.json file', () => {

packages/cycle-scripts/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
"cycle-scripts": "./index.js"
3131
},
3232
"dependencies": {
33-
"babel-core": "^6.24.1",
33+
"babel-core": "^6.26.0",
3434
"babel-loader": "^6.4.1",
35-
"babel-plugin-transform-object-rest-spread": "^6.23.0",
35+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
3636
"babel-plugin-transform-react-jsx": "^6.24.1",
37-
"babel-preset-env": "^1.3.3",
37+
"babel-preset-env": "^1.6.0",
3838
"chalk": "^1.1.3",
3939
"cross-spawn": "^5.1.0",
4040
"fs-extra": "^2.1.2",
41-
"html-webpack-plugin": "^2.28.0",
42-
"inquirer": "^3.0.6",
41+
"html-webpack-plugin": "^2.30.1",
42+
"inquirer": "^3.3.0",
4343
"jest": "^19.0.2",
4444
"react-dev-utils": "^0.5.2",
45-
"snabbdom-pragma": "^1.8.0",
46-
"webpack": "^2.3.3",
47-
"webpack-dev-server": "^2.4.2"
45+
"snabbdom-pragma": "^1.10.0",
46+
"webpack": "^2.7.0",
47+
"webpack-dev-server": "^2.9.1"
4848
}
4949
}

0 commit comments

Comments
 (0)