Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(vitest, tsup): use built file #292

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 configs/eslint-config-ts/noimport.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ module.exports = {
'jsdoc/require-returns': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/check-param-names': 'error',
'jsdoc/check-tag-names': 'off',
'jsdoc/no-types': 'off',
},
}
1 change: 0 additions & 1 deletion configs/tsup/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
module.exports = {
root: true,
extends: ['@suspensive/eslint-config-ts'],
ignorePatterns: ['*.js*', 'dist', 'coverage'],
}
11 changes: 4 additions & 7 deletions configs/tsup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
"name": "@suspensive/tsup",
"version": "0.0.0",
"private": true,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "rimraf ./dist",
"lint": "eslint .",
"prepack": "pnpm build",
"type:check": "tsc --noEmit"
"lint": "eslint ."
}
}
2 changes: 2 additions & 0 deletions configs/tsup/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Options } from 'tsup'
export declare const options: Options
5 changes: 2 additions & 3 deletions configs/tsup/src/index.ts → configs/tsup/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Options } from 'tsup'

export const options: Options = {
/** @type {import('tsup').Options} */
export const options = {
banner: { js: '"use client"' },
format: ['cjs', 'esm'],
entry: ['src/*.{ts,tsx}', '!**/*.{spec,test,test-d}.*'],
Expand Down
7 changes: 0 additions & 7 deletions configs/tsup/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/vitest/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
module.exports = {
root: true,
extends: ['@suspensive/eslint-config-ts'],
ignorePatterns: ['*.js*', 'dist', 'coverage'],
}
11 changes: 4 additions & 7 deletions configs/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
"name": "@suspensive/vitest",
"version": "0.0.0",
"private": true,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "rimraf ./dist",
"lint": "eslint .",
"prepack": "pnpm build",
"type:check": "tsc --noEmit"
"lint": "eslint ."
}
}
2 changes: 2 additions & 0 deletions configs/vitest/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { UserConfig } from 'vitest/config'
export declare const forPackage: (userConfig?: UserConfig) => UserConfig
7 changes: 5 additions & 2 deletions configs/vitest/src/index.ts → configs/vitest/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import fs from 'fs'
import path, { dirname } from 'path'
import type { UserConfig } from 'vitest/config'

export const forPackage = (userConfig?: UserConfig): UserConfig => {
/**
* @param {import('vitest').UserConfig} userConfig
* @returns {import('vitest').UserConfig}
*/
export const forPackage = (userConfig) => {
const packageJsonPath = path.resolve(dirname('.'), 'package.json')
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))

Expand Down
7 changes: 0 additions & 7 deletions configs/vitest/tsconfig.json

This file was deleted.

Loading