Comparing version 1.0.1 to 1.0.2
# Changelog | ||
* 1.0.2 Remove assumptions about git and tests | ||
* 1.0.1 - Change name because previous name was taken... | ||
* 1.0.0 - Add initial code |
{ | ||
"name": "deyarn", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A command-line tool for converting projects that use Yarn to npm.", | ||
@@ -5,0 +5,0 @@ "bin": "bin/deyarn.js", |
@@ -5,4 +5,3 @@ # `deyarn` | ||
The follow-up to [`npm2yarn`](https://github.com/mixmaxhq/npm2yarn). A blog post describing how | ||
we decided to switch back to `npm` is coming soon :). | ||
The follow-up to [`npm2yarn`](https://github.com/mixmaxhq/npm2yarn). See https://mixmax.com/blog/to-yarn-and-back-again-npm for motivation. | ||
@@ -13,11 +12,6 @@ ## Procedure | ||
1. Checks out the `master` branch | ||
2. Pulls the latest changes | ||
3. Checks out a new branch, `deyarnify`, overwriting any existing `deyarnify` branch | ||
4. Removes `yarn.lock` if it exists | ||
5. Removes `node_modules` to avoid any installation conflicts | ||
6. Installs your project dependencies using `npm`, generating a `package-lock.json` file | ||
7. Runs `npm test` as a sanity check | ||
8. Stages the changes made | ||
9. Logs a list of manual steps to be taken to complete the transition | ||
1. Removes `yarn.lock` if it exists | ||
2. Removes `node_modules` to avoid any installation conflicts | ||
3. Installs your project dependencies using `npm`, generating a `package-lock.json` file | ||
4. Logs a list of manual steps to be taken to complete the transition | ||
@@ -38,3 +32,4 @@ This conversion will likely involve the upgrading of some/many of your transitive dependencies, so make sure to test thoroughly! :) | ||
(in the directory of the project to convert, which must be a Git repository) | ||
(in the directory of the project to convert) | ||
``` | ||
@@ -41,0 +36,0 @@ $ deyarn |
@@ -11,22 +11,4 @@ /* eslint no-console: "off" */ | ||
module.exports = () => { | ||
console.log(chalk.magenta('\nnpm2yarn.js...\n')); | ||
console.log(chalk.magenta('\ndeyarn...\n')); | ||
// Git setup. | ||
console.log(chalk.blue('\nGit setup...')); | ||
console.log(chalk.blue('Checking out master')); | ||
spawnSync('git', ['checkout', 'master'], { | ||
// Write to this process's stdout. | ||
stdio: 'inherit' | ||
}); | ||
console.log(chalk.blue('Pulling the latest changes')); | ||
spawnSync('git', ['pull'], { | ||
stdio: 'inherit' | ||
}); | ||
console.log(chalk.blue('Checking out `deyarnify`')); | ||
spawnSync('git', ['checkout', '-B', 'deyarnify'], { | ||
stdio: 'inherit' | ||
}); | ||
const yarnLockPath = `${process.cwd()}/yarn.lock`; | ||
@@ -68,8 +50,2 @@ if (fs.existsSync(yarnLockPath)) { | ||
// Run tests. | ||
console.log(chalk.blue('\nRunning `npm test`.')); | ||
spawnSync('npm', ['test'], { | ||
stdio: 'inherit' | ||
}); | ||
// Require that users of this package use npm rather than Yarn since it's easy to forget :). | ||
@@ -82,11 +58,2 @@ const packageJsonPath = `${process.cwd()}/package.json`; | ||
// Stage changes. | ||
console.log(chalk.blue('\nStaging changes.')); | ||
spawnSync('git', ['add', '.'], { | ||
stdio: 'inherit' | ||
}); | ||
spawnSync('git', ['status'], { | ||
stdio: 'inherit' | ||
}); | ||
// Output success. | ||
@@ -96,10 +63,10 @@ | ||
console.log('NEXT STEPS:'); | ||
console.log(' 1. Update package.json scripts to use npm if necessary:'); | ||
console.log(' 1. Perform any testing to ensure that package updates were not problematic.'); | ||
console.log(' 2. Update package.json scripts to use npm if necessary:'); | ||
console.log(' ', chalk.cyan(JSON.stringify(packageJson.get('scripts')))); | ||
console.log(' 2. Update the README if necessary'); | ||
console.log(' 3. Update your CI configuration if necessary'); | ||
console.log(' 4. Update the README if necessary'); | ||
console.log(' - Add preferred npm-install instruction'); | ||
console.log(' - Update any other Yarn commands to use npm instead'); | ||
console.log(' 3. Update your CI configuration if necessary'); | ||
console.log(' 4. Perform any additional testing to ensure that package updates were not problematic.'); | ||
console.log(' 5. Commit the made changes'); | ||
}; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3981
59
43
2