-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR includes: - [x] add `organisation` and `project` to `UploadConfig` - [x] add upload logic and tests closes #21 closes #57 closes #85 --------- Co-authored-by: Matěj Chalk <[email protected]> Co-authored-by: Matěj Chalk <[email protected]>
- Loading branch information
1 parent
6440590
commit 3e88ffc
Showing
111 changed files
with
1,203 additions
and
658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
.env | ||
|
||
# compiled output | ||
dist | ||
tmp | ||
|
5 changes: 3 additions & 2 deletions
5
examples/cli-e2e/mocks/config.mock.js → examples/cli-e2e/mocks/code-pushup.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
// TODO: import plugins using NPM package names using local registry: https://github.com/flowup/quality-metrics-cli/issues/33 | ||
import eslintPlugin from '../../../dist/packages/plugin-eslint'; | ||
// import eslintPlugin from '../../../dist/packages/plugin-eslint'; | ||
import lighthousePlugin from '../../../dist/packages/plugin-lighthouse'; | ||
|
||
export default { | ||
persist: { outputPath: 'tmp/cli-config-out.json' }, | ||
categories: [], | ||
plugins: [ | ||
await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
// TODO: uncomment once runner is implemented | ||
// await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
lighthousePlugin({ config: '.lighthouserc.json' }), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// TODO: import plugins using NPM package names using local registry: https://github.com/flowup/quality-metrics-cli/issues/33 | ||
// import eslintPlugin from '../../../dist/packages/plugin-eslint'; | ||
import lighthousePlugin from '../../../dist/packages/plugin-lighthouse'; | ||
|
||
export default { | ||
persist: { outputPath: 'tmp/cli-config-out.json' }, | ||
categories: [], | ||
plugins: [ | ||
// TODO: uncomment once runner is implemented | ||
// await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
lighthousePlugin({ config: '.lighthouserc.json' }), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// TODO: import plugins using NPM package names using local registry: https://github.com/flowup/quality-metrics-cli/issues/33 | ||
// import eslintPlugin from '../../../dist/packages/plugin-eslint'; | ||
import lighthousePlugin from '../../../dist/packages/plugin-lighthouse'; | ||
|
||
export default { | ||
persist: { outputPath: 'tmp/cli-config-out.json' }, | ||
categories: [], | ||
plugins: [ | ||
// TODO: uncomment once runner is implemented | ||
// await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
lighthousePlugin({ config: '.lighthouserc.json' }), | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,33 @@ | ||
import { cli } from '@quality-metrics/cli'; | ||
import eslintPlugin from '@quality-metrics/eslint-plugin'; | ||
import lighthousePlugin from '@quality-metrics/lighthouse-plugin'; | ||
import { | ||
CliArgsObject, | ||
executeProcess, | ||
objectToCliArgs, | ||
} from '@code-pushup/utils'; | ||
import { join } from 'path'; | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
const configFile = (ext: 'ts' | 'js' | 'mjs') => | ||
join(process.cwd(), `examples/cli-e2e/mocks/config.mock.${ext}`); | ||
join(process.cwd(), `examples/cli-e2e/mocks/code-pushup.config.${ext}`); | ||
|
||
const execCli = (argObj: Partial<CliArgsObject>) => | ||
executeProcess({ | ||
command: 'node', | ||
args: objectToCliArgs({ | ||
_: './dist/packages/cli/index.js', | ||
verbose: true, | ||
...argObj, | ||
}), | ||
}); | ||
|
||
describe('cli', () => { | ||
it('should load .js config file', async () => { | ||
const argv = await cli(['--configPath', configFile('js'), '--verbose']) | ||
.argv; | ||
expect(argv.plugins[0]).toEqual( | ||
await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
); | ||
expect(argv.plugins[1]).toEqual( | ||
lighthousePlugin({ config: '.lighthouserc.json' }), | ||
); | ||
await execCli({ configPath: configFile('js') }); | ||
}); | ||
|
||
it('should load .mjs config file', async () => { | ||
const argv = await cli(['--configPath', configFile('mjs'), '--verbose']) | ||
.argv; | ||
expect(argv.plugins[0]).toEqual( | ||
await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
); | ||
expect(argv.plugins[1]).toEqual( | ||
lighthousePlugin({ config: '.lighthouserc.json' }), | ||
); | ||
await execCli({ configPath: configFile('mjs') }); | ||
}); | ||
|
||
it('should load .ts config file', async () => { | ||
const argv = await cli(['--configPath', configFile('ts'), '--verbose']) | ||
.argv; | ||
expect(argv.plugins[0]).toEqual( | ||
await eslintPlugin({ eslintrc: '.eslintrc.json', patterns: '**/*.ts' }), | ||
); | ||
expect(argv.plugins[1]).toEqual( | ||
lighthousePlugin({ config: '.lighthouserc.json' }), | ||
); | ||
await execCli({ configPath: configFile('ts') }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.