New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

create-next-app

Package Overview
Dependencies
Maintainers
2
Versions
2494
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-next-app - npm Package Compare versions

Comparing version 0.4.7 to 0.5.0

lib/utils/get-install-cmd.js

18

lib/messages.js
const chalk = require('chalk')
const getInstallCmd = require('./utils/get-install-cmd')
const output = require('./utils/output')

@@ -67,6 +68,15 @@

exports.start = function (projectName) {
const cmd = getInstallCmd()
const commands = {
install: cmd === 'npm' ? 'npm install' : 'yarn',
build: cmd === 'npm' ? 'npm run build' : 'yarn build',
start: cmd === 'npm' ? 'npm run start' : 'yarn start',
dev: cmd === 'npm' ? 'npm run dev' : 'yarn dev'
}
return `
${chalk.green('Awesome!')} You're now ready to start coding.
We already ran ${output.cmd('npm install')} for you, so your next steps are:
We already ran ${output.cmd(commands.install)} for you, so your next steps are:

@@ -77,11 +87,11 @@ $ ${output.cmd(`cd ${projectName}`)}

$ ${output.cmd(`npm run build`)}
$ ${output.cmd(commands.build)}
To run the server in production:
$ ${output.cmd(`npm run start`)}
$ ${output.cmd(commands.start)}
To start a local server for development:
$ ${output.cmd(`npm run dev`)}
$ ${output.cmd(commands.dev)}

@@ -88,0 +98,0 @@ Questions? Feedback? Please let us know!

@@ -8,3 +8,3 @@ import NextHead from 'next/head'

export const Head = (props) => (
const Head = (props) => (
<NextHead>

@@ -11,0 +11,0 @@ <meta charset="UTF-8" />

@@ -11,3 +11,3 @@ import Head from './head'

export const Nav = () => (
const Nav = () => (
<nav>

@@ -14,0 +14,0 @@ <ul>

import Link from 'next/link'
import { Head, Nav } from '../components'
import Head from '../components/Head'
import Nav from '../components/Nav'

@@ -4,0 +5,0 @@ export default () => (

@@ -36,3 +36,2 @@ This project was bootstrapped with [Create Next App](https://github.com/segmentio/create-next-app).

components/
index.js
head.js

@@ -120,5 +119,5 @@ nav.js

```jsx
export const Simple = () => (
const Simple = () => (
<div>Simple Component</div>
) // you need to export the component individually so that it can be picked up via index.js
)

@@ -133,3 +132,3 @@ export default Simple // don't forget to export default!

export class Complex extends Component {
class Complex extends Component {
state = {

@@ -148,21 +147,2 @@ text: 'World'

### `./components/index.js`
```jsx
export * from './simple'
export * from './complex'
```
Be aware of the [difference between default and named exports](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281). It is a common source of mistakes.
We suggest that you stick to using default imports and exports when a module only exports a single thing (for example, a component). That’s what you get when you use `export default Simple` and `import Simple from './components/simple'`. Named imports allow us to surface all of the components in code like `import { Simple, Complex } from './components'`
Named exports are useful for utility modules that export several functions. A module may have at most one default export and as many named exports as you like.
Learn more about ES6 modules:
* [When to use the curly braces?](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281)
* [Exploring ES6: Modules](http://exploringjs.com/es6/ch_modules.html)
* [Understanding ES6: Modules](https://leanpub.com/understandinges6/read#leanpub-auto-encapsulating-code-with-modules)
## Fetching Data

@@ -169,0 +149,0 @@

const execa = require('execa')
const Promise = require('promise')
const messages = require('../messages')
const getInstallCmd = require('./get-install-cmd')
const output = require('./output')

@@ -16,4 +17,4 @@

let installCmd = getInstallCmd()
let installArgs = getInstallArgs(installCmd, packages)
const installCmd = getInstallCmd()
const installArgs = getInstallArgs(installCmd, packages)

@@ -41,11 +42,2 @@ console.log(messages.installing(packages))

function getInstallCmd () {
try {
execa.sync('yarnpkg', '--version')
return 'yarn'
} catch (e) {
return 'npm'
}
}
function getInstallArgs (cmd, packages) {

@@ -52,0 +44,0 @@ if (cmd === 'npm') {

@@ -20,11 +20,6 @@ const spawn = require('cross-spawn')

return new Promise(function (resolve, reject) {
Promise.all(cmdPromises).then(function () {
stopExampleSpinner()
output.success(`Downloaded ${output.cmd(example)} files for ${output.cmd(projectName)}`)
resolve()
}).catch(function (err) {
reject(err)
})
return Promise.all(cmdPromises).then(function () {
stopExampleSpinner()
output.success(`Downloaded ${output.cmd(example)} files for ${output.cmd(projectName)}`)
})
}
{
"name": "create-next-app",
"description": "Create Next.js apps in one command",
"version": "0.4.7",
"version": "0.5.0",
"main": "index.js",

@@ -6,0 +6,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc