Skip to content

Commit

Permalink
Merge pull request #43 from webdevnerdstuff/vitest
Browse files Browse the repository at this point in the history
Vitest
  • Loading branch information
webdevnerdstuff committed Jan 5, 2024
2 parents 07c6af3 + da6b820 commit d00c3fb
Show file tree
Hide file tree
Showing 36 changed files with 2,081 additions and 201 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2

[*.{js,ts,vue}]
[*.{js,ts,mts,vue}]
indent_size = 2
indent_style = tab

Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged && npm run test:commit
26 changes: 13 additions & 13 deletions dist/plugin/VCodeBlock.vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,44 +60,44 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
onRun?: ((...args: any[]) => any) | undefined;
"onUpdate:copy-status"?: ((...args: any[]) => any) | undefined;
}, {
persistentCopyButton: boolean;
highlightjs: boolean;
floatingTabs: boolean;
tabGap: string | number;
copyTab: boolean;
height: string | number;
maxHeight: string | number;
codeBlockRadius: string;
runTab: boolean;
tabs: boolean;
prismjs: boolean;
browserWindow: boolean;
cssPath: string;
code: string | number | object | [];
codeBlockRadius: string;
copyButton: boolean;
copyIcons: boolean;
copyTab: boolean;
copyFailedText: string;
copyText: string;
copySuccessText: string;
floatingTabs: boolean;
height: string | number;
indent: number;
label: string;
lang: string;
prismjs: boolean;
maxHeight: string | number;
persistentCopyButton: boolean;
prismPlugin: boolean;
runTab: boolean;
runText: string;
tabGap: string | number;
tabs: boolean;
theme: string | boolean;
}, {}>, {
label?(_: {
copyCode: typeof copyCode;
copyStatus: string;
copyStatus: "copy" | "success" | "failed";
runCode: typeof runCode;
}): any;
tabs?(_: {
copyCode: typeof copyCode;
copyStatus: string;
copyStatus: "copy" | "success" | "failed";
runCode: typeof runCode;
}): any;
copyButton?(_: {
copyStatus: string;
copyStatus: "copy" | "success" | "failed";
}): any;
}>;
export default _default;
Expand Down
3 changes: 2 additions & 1 deletion dist/plugin/composables/helpers.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { UseConvertToUnit } from '../../plugin/types';
/**
* Converts a string to a number with a unit.
*/
export declare function useConvertToUnit(str: string | number | undefined | null, unit?: string): string | void;
export declare const useConvertToUnit: UseConvertToUnit;
4 changes: 3 additions & 1 deletion dist/plugin/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { App } from 'vue';
import type { Props } from './types';
import VCodeBlock from './VCodeBlock.vue';
export declare const codeBlockOptions: unique symbol;
export declare function createVCodeBlock(options?: Props): (app: App) => void;
export declare function createVCodeBlock(options?: Props): {
install: (app: App) => void;
};
export default VCodeBlock;
export { VCodeBlock, };
11 changes: 9 additions & 2 deletions dist/plugin/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CSSProperties, MaybeRef } from 'vue';
import VCodeBlock from '../VCodeBlock.vue';
export * from '../index';
export type UseTheme = MaybeRef<string | boolean>;
export type CopyStatus = MaybeRef<'copy' | 'success' | 'failed'>;
export interface Props {
browserWindow?: boolean;
cssPath?: string | undefined;
Expand Down Expand Up @@ -31,6 +32,12 @@ export interface Props {
tabs?: boolean;
theme?: string | boolean;
}
export interface UseConvertToUnit {
(options: {
str: string | number | undefined | null;
unit?: string;
}): string | void;
}
export interface UseCodeBlockClasses {
(options: {
isMobile: MaybeRef<boolean>;
Expand All @@ -39,14 +46,14 @@ export interface UseCodeBlockClasses {
}
export interface UseCopyButtonClasses {
(options: {
copyStatus: MaybeRef<string>;
copyStatus: CopyStatus;
isMobile: MaybeRef<boolean>;
persistentCopyButton: MaybeRef<Props['persistentCopyButton']>;
}): object;
}
export interface UseIconClasses {
(options: {
copyStatus: MaybeRef<string>;
copyStatus: CopyStatus;
highlightjs: MaybeRef<Props['highlightjs']>;
useTheme: UseTheme;
}): object;
Expand Down
16 changes: 8 additions & 8 deletions dist/vue-code-block.cjs.js

Large diffs are not rendered by default.

257 changes: 129 additions & 128 deletions dist/vue-code-block.es.js

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
"play": "sh src/playground/configs/build.sh && NODE_ENV=playground vite",
"sass": "sass --watch --no-source-map src/plugin/themes/scss/:src/plugin/themes/css",
"sass:min": "sass --style compressed --watch --no-source-map src/plugin/themes/scss/:src/plugin/themes/css/min",
"build": "vue-tsc && vite build --config vite.build.config.ts",
"build": "vue-tsc -p tsconfig.dist.json && npm run test:build && vite build --config vite.build.config.mts",
"build:docs": "vite build",
"predeploy": "npm run build",
"deploy": "gh-pages -d docs",
"prepublishOnly": "npm run build",
"lint": "eslint src/**/*.{ts,vue} --max-warnings 4",
"prepare": "husky install"
"prepare": "husky install",
"test": "vitest",
"test:commit": "vitest --run --bail 1",
"test:build": "vitest --run --bail 1 --reporter dot"
},
"lint-staged": {
"src/**/*.{js,ts,vue}": [
Expand Down Expand Up @@ -94,6 +97,7 @@
"@vue/cli-service": "^5.0.8",
"@vue/compiler-sfc": "^3.3.9",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/test-utils": "^2.4.3",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -102,6 +106,7 @@
"eslint-plugin-vue": "^9.19.2",
"gh-pages": "^6.1.0",
"husky": "^8.0.3",
"jsdom": "^23.0.1",
"lint-staged": "^15.0.2",
"pinia": "^2.1.7",
"postcss": "^8.4.32",
Expand All @@ -119,13 +124,14 @@
"stylelint-scss": "^5.3.1",
"typescript": "^5.3.2",
"unplugin-auto-import": "^0.17.1",
"vite": "^4.5.0",
"vite": "^4.5.1",
"vite-plugin-css-injected-by-js": "^3.3.0",
"vite-plugin-dts": "^3.6.4",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-static-copy": "^0.17.0",
"vite-plugin-stylelint": "^5.2.1",
"vite-plugin-vuetify": "^1.0.2",
"vitest": "^1.0.4",
"vue-tsc": "^1.8.24",
"vuetify": "^3.4.4",
"webfontloader": "^1.6.28"
Expand Down
Loading

0 comments on commit d00c3fb

Please sign in to comment.