Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c5ab308
refactor(utils): add organization and project to core config
BioPhoton Sep 23, 2023
9e98e65
feat(utils): add upload logic
BioPhoton Sep 23, 2023
a54d8c4
fix: merge
BioPhoton Oct 2, 2023
dd9006f
fix: format
BioPhoton Oct 2, 2023
40f2bec
fix: format
BioPhoton Oct 2, 2023
0232348
refactor(core): intro command base options type
BioPhoton Oct 2, 2023
7b41bf9
refactor(core): add docs change imports
BioPhoton Oct 3, 2023
20cbc61
refactor: add gitignor
BioPhoton Oct 3, 2023
ef4f394
refactor: add logic
BioPhoton Oct 3, 2023
1e78909
refactor: fix lint
BioPhoton Oct 3, 2023
2d6481d
refactor: merge
BioPhoton Oct 3, 2023
df2337a
refactor: fix imports
BioPhoton Oct 4, 2023
8b54df7
refactor: fix e2e tsconfig
BioPhoton Oct 4, 2023
273760b
test(cli-e2e): fix e2e tests - only check non-error, set implicit dep…
matejchalk Oct 4, 2023
ad1413f
build(core): unify build configuration with other packages
matejchalk Oct 4, 2023
d2dd048
refactor: fix e2e
BioPhoton Oct 4, 2023
b766236
refactor: fix e2e 2
BioPhoton Oct 4, 2023
4174403
refactor: fix e2e 3
BioPhoton Oct 4, 2023
525da88
refactor: fix e2e 4
BioPhoton Oct 4, 2023
5d25a45
refactor: fix e2e 5
BioPhoton Oct 9, 2023
793d035
refactor: fix tests 6
BioPhoton Oct 9, 2023
abc30e6
refactor: fix tests 8
BioPhoton Oct 9, 2023
d632bc5
refactor: fix tests 9
BioPhoton Oct 9, 2023
8f9cd16
refactor: fix tests 10
BioPhoton Oct 9, 2023
57a6a61
refactor: fix tests 11
BioPhoton Oct 9, 2023
d78dff5
refactor: fix tests 13
BioPhoton Oct 10, 2023
cc97529
refactor: fix tests 14
BioPhoton Oct 10, 2023
5cb75bb
test(cli): fix and extend upload command tests
matejchalk Oct 10, 2023
adb6839
Merge branch 'main' into add-upload-logic-to-utils
matejchalk Oct 10, 2023
32aff90
refactor: fix tests 16
BioPhoton Oct 10, 2023
3363ac5
Merge branch 'add-upload-logic-to-utils' of github.com:flowup/quality…
matejchalk Oct 10, 2023
57ce1af
refactor: fix tests 17
BioPhoton Oct 10, 2023
b60a1fe
refactor: fix collect tests
BioPhoton Oct 10, 2023
9b0a2ca
test(cli-e2e): fix E2E tests - comment out WIP ESLint plugin, fix Lig…
matejchalk Oct 10, 2023
dbd8548
chore: rename quality-metrics to code-pushup in root files
matejchalk Oct 10, 2023
deeeb76
refactor: fix lint errors
BioPhoton Oct 10, 2023
4f7ffff
refactor: merge
BioPhoton Oct 10, 2023
09d3574
refactor: adopt tests
BioPhoton Oct 10, 2023
42b4227
refactor: fix lint
BioPhoton Oct 10, 2023
093c54e
refactor: fix test
BioPhoton Oct 10, 2023
e34f752
Update packages/cli/src/lib/upload/config.mock.ts
BioPhoton Oct 10, 2023
f2e82c6
Update packages/cli/src/lib/collect/command-object.spec.ts
BioPhoton Oct 10, 2023
b5431c4
refactor: format
BioPhoton Oct 10, 2023
1b455f3
Update packages/core/src/lib/collect-and-persist.ts
BioPhoton Oct 10, 2023
a130dd7
refactor: polish 1
BioPhoton Oct 10, 2023
bc02d25
refactor: polish 3
BioPhoton Oct 10, 2023
50b7d05
refactor: fix lint
BioPhoton Oct 10, 2023
e25d368
refactor: fix test
BioPhoton Oct 10, 2023
78d7b16
refactor: fix test 2
BioPhoton Oct 10, 2023
90da523
refactor: fix lint
BioPhoton Oct 10, 2023
061033c
refactor: fix format
BioPhoton Oct 10, 2023
7179d85
refactor(cli): add test folder
BioPhoton Oct 10, 2023
dc3a0b5
refactor(cli): format
BioPhoton Oct 10, 2023
0adbc61
refactor(cli): test files
BioPhoton Oct 10, 2023
f3fc3e5
refactor(cli): test files
BioPhoton Oct 10, 2023
3b1566a
refactor(cli): resolve todos
BioPhoton Oct 10, 2023
41682a2
refactor(cli): fix exec target
BioPhoton Oct 10, 2023
63c71ac
Update packages/models/src/lib/persist-config.ts
BioPhoton Oct 11, 2023
81e31b8
Update packages/utils/src/lib/git.spec.ts
BioPhoton Oct 11, 2023
8b4f7f8
Update packages/cli/src/lib/implementation/core-config-options.ts
BioPhoton Oct 11, 2023
18645cd
refactor(cli): fix merge
BioPhoton Oct 11, 2023
e2a6b6d
refactor(cli): remove schema
BioPhoton Oct 11, 2023
dcceb30
refactor(cli): adopt exec target
BioPhoton Oct 11, 2023
dd9ca67
Update packages/cli/README.md
BioPhoton Oct 11, 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 .gitignore
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
Expand Down
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' }),
],
};
13 changes: 13 additions & 0 deletions examples/cli-e2e/mocks/code-pushup.config.mjs
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' }),
],
};
13 changes: 13 additions & 0 deletions examples/cli-e2e/mocks/code-pushup.config.ts
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' }),
],
};
12 changes: 0 additions & 12 deletions examples/cli-e2e/mocks/config.mock.mjs

This file was deleted.

12 changes: 0 additions & 12 deletions examples/cli-e2e/mocks/config.mock.ts

This file was deleted.

1 change: 1 addition & 0 deletions examples/cli-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
}
}
},
"implicitDependencies": ["cli", "plugin-eslint", "plugin-lighthouse"],
"tags": ["scope:core", "scope:plugin", "type:e2e"]
}
48 changes: 19 additions & 29 deletions examples/cli-e2e/tests/cli.spec.ts
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') });
});
});
18 changes: 9 additions & 9 deletions examples/cli-e2e/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"include": [
"vite.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
"tests/**/*.test.ts",
"tests/**/*.spec.ts",
"tests/**/*.test.tsx",
"tests/**/*.spec.tsx",
"tests/**/*.test.js",
"tests/**/*.spec.js",
"tests/**/*.test.jsx",
"tests/**/*.spec.jsx",
"tests/**/*.d.ts"
]
}
Loading