Skip to content

Commit

Permalink
feat: replace uuid and fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
arcs- committed Feb 22, 2024
1 parent 9590583 commit 4e51420
Show file tree
Hide file tree
Showing 13 changed files with 847 additions and 111 deletions.
48 changes: 47 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
module.exports = {
extends: ['./packages/eslint-config/base'],

root: true,
ignorePatterns: ['dist/', 'node_modules/', '*.json', '.temp/'],

settings: {
'import/resolver': {
typescript: {},
alias: {
map: [
['@', './src'],
['@images', './src/assets/images'],
],
},
},
},

parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},

extends: ['eslint-config-airbnb-base'],
rules: {
'func-names': 'off',
'no-console': 'warn',
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'no-unreachable': 'warn',
'no-unused-vars': 'warn',
'import/extensions': [
'warn', { ts: 'never' },
],
'import/no-extraneous-dependencies': [
'warn', { devDependencies: true },
],
},

overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
},
],

env: {
browser: true,
},
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"packageManager": "[email protected]",
"scripts": {
"preinstall": "git config core.hooksPath hooks",
"build": "npm run build --workspaces --if-present",
"build": "npm run build",
"watch": "npm run build && esno ./scripts/runAll watch",
"typecheck": "tsc --noEmit",
"docs:dev": "vitepress dev --port 3000",
Expand All @@ -22,12 +22,14 @@
],
"devDependencies": {
"@types/lodash-es": "^4.17.6",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/cli-service": "^5.0.8",
"@vue/compiler-sfc": "^3.2.47",
"autoprefixer": "^10.4.13",
"concurrently": "^7.6.0",
"eslint": "^8.35.0",
"eslint-config-airbnb-base": "^15.0.0",
"esno": "^0.16.3",
"flexsearch": "^0.7.31",
"glob": "^9.3.0",
Expand Down
8 changes: 3 additions & 5 deletions packages/animations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teamnovu/kit-animations",
"version": "1.2.0",
"version": "1.2.1",
"description": "Animations for novu",
"files": [
"dist"
Expand Down Expand Up @@ -35,11 +35,9 @@
"homepage": "https://gitlab.com/JKwebGmbH/jktools#readme",
"dependencies": {
"@vueuse/core": "^10.1.0",
"uuid": "^9.0.0",
"uuid-browser": "^3.1.0"
"nanoid": "^5.0.6"
},
"devDependencies": {
"@types/node": "^18.18.6",
"@types/uuid-browser": "^3.1.0"
"@types/node": "^18.18.6"
}
}
4 changes: 2 additions & 2 deletions packages/animations/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-underscore-dangle */
import type { App, Directive, DirectiveBinding } from 'vue';
import uuid from 'uuid-browser/v4';
import { nanoid } from 'nanoid'
import createInstance, { createContext } from './impl';
import type { Animation, Options, ScrollContainer } from './types';
import defaultAnimations from './animations';
Expand Down Expand Up @@ -30,7 +30,7 @@ export const create = (options: Options = {}): CreateResult => {
element: any,
bind: DirectiveBinding<Animation>,
) => {
const id = element.__jkAnimateId || `jk-animate-id-${uuid()}`;
const id = element.__jkAnimateId || `jk-animate-id-${nanoid()}`;
// eslint-disable-next-line no-param-reassign
element.__jkAnimateId = id;

Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teamnovu/kit-components",
"version": "1.0.11",
"version": "1.0.12",
"description": "A collection of vue(3) components for jkweb",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -43,6 +43,6 @@
"@teamnovu/kit-composables": "workspace:*",
"@vueuse/core": "^9.13.0",
"lodash-es": "^4.17.21",
"uuid-browser": "^3.1.0"
"nanoid": "^5.0.6"
}
}
4 changes: 2 additions & 2 deletions packages/components/src/Collapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
type EasingFunction,
type MaybeRef,
} from "@vueuse/core";
import uuid from "uuid-browser/v4";
import { nanoid } from 'nanoid'
// #region Types
Expand All @@ -42,7 +42,7 @@ const emit = defineEmits(["update:open"]);
const collapseRef = ref<HTMLElement>();
const isTransitioning = ref(false);
const id = uuid();
const id = nanoid();
const isOpen = useCollapse(collapseRef, {
...omit(props, ["open"]),
id,
Expand Down
9 changes: 3 additions & 6 deletions packages/composables/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teamnovu/kit-composables",
"version": "1.1.3",
"version": "1.1.4",
"description": "A collection of composables",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -32,12 +32,9 @@
"dependencies": {
"@vueuse/core": "^9.13.0",
"lodash-es": "^4.17.21",
"uuid": "^9.0.0",
"uuid-browser": "^3.1.0"
"nanoid": "^5.0.6"
},
"devDependencies": {
"@types/node": "^18.16.1",
"@types/uuid": "^9.0.1",
"@types/uuid-browser": "^3.1.0"
"@types/node": "^18.16.1"
}
}
4 changes: 2 additions & 2 deletions packages/composables/src/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
provide,
nextTick,
} from 'vue';
import uuid from 'uuid-browser/v4';
import { nanoid } from 'nanoid'
import { useCollapseController } from './injects/collapseController';
import { collapseContextKey } from './injects/collapseContext';

Expand All @@ -31,7 +31,7 @@ export default function useCollapsable(
elm?: HTMLElement | Ref<HTMLElement | undefined>,
options?: CollapseOptions,
) {
const id = options?.id ?? uuid() as string;
const id = options?.id ?? nanoid() as string;
const dimension = computed(() => options?.dimension ?? 'height');

const baseState = ref(options?.initiallyClosed ? 0 : 100);
Expand Down
5 changes: 4 additions & 1 deletion packages/cookieconsent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teamnovu/kit-cookieconsent",
"version": "3.0.3",
"version": "3.0.4",
"description": "A Vue wrapper for Cookie Consent",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -31,5 +31,8 @@
"@vueuse/core": "^10.5.0",
"defu": "^6.1.3",
"vanilla-cookieconsent": "^3.0.0-rc.15"
},
"devDependencies": {
"@nuxt/schema": "^3.10.2"
}
}
5 changes: 4 additions & 1 deletion packages/cookieconsent/src/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import {
addImports,
defineNuxtModule,
} from '@nuxt/kit';
import type { NuxtModule } from '@nuxt/schema';
import type { CookieConsentConfig } from './types';

export default defineNuxtModule<CookieConsentConfig>({
const module: NuxtModule<CookieConsentConfig> = defineNuxtModule<CookieConsentConfig>({

meta: {
name: '@teamnovu/kit-cookieconsent',
Expand Down Expand Up @@ -39,3 +40,5 @@ export default defineNuxtModule<CookieConsentConfig>({
},

});

export default module;
9 changes: 6 additions & 3 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teamnovu/kit-nuxt",
"version": "1.1.3",
"version": "1.1.4",
"exports": {
".": {
"import": "./src/module.ts"
Expand All @@ -10,9 +10,12 @@
"nuxt": "^3.0.0"
},
"dependencies": {
"@nuxt/kit": "^3.8.0",
"@teamnovu/kit-animations": "workspace:*",
"@teamnovu/kit-composables": "workspace:*",
"@teamnovu/kit-components": "workspace:*",
"@nuxt/kit": "^3.8.0"
"@teamnovu/kit-composables": "workspace:*"
},
"devDependencies": {
"@nuxt/schema": "^3.10.2"
}
}
5 changes: 4 additions & 1 deletion packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
createResolver,
addImportsDir,
} from '@nuxt/kit';
import type { NuxtModule } from '@nuxt/schema';
import * as Components from '@teamnovu/kit-components';
import * as Composables from '@teamnovu/kit-composables';
import { type Options as AnimationsOptions } from '@teamnovu/kit-animations';
Expand All @@ -26,7 +27,7 @@ export interface JktoolsNuxtOptions {
* }
* ```
*/
export default defineNuxtModule<JktoolsNuxtOptions>({
const module: NuxtModule<JktoolsNuxtOptions> = defineNuxtModule<JktoolsNuxtOptions>({
meta: {
name: 'jktools',
configKey: 'jktools',
Expand Down Expand Up @@ -74,3 +75,5 @@ declare module '@nuxt/schema' {
jktools?: JktoolsNuxtOptions
}
}

export default module;
Loading

0 comments on commit 4e51420

Please sign in to comment.