Skip to content
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
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig.json');

/** @typedef {import('ts-jest/dist/types')} */
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
rootDir: './',
transform: {
'^.+\\.[t]sx?$': 'ts-jest'
},
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/index.ts'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vacl",
"version": "0.1.3",
"version": "0.1.4",
"description": "A Lightweight Typescript ACL directives library for Vue 3",
"files": [
"dist"
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
import { terser } from 'rollup-plugin-terser';
import bundleSize from 'rollup-plugin-bundle-size';
import path from "path";

export default {
input: 'src/index.ts',
Expand All @@ -20,6 +21,9 @@ export default {
external: [
...Object.keys(pkg.dependencies || {})
],
alias: {
'@/': path.resolve(__dirname, '/src/')
},
plugins: [
typescript({
typescript: require('typescript'),
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ACL.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ACL from '../../src/lib/ACL';
import ACL from '@/lib/ACL';

describe('aCL', () => {
it('can_be_instantiated', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/vue/ACL.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mount } from '@vue/test-utils';
import { createApp, h } from 'vue';
import ACL from '../../src/lib/ACL';
import Vacl from '../../src/index';
import ACL from '@/lib/ACL';
import Vacl from '@/index';

describe('reactivity', () => {
it('can be installed correctly', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/vue/Directives.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { VueWrapper } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import ACL from '../../src/lib/ACL';
import { can, cannot, has, hasnt } from '../../src/lib/Directives';
import ACL from '@/lib/ACL';
import { can, cannot, has, hasnt } from '@/lib/Directives';

/******************************************************************************
* PERMISSIONS
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"declaration": true,
"declarationDir": "types",
"declarationMap": true,

"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
},
"module": "ES2015",
"rootDir": "src",
"preserveConstEnums": false,
Expand Down