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

Decaf Source #84

Merged
merged 62 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
16e0075
Decaf all files
confused-Techie Jul 22, 2023
8f7d7ff
Re-decaf with `--optional-chaining`
confused-Techie Jul 22, 2023
d618f1b
Fully Decaf `apm-cli.js`
confused-Techie Jul 22, 2023
6fb3c15
Remove decaf message, and finish decaffing `apm-cli.js`
confused-Techie Jul 22, 2023
2cc8022
Decaf `apm.js`
confused-Techie Jul 22, 2023
a5b1b88
Decaf `auth.js`
confused-Techie Jul 22, 2023
81aa85f
Decaf `ci.js`
confused-Techie Jul 22, 2023
9007336
Decaf `clean.js`
confused-Techie Jul 22, 2023
1e8edbc
Decaf `cli.js`
confused-Techie Jul 22, 2023
a530cbb
Decaf `command.js`
confused-Techie Jul 23, 2023
7300686
Decaf `config.js`
confused-Techie Jul 23, 2023
00f2a19
Remove `Config` variable from `config.js`
confused-Techie Jul 23, 2023
74f443c
Fix typo in `clean.js`
confused-Techie Jul 23, 2023
0f9c924
Decaf `dedupe`
confused-Techie Jul 23, 2023
4586429
decaf `deprecated-packages`
confused-Techie Jul 23, 2023
a6896a3
Decaf `develop`
confused-Techie Jul 23, 2023
7d576a4
Fix spacing on clean output
confused-Techie Jul 23, 2023
c9455df
Decaf `disable`
confused-Techie Jul 23, 2023
907b278
decaf `docs`
confused-Techie Jul 23, 2023
7b6a393
decaf `enable`
confused-Techie Jul 23, 2023
fb9ff1e
decaf `featured`
confused-Techie Jul 23, 2023
44d8b96
decaf `fs`
confused-Techie Jul 23, 2023
20dc881
decaf `git`
confused-Techie Jul 23, 2023
12a5880
decaf `init`
confused-Techie Jul 23, 2023
f9f0b07
Light decaf of `install`
confused-Techie Jul 23, 2023
83dd4c6
Decaf `link`
confused-Techie Jul 23, 2023
fd29416
Realizing that output strings have been being formatted incorrectly
confused-Techie Jul 23, 2023
ec3f569
decaf `link`
confused-Techie Jul 23, 2023
c12f9af
decaf `list`
confused-Techie Jul 23, 2023
97e1d60
decaf `login`
confused-Techie Jul 23, 2023
d233db8
decaf `package-converter`
confused-Techie Jul 23, 2023
de1221e
decaf `packages`
confused-Techie Jul 23, 2023
45e3cdc
decaf `publish`
confused-Techie Jul 23, 2023
ebd1e1f
decaf `rebuild-module-cache`
confused-Techie Jul 23, 2023
e121a18
decaf `rebuild`
confused-Techie Jul 23, 2023
9d99353
decaf `request`
confused-Techie Jul 23, 2023
a958bc0
decaf `search`
confused-Techie Jul 23, 2023
57e4809
decaf `star`
confused-Techie Jul 23, 2023
2e399fb
decaf `stars`
confused-Techie Jul 23, 2023
28cfb52
decaf `test`
confused-Techie Jul 23, 2023
3b4a6b7
decaf `text-mate-theme`
confused-Techie Jul 23, 2023
3e586ea
decaf `theme-converter`
confused-Techie Jul 23, 2023
6748e1f
decaf `tree`
confused-Techie Jul 23, 2023
b923023
decaf `uninstall`
confused-Techie Jul 23, 2023
4228c96
decaf `unlink`
confused-Techie Jul 23, 2023
5b5cecc
decaf `unpublish`
confused-Techie Jul 23, 2023
d41a667
decaf `unstar`
confused-Techie Jul 23, 2023
93411a1
decaf `updade`
confused-Techie Jul 23, 2023
127baba
decaf `view`
confused-Techie Jul 23, 2023
b87f934
Migrate all tests and build tools to new decaffed code
confused-Techie Jul 23, 2023
d2fe84b
Use normal testing
confused-Techie Jul 23, 2023
14a3a0e
Revert changes to tests, adding comment for future use
confused-Techie Jul 23, 2023
27521b3
Maybe a require error is being eaten in tests
confused-Techie Jul 23, 2023
8efefed
Fix another bad import
confused-Techie Jul 23, 2023
4670a95
temp verbose logging
confused-Techie Jul 23, 2023
6c10eec
Ensure we return all yargs parsed parameters
confused-Techie Jul 23, 2023
d0b8f94
Remove debugging throw
confused-Techie Jul 23, 2023
f874cde
Setting `supportedSyntaxes` as standard property
confused-Techie Jul 23, 2023
8279b8a
Remove verbose flag from ci
confused-Techie Jul 23, 2023
75fdc45
Resolve case in `supportedSyntaxes`
confused-Techie Jul 23, 2023
a3cd921
Can we enable testing for windows?
confused-Techie Jul 23, 2023
e18f0b2
Revert "Can we enable testing for windows?"
confused-Techie Jul 23, 2023
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
Prev Previous commit
Next Next commit
Ensure we return all yargs parsed parameters
  • Loading branch information
confused-Techie committed Jul 23, 2023
commit 6c10eec919072fdfb06cdb2e89a6ddeba3267031
4 changes: 2 additions & 2 deletions src/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ but cannot be used to install new packages or dependencies.\
);

options.alias('h', 'help').describe('help', 'Print this usage message');
options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information');
return options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information');
}

installModules(options, callback) {
Expand Down Expand Up @@ -73,7 +73,7 @@ but cannot be used to install new packages or dependencies.\
commands.push(callback => { return config.loadNpm((error, npm) => { this.npm = npm; return callback(error); }); });
commands.push(cb => this.loadInstalledAtomMetadata(cb));
commands.push(cb => this.installModules(opts, cb));

throw new Error(options.argv);
const iteratee = (item, next) => item(next);
return async.mapSeries(commands, iteratee, function(err) {
if (err) { return callback(err); }
Expand Down
2 changes: 1 addition & 1 deletion src/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Deletes all packages in the node_modules folder that are not referenced
as a dependency in the package.json file.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Usage: ppm config set <key> <value>
\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/dedupe.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Reduce duplication in the node_modules folder in the current directory.
This command is experimental.\
`
);
soptions.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

dedupeModules(options, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Once this command completes you can open a dev window from atom using
cmd-shift-o to run the package out of the newly cloned repository.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

getRepositoryUrl(packageName, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Usage: ppm disable [<package_name>]...
Disables the named package(s).\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

getInstalledPackages(callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Open a package's homepage in the default browser.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.boolean('p').alias('p', 'print').describe('print', 'Print the URL instead of opening it');
return options.boolean('p').alias('p', 'print').describe('print', 'Print the URL instead of opening it');
}

openRepositoryUrl(repositoryUrl) {
Expand Down
2 changes: 1 addition & 1 deletion src/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Usage: ppm enable [<package_name>]...
Enables the named package(s).\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/featured.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ List the Pulsar packages and themes that are currently featured.\
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('t', 'themes').boolean('themes').describe('themes', 'Only list themes');
options.alias('c', 'compatible').string('compatible').describe('compatible', 'Only list packages/themes compatible with this Pulsar version');
options.boolean('json').describe('json', 'Output featured packages as JSON array');
return options.boolean('json').describe('json', 'Output featured packages as JSON array');
}

getFeaturedPackagesByType(atomVersion, packageType, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ on the option selected.\
options.alias('l', 'language').string('language').describe('language', 'Generates a basic language package');
options.alias('c', 'convert').string('convert').describe('convert', 'Path or URL to TextMate bundle/theme to convert');
options.alias('h', 'help').describe('help', 'Print this usage message');
options.string('template').describe('template', 'Path to the package or theme template');
return options.string('template').describe('template', 'Path to the package or theme template');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ package names to install with optional versions using the
options.boolean('check').describe('check', 'Check that native build tools are installed');
options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information');
options.string('packages-file').describe('packages-file', 'A text file containing the packages to install');
options.boolean('production').describe('production', 'Do not install dev dependencies');
return options.boolean('production').describe('production', 'Do not install dev dependencies');
}

installModule(options, pack, moduleURI, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Run \`ppm links\` to view all the currently linked packages.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('d', 'dev').boolean('dev').describe('dev', 'Link to ~/.pulsar/dev/packages');
return options.alias('d', 'dev').boolean('dev').describe('dev', 'Link to ~/.pulsar/dev/packages');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ List all of the symlinked atom packages in ~/.atom/packages and
~/.pulsar/dev/packages.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

getDevPackagePath(packageName) { return path.join(this.devPackagesPath, packageName); }
Expand Down
2 changes: 1 addition & 1 deletion src/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ List all the installed packages and also the packages bundled with Atom.\
options.alias('l', 'links').boolean('links').default('links', true).describe('links', 'Include linked packages');
options.alias('t', 'themes').boolean('themes').describe('themes', 'Only list themes');
options.alias('p', 'packages').boolean('packages').describe('packages', 'Only list packages');
options.alias('v', 'versions').boolean('versions').default('versions', true).describe('versions', 'Include version of each package');
return options.alias('v', 'versions').boolean('versions').default('versions', true).describe('versions', 'Include version of each package');
}

isPackageDisabled(name) {
Expand Down
2 changes: 1 addition & 1 deletion src/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ be used to identify you when publishing packages.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.string('token').describe('token', 'Package API token');
return options.string('token').describe('token', 'Package API token');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ have published it.\
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('t', 'tag').string('tag').describe('tag', 'Specify a tag to publish. Must be of the form vx.y.z');
options.alias('r', 'rename').string('rename').describe('rename', 'Specify a new name for the package');
return options.alias('r', 'rename').string('rename').describe('rename', 'Specify a new name for the package');
}

// Create a new version and tag use the `npm version` command.
Expand Down
2 changes: 1 addition & 1 deletion src/rebuild-module-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ at the _atomModuleCache property in the package's package.json file.
This command skips all linked packages.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

getResourcePath(callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/rebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in the current working directory.
All the modules will be rebuilt if no module names are specified.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

forkNpmRebuild(options, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Search for packages/themes.\
options.alias('h', 'help').describe('help', 'Print this usage message');
options.boolean('json').describe('json', 'Output matching packages as JSON array');
options.boolean('packages').describe('packages', 'Search only non-theme packages').alias('p', 'packages');
options.boolean('themes').describe('themes', 'Search only themes').alias('t', 'themes');
return options.boolean('themes').describe('themes', 'Search only themes').alias('t', 'themes');
}

searchPackages(query, opts, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/star.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Run \`ppm stars\` to see all your starred packages.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.boolean('installed').describe('installed', 'Star all packages in ~/.pulsar/packages');
return options.boolean('installed').describe('installed', 'Star all packages in ~/.pulsar/packages');
}

starPackage(packageName, param, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/stars.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ List or install starred Atom packages and themes.\
options.alias('i', 'install').boolean('install').describe('install', 'Install the starred packages');
options.alias('t', 'themes').boolean('themes').describe('themes', 'Only list themes');
options.alias('u', 'user').string('user').describe('user', 'GitHub username to show starred packages for');
options.boolean('json').describe('json', 'Output packages as a JSON array');
return options.boolean('json').describe('json', 'Output packages as a JSON array');
}

getStarredPackages(user, atomVersion, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ to the current working directory).\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('p', 'path').string('path').describe('path', 'Path to atom command');
return options.alias('p', 'path').string('path').describe('path', 'Path to atom command');
}

run(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Delete the installed package(s) from the ~/.pulsar/packages directory.\
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('d', 'dev').boolean('dev').describe('dev', 'Uninstall from ~/.pulsar/dev/packages');
options.boolean('hard').describe('hard', 'Uninstall from ~/.pulsar/packages and ~/.pulsar/dev/packages');
return options.boolean('hard').describe('hard', 'Uninstall from ~/.pulsar/packages and ~/.pulsar/dev/packages');
}

getPackageVersion(packageDirectory) {
Expand Down
2 changes: 1 addition & 1 deletion src/unlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Run \`ppm links\` to view all the currently linked packages.\
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('d', 'dev').boolean('dev').describe('dev', 'Unlink package from ~/.pulsar/dev/packages');
options.boolean('hard').describe('hard', 'Unlink package from ~/.pulsar/packages and ~/.pulsar/dev/packages');
options.alias('a', 'all').boolean('all').describe('all', 'Unlink all packages in ~/.pulsar/packages and ~/.pulsar/dev/packages');
return options.alias('a', 'all').boolean('all').describe('all', 'Unlink all packages in ~/.pulsar/packages and ~/.pulsar/dev/packages');
}

getDevPackagePath(packageName) { return path.join(this.devPackagesPath, packageName); }
Expand Down
2 changes: 1 addition & 1 deletion src/unpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ name is specified.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.alias('f', 'force').boolean('force').describe('force', 'Do not prompt for confirmation');
return options.alias('f', 'force').boolean('force').describe('force', 'Do not prompt for confirmation');
}

unpublishPackage(packageName, packageVersion, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/unstar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Unstar the given packages
Run \`ppm stars\` to see all your starred packages.\
`
);
options.alias('h', 'help').describe('help', 'Print this usage message');
return options.alias('h', 'help').describe('help', 'Print this usage message');
}

starPackage(packageName, token, callback) {
Expand Down
2 changes: 1 addition & 1 deletion src/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ available updates.\
options.alias('l', 'list').boolean('list').describe('list', 'List but don\'t install the outdated packages');
options.boolean('json').describe('json', 'Output outdated packages as a JSON array');
options.string('compatible').describe('compatible', 'Only list packages/themes compatible with this Atom version');
options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information');
return options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information');
}

getInstalledPackages(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ View information about a package/theme.\
);
options.alias('h', 'help').describe('help', 'Print this usage message');
options.boolean('json').describe('json', 'Output featured packages as JSON array');
options.string('compatible').describe('compatible', 'Show the latest version compatible with this Atom version');
return options.string('compatible').describe('compatible', 'Show the latest version compatible with this Atom version');
}

loadInstalledAtomVersion(options, callback) {
Expand Down