diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80cfdec..ecaf49b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,12 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: node-version: [12.x] + os: [windows-latest, ubuntu-latest] steps: - uses: actions/checkout@v2 diff --git a/scripts/tools/copyPackageSet.ts b/scripts/tools/copyPackageSet.ts index bdd6a30..cb4af1c 100644 --- a/scripts/tools/copyPackageSet.ts +++ b/scripts/tools/copyPackageSet.ts @@ -11,9 +11,9 @@ export const copyPackageSet = async (): Promise => { const libDir = "lib"; const publishPackageJson = path.join(libDir, "package.json"); pkg.private = undefined; - pkg.main = path.relative(libDir, pkg.main); - pkg.module = path.relative(libDir, pkg.module); - pkg.types = path.relative(libDir, pkg.types); + pkg.main = path.posix.relative(libDir, pkg.main); + pkg.module = path.posix.relative(libDir, pkg.module); + pkg.types = path.posix.relative(libDir, pkg.types); pkg.directories = undefined; pkg.files = undefined; fs.writeFileSync(publishPackageJson, JSON.stringify(pkg, null, 2), { diff --git a/src/Utils.ts b/src/Utils.ts index 803366c..e45da48 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -1,9 +1,20 @@ -import { normalize } from "path"; - export const generateKey = (kind: string, name: string): string => { return `${kind}:${name}`; }; export const split = (p: string, delimiter: string): string[] => { - return normalize(p).split(delimiter); + const array = []; + for (const seg of p.split(delimiter)) { + switch (seg) { + case ".": + break; + case "..": + array.pop(); + break; + default: + array.push(seg); + break; + } + } + return array; };