Skip to content

Commit

Permalink
Making *only* cli-lib use vite/vitest seems to work -- now to figure …
Browse files Browse the repository at this point in the history
…out how to integrate into Bazel
  • Loading branch information
NullVoxPopuli committed Apr 10, 2024
1 parent fca8aba commit ba6a867
Show file tree
Hide file tree
Showing 18 changed files with 1,340 additions and 399 deletions.
2 changes: 1 addition & 1 deletion .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
},
"keepClassNames": false
}
}
}
17 changes: 16 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
const config = {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
dynamicImport: true,
topLevelAwait: true,
importMeta: true,
},
target: 'es2022',
},
}
module.exports = {
testEnvironment: 'node',
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
'^.+\\.m?(t|j)sx?$': ['@swc/jest', config],
'^.+\\.m(t|j)s$': ['@swc/jest', config],
},
verbose: true,
moduleFileExtensions: ['js', 'jsx', 'mjs', 'ts', 'tsx', 'mts'],
extensionsToTreatAsEsm: ['.mts'],
}
2 changes: 1 addition & 1 deletion packages/cli-lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ npm_package(
visibility = ["//visibility:public"],
)

SRCS = glob(["src/**/*.ts"]) + [
SRCS = glob(["src/**/*.ts", "src/**/*.mts"]) + [
"index.ts",
"main.ts",
# "package.json",
Expand Down
7 changes: 7 additions & 0 deletions packages/cli-lib/main.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

'use strict'

import cli from './src/cli.js'

cli.default(process.argv)
5 changes: 0 additions & 5 deletions packages/cli-lib/main.ts

This file was deleted.

5 changes: 5 additions & 0 deletions packages/cli-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@
},
"engines": {
"node": ">= 16"
},
"devDependencies": {
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.1",
"vitest": "^1.4.0"
}
}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ba6a867

Please sign in to comment.