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

[docs] Update the readme blueprint for local usage #78

Merged
merged 3 commits into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions commands/global/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports.handler = async function handler(options) {
const { stripIndent } = require('common-tags');
const latestVersion = require('latest-version');
const pkg = require('../../package.json');
const cliPath = '/bin/cli.js';

fs.outputFileSync(
projectName + '/README.md',
Expand All @@ -37,6 +38,11 @@ module.exports.handler = async function handler(options) {
${projectName} <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
\`\`\`

## Local Usage
\`\`\`
node .${cliPath} <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
\`\`\`

## Transforms

<!--TRANSFORMS_START-->
Expand Down Expand Up @@ -72,7 +78,7 @@ module.exports.handler = async function handler(options) {
'update-docs': 'codemod-cli update-docs',
coveralls: 'cat ./coverage/lcov.info | node node_modules/.bin/coveralls',
},
bin: './bin/cli.js',
bin: `.${cliPath}`,
keywords: ['codemod-cli'],
dependencies: {
'codemod-cli': `^${pkg.version}`,
Expand Down Expand Up @@ -239,7 +245,7 @@ module.exports.handler = async function handler(options) {
`
);
fs.outputFileSync(
projectName + '/bin/cli.js',
`${projectName}${cliPath}`,
stripIndent`
#!/usr/bin/env node
'use strict';
Expand Down
5 changes: 5 additions & 0 deletions commands/local/generate/codemod.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ module.exports.handler = function handler(options) {
${projectName} ${codemodName} path/of/files/ or/some**/*glob.js
\`\`\`

## Local Usage
\`\`\`
node ./bin/cli.js ${codemodName} path/of/files/ or/some**/*glob.js
\`\`\`

## Input / Output

<!--FIXTURES_TOC_START-->
Expand Down