@gluhar/core 4.2.0 → 6.0.0-next.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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.0.0-next.1](https://github.com/gluharco/gluhar/compare/v6.0.0-next.0...v6.0.0-next.1) (2026-10-20)
7
+
8
+
9
+ ### 🚀 Enhancements
10
+
11
+ - **release:** Publish from GitHub Actions with npm trusted publishing ([8773cd9](https://github.com/gluharco/gluhar/commit/8773cd99c43cbe6a7dc415e50af8b13a7b8d4daf))
12
+
13
+
14
+
15
+
16
+
6
17
  # [4.2.0](https://github.com/gluharco/gluhar/compare/@gluhar/core@4.1.5...@gluhar/core@4.2.0) (2026-04-28)
7
18
 
8
19
 
package/README.md CHANGED
@@ -20,39 +20,33 @@ My new Nuxt module for doing amazing things.
20
20
  <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
21
  <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
22
 
23
- ## Features
23
+ Shared composables and utils, installed by `@gluhar/app`. Installs `@nuxtjs/device`.
24
24
 
25
- <!-- Highlight some of the features your module provide here -->
26
- - ⛰ &nbsp;Foo
27
- - 🚠 &nbsp;Bar
28
- - 🌲 &nbsp;Baz
25
+ ## `useResponsive()`
29
26
 
30
- ## Quick Setup
27
+ The one breakpoint composable for every gluhar project. It replaces the project-level `useMobile` copies.
31
28
 
32
- 1. Add `my-module` dependency to your project
29
+ **For behaviour only** — event handlers, GSAP/ScrollTrigger setup, measuring. Responsive layout is Tailwind variants in the template; never put a width flag in `v-if` / `:class`.
33
30
 
34
- ```bash
35
- # Using pnpm
36
- pnpm add -D my-module
37
-
38
- # Using yarn
39
- yarn add --dev my-module
31
+ ```ts
32
+ const { isMobileDevice, mounted, mobile, tablet, desktop, touch, up, down, between } =
33
+ useResponsive();
40
34
 
41
- # Using npm
42
- npm install --save-dev my-module
35
+ const nav = up("nav"); // any --breakpoint-* the project declares
36
+ onMounted(() => {
37
+ if (desktop.value) initParallax(); // already correct here
38
+ });
43
39
  ```
44
40
 
45
- 2. Add `my-module` to the `modules` section of `nuxt.config.ts`
46
-
47
- ```js
48
- export default defineNuxtConfig({
49
- modules: [
50
- 'my-module'
51
- ]
52
- })
53
- ```
41
+ | | Source | On the server | Safe in markup |
42
+ |---|---|---|---|
43
+ | `isMobileDevice` | user agent | real value | yes — but it's a device guess, not a width |
44
+ | `mobile` `tablet` `desktop` `wide` `touch` `tabletExact` `desktopExact` `up()` `down()` `between()` | viewport width | `false` | no |
54
45
 
55
- That's it! You can now use My Module in your Nuxt app ✨
46
+ - Width flags stay `false` through the first hydration so server and client renders agree, then switch on in the composable's own `onMounted` — before any `onMounted` you register after calling it. Components created after hydration get live values immediately.
47
+ - Breakpoints are the project's `--breakpoint-*` CSS values (read by `@gluhar/theme`), defaulting to `tablet` 768 / `desktop` 1200 / `wide` 2000.
48
+ - `>=` comparisons, like CSS `min-width`: `tablet` and `tablet:` agree at every width, including exactly 768.
49
+ - `mobile` = below `tablet`; `touch` = below `desktop` (a width, not touch capability).
56
50
 
57
51
  ## Development
58
52
 
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@gluhar/core",
3
- "version": "4.2.0",
3
+ "version": "6.0.0-next.1",
4
4
  "description": "Gluhar Core packages.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/gluharco/gluhar.git",
8
+ "directory": "packages/core"
9
+ },
5
10
  "type": "module",
6
11
  "exports": {
7
12
  ".": {
8
- "types": "./dist/types.d.ts",
9
- "import": "./dist/module.mjs",
10
- "require": "./dist/module.cjs"
13
+ "types": "./dist/types.d.mts",
14
+ "import": "./dist/module.mjs"
11
15
  },
12
16
  "./utils/*": {
13
17
  "types": "./dist/runtime/utils/*.d.ts",
@@ -17,8 +21,8 @@
17
21
  "types": "./dist/runtime/types/index.d.ts"
18
22
  }
19
23
  },
20
- "main": "./dist/module.cjs",
21
- "types": "./dist/types.d.ts",
24
+ "main": "./dist/module.mjs",
25
+ "types": "./dist/types.d.mts",
22
26
  "files": [
23
27
  "dist",
24
28
  "CHANGELOG.md"
@@ -26,6 +30,7 @@
26
30
  "scripts": {
27
31
  "gluhar": "npm run gluhar --prefix ../.. -- --cwd=$PWD",
28
32
  "build": "npm run gluhar build -- -t module",
33
+ "prepack": "npm run build",
29
34
  "dev": "nuxi dev playground",
30
35
  "dev:build": "nuxi build playground",
31
36
  "dev:prepare": "nuxt-module-build build && nuxt-module-build prepare && nuxi prepare playground",
@@ -34,23 +39,25 @@
34
39
  "test:watch": "vitest watch"
35
40
  },
36
41
  "dependencies": {
37
- "@nuxt/kit": "^3.13.1",
42
+ "@nuxt/kit": "^4.5.0",
38
43
  "@nuxtjs/device": "^3.2.2",
39
- "@vueuse/core": "^11.0.3",
44
+ "@vueuse/core": "^14.1.0",
40
45
  "mlly": "^1.7.1"
41
46
  },
42
47
  "devDependencies": {
43
48
  "@nuxt/devtools": "latest",
44
- "@nuxt/eslint-config": "^0.5.6",
45
- "@nuxt/module-builder": "^0.8.3",
46
- "@nuxt/schema": "^3.13.1",
47
- "@nuxt/test-utils": "^3.14.1",
49
+ "@nuxt/eslint-config": "^1.9.0",
50
+ "@nuxt/module-builder": "^1.0.3",
51
+ "@nuxt/schema": "^4.5.0",
52
+ "@nuxt/test-utils": "^3.19.2",
48
53
  "@types/node": "^22.5.4",
49
54
  "changelogen": "^0.5.5",
50
55
  "copyfiles": "^2.4.1",
51
56
  "eslint": "^9.10.0",
52
- "nuxt": "^3.13.1",
53
- "vitest": "^2.0.5"
57
+ "nuxt": "^4.5.0",
58
+ "vitest": "^3.2.4"
54
59
  },
55
- "gitHead": "10ebf6500c71e1beeceece4de90467b26aa67a21"
60
+ "peerDependencies": {
61
+ "nuxt": "^4.5.0"
62
+ }
56
63
  }
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
package/dist/module.d.mts DELETED
@@ -1,7 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
- interface GluharCoreOptions {
4
- }
5
- declare const _default: _nuxt_schema.NuxtModule<GluharCoreOptions, GluharCoreOptions, false>;
6
-
7
- export { type GluharCoreOptions, _default as default };
package/dist/module.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
- interface GluharCoreOptions {
4
- }
5
- declare const _default: _nuxt_schema.NuxtModule<GluharCoreOptions, GluharCoreOptions, false>;
6
-
7
- export { type GluharCoreOptions, _default as default };
package/dist/module.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "name": "@gluhar/core",
3
- "configKey": "gluharCore",
4
- "version": "4.2.0",
5
- "builder": {
6
- "@nuxt/module-builder": "0.8.3",
7
- "unbuild": "2.0.0"
8
- }
9
- }
package/dist/module.mjs DELETED
@@ -1,18 +0,0 @@
1
- import { defineNuxtModule, createResolver, installModule, addImportsDir } from '@nuxt/kit';
2
-
3
- const module = defineNuxtModule({
4
- meta: {
5
- name: "@gluhar/core",
6
- configKey: "gluharCore"
7
- },
8
- // Default configuration options of the Nuxt module
9
- defaults: {},
10
- setup(options, nuxt) {
11
- const { resolve } = createResolver(import.meta.url);
12
- installModule("@nuxtjs/device");
13
- addImportsDir(resolve("runtime/composables"));
14
- addImportsDir(resolve("runtime/utils"));
15
- }
16
- });
17
-
18
- export { module as default };
@@ -1,3 +0,0 @@
1
- export declare const useClientOnly: () => {
2
- isClient: import("vue").Ref<boolean, boolean>;
3
- };
@@ -1,8 +0,0 @@
1
- import { onMounted, ref } from "vue";
2
- export const useClientOnly = () => {
3
- const mounted = ref(false);
4
- onMounted(() => {
5
- mounted.value = true;
6
- });
7
- return { isClient: mounted };
8
- };
@@ -1,9 +0,0 @@
1
- export declare const useResponsive: () => {
2
- mobile: import("vue").ComputedRef<boolean>;
3
- tablet: import("vue").Ref<boolean, boolean>;
4
- tabletExact: import("vue").ComputedRef<boolean>;
5
- desktop: import("vue").Ref<boolean, boolean>;
6
- desktopExact: import("vue").ComputedRef<boolean>;
7
- wide: import("vue").Ref<boolean, boolean>;
8
- touch: import("vue").ComputedRef<boolean>;
9
- };
@@ -1,26 +0,0 @@
1
- import { computed } from "#imports";
2
- import { useBreakpoints, breakpointsTailwind } from "@vueuse/core";
3
- import { useDevice } from "#imports";
4
- export const useResponsive = () => {
5
- const breakpoints = useBreakpoints({
6
- ...breakpointsTailwind,
7
- tablet: 768,
8
- desktop: 1200,
9
- wide: 2e3
10
- });
11
- const { isMobile } = useDevice();
12
- const mobile = computed(
13
- () => breakpoints.smaller("tablet").value || isMobile
14
- );
15
- const tablet = breakpoints.greater("tablet");
16
- const tabletExact = computed(
17
- () => breakpoints.isInBetween("tablet", "desktop")
18
- );
19
- const desktop = breakpoints.greater("desktop");
20
- const desktopExact = computed(
21
- () => breakpoints.isInBetween("desktop", "wide")
22
- );
23
- const touch = computed(() => !desktop.value);
24
- const wide = breakpoints.greater("wide");
25
- return { mobile, tablet, tabletExact, desktop, desktopExact, wide, touch };
26
- };
@@ -1,3 +0,0 @@
1
- import { breakpointsTailwind } from "@vueuse/core";
2
- export type NonNegativeInteger<T extends number> = number extends T ? never : `${T}` extends `-${string}` | `${string}.${string}` ? never : T;
3
- export type Breakpoint = keyof typeof breakpointsTailwind;
File without changes
@@ -1,10 +0,0 @@
1
- export declare const capitalize: (s: string) => string;
2
- export declare const envMode: () => "dev" | "prod";
3
- /**
4
- * Returns the base URL based on the environment mode.
5
- *
6
- * @param {string} baseUrl - The base URL to be used.
7
- * @returns {string | undefined} - The base URL if the environment mode is "prod", otherwise undefined.
8
- */
9
- export declare const useBaseUrl: (baseUrl: string) => string | undefined;
10
- export declare const asyncTimeout: (ms: number) => Promise<unknown>;
@@ -1,6 +0,0 @@
1
- export const capitalize = (s) => s && s[0].toUpperCase() + s.slice(1);
2
- export const envMode = () => process.env.NODE_ENV === "development" ? "dev" : "prod";
3
- export const useBaseUrl = (baseUrl) => {
4
- return envMode() === "prod" ? baseUrl : void 0;
5
- };
6
- export const asyncTimeout = (ms) => new Promise((res) => setTimeout(res, ms));
@@ -1,4 +0,0 @@
1
- export declare const readModule: <T extends Record<string, any>>(path: string | undefined, options?: {
2
- cwd?: boolean;
3
- default?: boolean;
4
- }) => Promise<T>;
@@ -1,13 +0,0 @@
1
- import { readFileSync } from "fs";
2
- import { join } from "path";
3
- import { evalModule } from "mlly";
4
- export const readModule = async (path, options = { cwd: true }) => {
5
- if (!path) throw new Error("[@gluhar/core] readModule | No path provided.");
6
- const p = options?.cwd ? join(process.cwd(), path) : path;
7
- const file = readFileSync(p)?.toString();
8
- if (!file)
9
- throw new Error("[@gluhar/core] readModule | File not found on path: " + p);
10
- const sanitizedFile = file.replaceAll(" as const", "");
11
- const module = await evalModule(sanitizedFile);
12
- return options?.default ? module.default : module;
13
- };
@@ -1,6 +0,0 @@
1
- import type { NonNegativeInteger } from "../types.js";
2
- export declare const getRandomInt: (max?: number) => number;
3
- export declare const getRandomBetween: (min: number, max: number) => number;
4
- export declare const getRandomDigits: <N extends number>(count: NonNegativeInteger<N>) => number;
5
- export declare const getRandomHex: <N extends number>(count?: NonNegativeInteger<N>) => string;
6
- export declare const getUuid: () => string;
@@ -1,5 +0,0 @@
1
- export const getRandomInt = (max = 100) => Math.floor(Math.random() * max);
2
- export const getRandomBetween = (min, max) => getRandomInt(max - min + 1) + min;
3
- export const getRandomDigits = (count) => getRandomBetween(9 * 10 ** (count - 1), 10 ** (count - 1));
4
- export const getRandomHex = (count) => [...Array(count || 6)].map(() => getRandomBetween(0, 15).toString(16)).join("");
5
- export const getUuid = () => `huuid-${getRandomHex()}-${getRandomHex()}-${getRandomHex()}`;
@@ -1,2 +0,0 @@
1
- export * from "./generators.js";
2
- export * from "./common.js";
@@ -1,2 +0,0 @@
1
- export * from "./generators.js";
2
- export * from "./common.js";
package/dist/types.d.mts DELETED
@@ -1,7 +0,0 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module.js'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { type GluharCoreOptions, default } from './module.js'
package/dist/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { type GluharCoreOptions, default } from './module'