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 all commits
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
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
- if: "!contains(matrix.os, 'windows')"
name: Run tests 👩🏾‍💻
run: ./bin/npm test
# Q: Why are we using some random test section when the package.json has a test script?
# A: So that we ensure we use the bundled version of node to run our tests

Skip:
if: contains(github.event.head_commit.message, '[skip ci]')
Expand Down
2 changes: 1 addition & 1 deletion bin/apm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ binDir=`pwd -P`
# Force npm to use its builtin node-gyp
unset npm_config_node_gyp

cliPath="$binDir/../lib/cli.js"
cliPath="$binDir/../src/cli.js"
if [[ $(uname -r) == *-Microsoft ]]; then
cliPath="$(echo $cliPath | sed 's/\/mnt\/\([a-z]*\)\(.*\)/\1:\2/')"
cliPath="${cliPath////\\}"
Expand Down
4 changes: 2 additions & 2 deletions bin/apm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if not defined apm_git_path (
set npm_config_node_gyp=

if exist "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
"%~dp0\node.exe" "%~dp0/../src/cli.js" %*
) else (
node.exe "%~dp0/../lib/cli.js" %*
node.exe "%~dp0/../src/cli.js" %*
)
2 changes: 1 addition & 1 deletion bin/ppm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ binDir=`pwd -P`
# Force npm to use its builtin node-gyp
unset npm_config_node_gyp

cliPath="$binDir/../lib/cli.js"
cliPath="$binDir/../src/cli.js"
if [[ $(uname -r) == *-Microsoft ]]; then
cliPath="$(echo $cliPath | sed 's/\/mnt\/\([a-z]*\)\(.*\)/\1:\2/')"
cliPath="${cliPath////\\}"
Expand Down
4 changes: 2 additions & 2 deletions bin/ppm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if not defined apm_git_path (
set npm_config_node_gyp=

if exist "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
"%~dp0\node.exe" "%~dp0/../src/cli.js" %*
) else (
node.exe "%~dp0/../lib/cli.js" %*
node.exe "%~dp0/../src/cli.js" %*
)
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@
"bugs": {
"url": "https://github.com/pulsar-edit/ppm/issues"
},
"main": "./lib/apm.js",
"main": "./src/apm.js",
"bin": {
"apm": "bin/apm"
},
"scripts": {
"check-version": "node script/check-version.js",
"clean:bin": "shx rm -rf bin/node_darwin_x64 bin/node.exe bin/node",
"clean:lib": "shx rm -rf lib && shx mkdir -p lib",
"clean": "npm run clean:lib && npm run clean:bin",
"lint": "coffeelint src spec",
"coffee": "coffee --compile --output lib src",
"build": "npm run clean:lib && npm run coffee",
"prepare": "npm run build",
"clean": "npm run clean:bin",
"postinstall": "node script/postinstall.js",
"test": "npm run check-version && npm run lint && jasmine-focused --captureExceptions --coffee spec"
"test": "npm run check-version && jasmine-focused --captureExceptions spec"
},
"dependencies": {
"@atom/plist": "0.4.4",
Expand Down
2 changes: 1 addition & 1 deletion spec/apm-cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const temp = require('temp');
const fs = require('fs');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm command line interface', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion spec/ci-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const temp = require('temp');
const express = require('express');
const wrench = require('wrench');
const CSON = require('season');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');
const { nodeVersion } = JSON.parse(fs.readFileSync(path.join(__dirname,'config.json')));

describe('apm ci', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/clean-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const temp = require('temp');
const express = require('express');
const http = require('http');
const wrench = require('wrench');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');
const { nodeVersion } = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')));

describe('apm clean', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/command-spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Command = require('../lib/command');
const Command = require('../src/command');

describe('Command', () => {
describe('::spawn', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/config-spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const fs = require('fs-plus');
const temp = require('temp');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm config', () => {
let userConfigPath;
Expand Down
6 changes: 3 additions & 3 deletions spec/develop-spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const fs = require('fs-plus');
const temp = require('temp');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm develop', () => {
let linkedRepoPath, repoPath;
Expand All @@ -19,7 +19,7 @@ describe('apm develop', () => {

describe("when the package doesn't have a published repository url", () => {
it('logs an error', () => {
const Develop = require('../lib/develop');
const Develop = require('../src/develop');
spyOn(Develop.prototype, 'getRepositoryUrl').andCallFake((packageName, callback) => {
callback('Here is the error');
});
Expand All @@ -36,7 +36,7 @@ describe('apm develop', () => {

describe("when the repository hasn't been cloned", () => {
it('clones the repository to ATOM_REPOS_HOME and links it to ATOM_HOME/dev/packages', () => {
const Develop = require('../lib/develop');
const Develop = require('../src/develop');
spyOn(Develop.prototype, 'getRepositoryUrl').andCallFake((packageName, callback) => {
const repoUrl = path.join(__dirname, 'fixtures', 'repo.git');
callback(null, repoUrl);
Expand Down
2 changes: 1 addition & 1 deletion spec/disable-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const wrench = require('wrench');
const path = require('path');
const temp = require('temp');
const CSON = require('season');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm disable', () => {
beforeEach(() => {
Expand Down
6 changes: 3 additions & 3 deletions spec/docs-spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('path');
const express = require('express');
const http = require('http');
const apm = require('../lib/apm-cli');
let Docs = require('../lib/docs');
const apm = require('../src/apm-cli');
let Docs = require('../src/docs');

describe('apm docs', () => {
let server = null;
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('apm docs', () => {
});

it('prints the package URL if called with the -p short option (and does not open it)', () => {
Docs = require('../lib/docs');
Docs = require('../src/docs');
spyOn(Docs.prototype, 'openRepositoryUrl');
const callback = jasmine.createSpy('callback');
apm.run(['docs', '-p', 'wrap-guide'], callback);
Expand Down
30 changes: 15 additions & 15 deletions spec/enable-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');
const temp = require('temp');
const CSON = require('season');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm enable', () => {
beforeEach(() => {
Expand All @@ -15,27 +15,27 @@ describe('apm enable', () => {
process.env.ATOM_HOME = atomHome;
const callback = jasmine.createSpy('callback');
const configFilePath = path.join(atomHome, 'config.cson');

CSON.writeFileSync(configFilePath, {
'*': {
core: {
disabledPackages: ['metrics', 'vim-mode', 'exception-reporting', 'file-icons']
}
}
});

runs(() => {
apm.run(['enable', 'vim-mode', 'not-installed', 'file-icons'], callback);
});

waitsFor('waiting for enable to complete', () => callback.callCount > 0);

runs(() => {
expect(console.log).toHaveBeenCalled();
expect(console.log.argsForCall[0][0]).toMatch(/Not Disabled:\s*not-installed/);
expect(console.log.argsForCall[1][0]).toMatch(/Enabled:\s*vim-mode/);
const config = CSON.readFileSync(configFilePath);

expect(config).toEqual({
'*': {
core: {
Expand All @@ -51,26 +51,26 @@ describe('apm enable', () => {
process.env.ATOM_HOME = atomHome;
const callback = jasmine.createSpy('callback');
const configFilePath = path.join(atomHome, 'config.cson');

CSON.writeFileSync(configFilePath, {
'*': {
core: {
disabledPackages: ['metrics', 'exception-reporting']
}
}
});

runs(() => {
apm.run(['enable', 'vim-mode'], callback);
});

waitsFor('waiting for enable to complete', () => callback.callCount > 0);

runs(() => {
expect(console.log).toHaveBeenCalled();
expect(console.log.argsForCall[0][0]).toMatch(/Not Disabled:\s*vim-mode/);
const config = CSON.readFileSync(configFilePath);

expect(config).toEqual({
'*': {
core: {
Expand All @@ -85,13 +85,13 @@ describe('apm enable', () => {
const atomHome = temp.mkdirSync('apm-home-dir-');
process.env.ATOM_HOME = atomHome;
const callback = jasmine.createSpy('callback');

runs(() => {
apm.run(['enable', 'vim-mode'], callback);
});

waitsFor('waiting for enable to complete', () => callback.callCount > 0);

runs(() => {
expect(console.error).toHaveBeenCalled();
expect(console.error.argsForCall[0][0].length).toBeGreaterThan(0);
Expand All @@ -102,7 +102,7 @@ describe('apm enable', () => {
const atomHome = temp.mkdirSync('apm-home-dir-');
process.env.ATOM_HOME = atomHome;
const callback = jasmine.createSpy('callback');

runs(() => {
apm.run(['enable'], callback);
});
Expand Down
12 changes: 6 additions & 6 deletions spec/featured-spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const express = require('express');
const http = require('http');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm featured', () => {
let server = null;
Expand All @@ -10,23 +10,23 @@ describe('apm featured', () => {
silenceOutput();
spyOnToken();
const app = express();

app.get('/packages/featured', (request, response) => {
response.sendFile(path.join(__dirname, 'fixtures', 'packages.json'));
});

app.get('/themes/featured', (request, response) => {
response.sendFile(path.join(__dirname, 'fixtures', 'themes.json'));
});

server = http.createServer(app);
let live = false;

server.listen(3000, '127.0.0.1', () => {
process.env.ATOM_API_URL = 'http://localhost:3000';
live = true;
});

waitsFor(() => live);
});

Expand Down
2 changes: 1 addition & 1 deletion spec/help-spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('command help', () => {
beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions spec/init-spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('path');
const temp = require('temp');
const CSON = require('season');
const apm = require('../lib/apm-cli');
const fs = require('../lib/fs');
const apm = require('../src/apm-cli');
const fs = require('../src/fs');

describe('apm init', () => {
let languagePath, packagePath, themePath;
Expand Down
8 changes: 4 additions & 4 deletions spec/install-spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const path = require('path');
const CSON = require('season');
const fs = require('../lib/fs');
const fs = require('../src/fs');
const temp = require('temp');
const express = require('express');
const http = require('http');
const wrench = require('wrench');
const apm = require('../lib/apm-cli');
const Install = require('../lib/install');
const apm = require('../src/apm-cli');
const Install = require('../src/install');
const { nodeVersion } = JSON.parse(fs.readFileSync(path.join(__dirname,'config.json')));

describe('apm install', () => {
Expand All @@ -15,7 +15,7 @@ describe('apm install', () => {
beforeEach(() => {
spyOnToken();
silenceOutput();

atomHome = temp.mkdirSync('apm-home-dir-');
process.env.ATOM_HOME = atomHome;

Expand Down
2 changes: 1 addition & 1 deletion spec/link-spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');
const temp = require('temp');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm link/unlink', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion spec/list-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs-plus');
const temp = require('temp');
const wrench = require('wrench');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');
const CSON = require('season');

const listPackages = (args, doneCallback) => {
Expand Down
2 changes: 1 addition & 1 deletion spec/packages-spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Packages = require('../lib/packages');
const Packages = require('../src/packages');

describe('getRemote', () => {
it('returns origin if remote could not be determined', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/publish-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs-plus');
const temp = require('temp');
const express = require('express');
const http = require('http');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');

describe('apm publish', () => {
let server;
Expand Down
2 changes: 1 addition & 1 deletion spec/rebuild-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const temp = require('temp');
const express = require('express');
const http = require('http');
const apm = require('../lib/apm-cli');
const apm = require('../src/apm-cli');
const fs = require('fs-plus');
const { nodeVersion } = JSON.parse(fs.readFileSync(path.join(__dirname,'config.json')));

Expand Down
Loading
Loading