mirror of
https://github.com/cline/cline.git
synced 2025-06-03 03:59:07 +00:00

* add a matrix strategy for testing * Handle EOL on Windows * use bash as shell on every os and run the test-ci script * fix tsconfig path resolution using the __dirnname * print test results regardless of status * Limit artifact upload to Linux * update the test-cli * Add windows-specific dependencies as optional dependencies lightningcss-win32-x64-msvc rollup-win32-x64-msvc * Do not collect coverage on Windows * Use UTF-8 on the Python Scripts * force the ubuntu-latest name to be `test`
26 lines
825 B
JavaScript
26 lines
825 B
JavaScript
const tsConfigPaths = require("tsconfig-paths")
|
|
const fs = require("fs")
|
|
const path = require("path")
|
|
|
|
const baseUrl = path.resolve(__dirname)
|
|
|
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(baseUrl, "tsconfig.json"), "utf-8"))
|
|
|
|
/**
|
|
* The aliases point towards the `src` directory.
|
|
* However, `tsc` doesn't compile paths by itself
|
|
* (https://www.typescriptlang.org/docs/handbook/modules/reference.html#paths-does-not-affect-emit)
|
|
* So we need to use tsconfig-paths to resolve the aliases when running tests,
|
|
* but pointing to `out` instead.
|
|
*/
|
|
const outPaths = {}
|
|
Object.keys(tsConfig.compilerOptions.paths).forEach((key) => {
|
|
const value = tsConfig.compilerOptions.paths[key]
|
|
outPaths[key] = value.map((path) => path.replace("src", "out"))
|
|
})
|
|
|
|
tsConfigPaths.register({
|
|
baseUrl: baseUrl,
|
|
paths: outPaths,
|
|
})
|