nuxt-users 1.28.0 → 1.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,27 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.28.1
5
+
6
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.28.0...v1.28.1)
7
+
8
+ ### 🩹 Fixes
9
+
10
+ - Composables are initialized on mount ([b25eb95](https://github.com/rrd108/nuxt-users/commit/b25eb95))
11
+ - Lost reactivity ([8049526](https://github.com/rrd108/nuxt-users/commit/8049526))
12
+
13
+ ### 🏡 Chore
14
+
15
+ - **release:** V1.28.0 ([4f6370d](https://github.com/rrd108/nuxt-users/commit/4f6370d))
16
+ - Rename default to users ([4f5345a](https://github.com/rrd108/nuxt-users/commit/4f5345a))
17
+ - Change info comment ([56c3d35](https://github.com/rrd108/nuxt-users/commit/56c3d35))
18
+ - Comment out ([2534222](https://github.com/rrd108/nuxt-users/commit/2534222))
19
+ - Remove unsused import ([cddaf9c](https://github.com/rrd108/nuxt-users/commit/cddaf9c))
20
+
21
+ ### ❤️ Contributors
22
+
23
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
24
+
4
25
  ## v1.28.0
5
26
 
6
27
  [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.27.0...v1.28.0)
package/dist/cli.mjs CHANGED
@@ -15,7 +15,7 @@ const getOptionsFromEnv = () => {
15
15
  switch (connectorName) {
16
16
  case "sqlite":
17
17
  connectorOptions = {
18
- path: process.env.DB_PATH || "./data/default.sqlite3"
18
+ path: process.env.DB_PATH || "./data/users.sqlite3"
19
19
  };
20
20
  break;
21
21
  case "mysql":
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
3
  "configKey": "nuxtUsers",
4
- "version": "1.28.0",
4
+ "version": "1.28.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { onMounted, computed } from "vue";
2
+ import { onMounted, computed, ref } from "vue";
3
3
  import { useUsers } from "../composables/useUsers";
4
4
  import { defaultDisplayFields, defaultFieldLabels } from "nuxt-users/utils";
5
5
  defineProps({
@@ -7,26 +7,26 @@ defineProps({
7
7
  fieldLabels: { type: Object, required: false, default: () => defaultFieldLabels }
8
8
  });
9
9
  const emit = defineEmits(["editClick", "delete"]);
10
- let usersComposable = null;
11
- const users = computed(() => usersComposable?.users.value ?? []);
12
- const pagination = computed(() => usersComposable?.pagination.value ?? null);
13
- const loading = computed(() => usersComposable?.loading.value ?? false);
14
- const error = computed(() => usersComposable?.error.value ?? null);
15
- onMounted(() => {
16
- usersComposable = useUsers();
10
+ const usersComposable = ref(null);
11
+ const users = computed(() => usersComposable.value?.users ?? []);
12
+ const pagination = computed(() => usersComposable.value?.pagination ?? null);
13
+ const loading = computed(() => usersComposable.value?.loading ?? false);
14
+ const error = computed(() => usersComposable.value?.error ?? null);
15
+ onMounted(async () => {
16
+ usersComposable.value = useUsers();
17
17
  if (users.value.length === 0) {
18
- usersComposable.fetchUsers();
18
+ usersComposable.value?.fetchUsers();
19
19
  }
20
20
  });
21
21
  const handleDelete = (user) => {
22
- if (usersComposable) {
23
- usersComposable.removeUser(user.id);
22
+ if (usersComposable.value) {
23
+ usersComposable.value?.removeUser(user.id);
24
24
  }
25
25
  emit("delete", user);
26
26
  };
27
27
  const handleFetchUsers = (page, limit) => {
28
- if (usersComposable) {
29
- usersComposable.fetchUsers(page, limit);
28
+ if (usersComposable.value) {
29
+ usersComposable.value.fetchUsers(page, limit);
30
30
  }
31
31
  };
32
32
  </script>
@@ -16,12 +16,12 @@ type __VLS_Slots = {} & {
16
16
  default?: (props: typeof __VLS_1) => any;
17
17
  };
18
18
  declare const __VLS_component: import("vue").DefineComponent<LogoutLinkProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
- click: () => any;
20
19
  error: (error: string) => any;
20
+ click: () => any;
21
21
  success: () => any;
22
22
  }, string, import("vue").PublicProps, Readonly<LogoutLinkProps> & Readonly<{
23
- onClick?: (() => any) | undefined;
24
23
  onError?: ((error: string) => any) | undefined;
24
+ onClick?: (() => any) | undefined;
25
25
  onSuccess?: (() => any) | undefined;
26
26
  }>, {
27
27
  redirectTo: string;
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, onMounted } from "vue";
2
+ import { computed, onMounted, ref } from "vue";
3
3
  import { useAuthentication } from "../composables/useAuthentication";
4
4
  import { useRuntimeConfig } from "#imports";
5
5
  import { defaultDisplayFields, defaultFieldLabels } from "nuxt-users/utils";
@@ -11,10 +11,10 @@ const props = defineProps({
11
11
  });
12
12
  const emit = defineEmits(["delete", "editClick"]);
13
13
  const { public: { nuxtUsers } } = useRuntimeConfig();
14
- let authComposable = null;
15
- const currentUser = computed(() => authComposable?.user.value ?? null);
16
- onMounted(() => {
17
- authComposable = useAuthentication();
14
+ const authComposable = ref(null);
15
+ const currentUser = computed(() => authComposable.value?.user ?? null);
16
+ onMounted(async () => {
17
+ authComposable.value = useAuthentication();
18
18
  });
19
19
  const canEdit = computed(() => {
20
20
  if (!currentUser.value) return false;
@@ -3,12 +3,12 @@ interface Props {
3
3
  user?: User | null;
4
4
  }
5
5
  declare const _default: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
- cancel: () => any;
7
6
  error: (error: unknown) => any;
7
+ cancel: () => any;
8
8
  submit: (userData: User) => any;
9
9
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
10
- onCancel?: (() => any) | undefined;
11
10
  onError?: ((error: unknown) => any) | undefined;
11
+ onCancel?: (() => any) | undefined;
12
12
  onSubmit?: ((userData: User) => any) | undefined;
13
13
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
4
4
  "description": "A comprehensive user management module for Nuxt 3 and Nuxt 4 applications with authentication, authorization, database support, and CLI tools",
5
5
  "keywords": [
6
6
  "nuxt",