Skip to content

Commit

Permalink
ci: run test on windows (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 6, 2023
1 parent cea19d6 commit d4fc228
Show file tree
Hide file tree
Showing 10 changed files with 3,393 additions and 2,969 deletions.
6 changes: 6 additions & 0 deletions .changeset/chilled-carrots-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@pkgr/rollup": patch
"@pkgr/utils": patch
---

fix: match correct package.json path on windows
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ on:

jobs:
ci:
name: Lint and Test with Node.js ${{ matrix.node }}
name: Lint and Test with Node.js ${{ matrix.node }} on ${{ matrix.os }}
strategy:
matrix:
node:
- 16
- 18
- 20
runs-on: ubuntu-latest
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "run-s build:ts build:r",
"build:r": "tsx packages/rollup/src/cli.ts -f cjs -d false",
"build:ts": "tsc -b",
"clean": "rimraf packages/*/{lib,*.tsbuildinfo}",
"clean": "rimraf --glob packages/*/{lib,*.tsbuildinfo}",
"lint": "run-p lint:*",
"lint:es": "eslint . --cache -f friendly",
"lint:tsc": "tsc --noEmit",
Expand All @@ -27,26 +27,26 @@
"typecov": "type-coverage"
},
"devDependencies": {
"@1stg/common-config": "^8.1.0",
"@1stg/common-config": "^9.0.0",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@changesets/cli": "^2.26.2",
"@types/cross-spawn": "^6.0.2",
"@types/debug": "^4.1.7",
"@types/debug": "^4.1.8",
"@types/imagemin": "^8.0.1",
"@types/is-glob": "^4.0.2",
"@types/jest": "^29.5.1",
"@types/jest": "^29.5.2",
"@types/lodash-es": "^4.17.7",
"@types/micromatch": "^4.0.2",
"@types/node": "^18.16.3",
"@types/prettier": "^2.7.2",
"jest": "^29.5.0",
"@types/node": "^20.4.0",
"@types/prettier": "^2.7.3",
"jest": "^29.6.0",
"patch-package": "^7.0.0",
"rimraf": "^5.0.0",
"ts-jest": "^29.1.0",
"rimraf": "^5.0.1",
"ts-jest": "^29.1.1",
"tsx": "^3.12.7",
"type-coverage": "^2.25.0",
"typescript": "^5.0.4",
"yarn-deduplicate": "^6.0.1"
"type-coverage": "^2.26.0",
"typescript": "^5.1.6",
"yarn-deduplicate": "^6.0.2"
},
"resolutions": {
"prettier": "^2.8.8"
Expand Down
4 changes: 2 additions & 2 deletions packages/imagemin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lib"
],
"dependencies": {
"fast-glob": "^3.2.12",
"fast-glob": "^3.3.0",
"imagemin": "^8.0.1",
"imagemin-gifsicle": "^7.0.0",
"imagemin-jpegtran": "^7.0.0",
Expand All @@ -37,7 +37,7 @@
"imagemin-upng": "^4.0.0",
"imagemin-webp": "^8.0.0",
"is-glob": "^4.0.3",
"tslib": "^2.5.0"
"tslib": "^2.6.0"
},
"publishConfig": {
"access": "public"
Expand Down
16 changes: 8 additions & 8 deletions packages/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@
"dependencies": {
"@pkgr/es-modules": "^0.6.3",
"@pkgr/umd-globals": "^0.8.3",
"@pkgr/utils": "^2.4.0",
"@pkgr/utils": "^2.4.1",
"@rollup/plugin-alias": "^5.0.0",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-url": "^8.0.1",
"builtin-modules": "^3.3.0",
"commander": "^10.0.1",
"core-js": "^3.30.1",
"commander": "^11.0.0",
"core-js": "^3.31.1",
"debug": "^4.3.4",
"esbuild": "^0.17.18",
"esbuild": "^0.18.11",
"is-glob": "^4.0.3",
"jsox": "^1.2.118",
"lodash-es": "^4.17.21",
"micromatch": "^4.0.5",
"rollup": "^3.21.3",
"rollup": "^3.26.1",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-unassert": "^0.6.0",
"rollup-plugin-vue": "^6.0.0",
"rollup-plugin-vue-jsx-compat": "^0.0.6",
"tslib": "^2.5.0",
"tslib": "^2.6.0",
"unassert": "^2.0.2"
},
"publishConfig": {
Expand Down
9 changes: 4 additions & 5 deletions packages/rollup/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import {
OutputOptions,
Plugin,
RollupOptions,
RollupWarning,
WarningHandler,
WarningHandlerWithDefault,
} from 'rollup'
import copy, { CopyOptions } from 'rollup-plugin-copy'
import esbuild, { Options as EsBuildOptions } from 'rollup-plugin-esbuild'
Expand Down Expand Up @@ -135,7 +134,7 @@ const tryRegExp = (exp: RegExp | string) => {
return exp
}

const onwarn = (warning: RollupWarning, warn: WarningHandler) => {
const onwarn: WarningHandlerWithDefault = (warning, warn) => {
if (warning.code === 'THIS_IS_UNDEFINED') {
return
}
Expand Down Expand Up @@ -215,7 +214,7 @@ ConfigOptions = {}): RollupOptions[] => {
)
: monorepoPkgs

pkgs = pkgs.map(pkg => pkg.replace(/\/package\.json$/, ''))
pkgs = pkgs.map(pkg => pkg.replace(/[/\\]package\.json$/, ''))

if (monorepo == null && pkgs.length === 0) {
pkgs = [CWD]
Expand Down Expand Up @@ -256,7 +255,7 @@ ConfigOptions = {}): RollupOptions[] => {
),
}

const configs = flatMap(pkgs, pkg => {
const configs: RollupOptions[] = flatMap(pkgs, pkg => {
const srcPath = path.resolve(pkg, 'src')

let pkgInput = input
Expand Down
1 change: 1 addition & 0 deletions packages/umd-globals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const asIsReducer = (
})

export const upperCamelCase = (pkg: string) =>
// eslint-disable-next-line unicorn/prefer-string-replace-all
pkg.replace(/(^|-)([a-z])/g, (_, _$1: string, $2: string) => $2.toUpperCase())

export const upperCamelCaseReducer = (
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
],
"dependencies": {
"cross-spawn": "^7.0.3",
"fast-glob": "^3.2.12",
"fast-glob": "^3.3.0",
"is-glob": "^4.0.3",
"open": "^9.1.0",
"picocolors": "^1.0.0",
"tslib": "^2.5.0"
"tslib": "^2.6.0"
},
"publishConfig": {
"access": "public"
Expand Down
14 changes: 8 additions & 6 deletions packages/utils/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ export const tryGlob = (
[
...acc,
...(isGlob(pkg)
? tryRequirePkg<typeof import('fast-glob')>('fast-glob')!.sync(pkg, {
absolute,
cwd: baseDir,
ignore,
onlyFiles: false,
})
? tryRequirePkg<typeof import('fast-glob')>('fast-glob')!
.sync(pkg, {
cwd: baseDir,
ignore,
onlyFiles: false,
})
// https://github.com/mrmlnc/fast-glob/issues/379
.map(file => (absolute ? path.resolve(baseDir, file) : file))
: [tryFile(path.resolve(baseDir, pkg), true)]),
].filter(Boolean),
[],
Expand Down

0 comments on commit d4fc228

Please sign in to comment.