@attributech/nuxt-drupal-utils 0.3.0 → 0.3.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/dist/module.d.mts +7 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +15 -18
- package/dist/runtime/utils/getApiUrl.d.ts +1 -0
- package/dist/runtime/utils/getApiUrl.js +5 -0
- package/dist/runtime/utils/getAppUrl.d.ts +1 -0
- package/dist/runtime/utils/getAppUrl.js +13 -0
- package/dist/runtime/utils/getLagoonDevelopmentDomain.d.ts +1 -0
- package/dist/runtime/utils/getLagoonDevelopmentDomain.js +6 -0
- package/dist/runtime/utils/getServerUrl.d.ts +1 -0
- package/dist/runtime/utils/getServerUrl.js +13 -0
- package/dist/runtime/utils/index.d.ts +4 -0
- package/dist/runtime/utils/index.js +4 -0
- package/dist/types.d.mts +6 -10
- package/package.json +14 -14
- package/dist/module.d.cts +0 -2
package/dist/module.d.mts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { ModuleOptions } from 'nuxt/schema';
|
|
3
|
+
export { getApiUrl, getAppUrl, getLagoonDevelopmentDomain, getServerUrl } from '../dist/runtime/utils/index.js';
|
|
4
|
+
|
|
5
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
|
+
|
|
7
|
+
export { _default as default };
|
package/dist/module.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@attributech/nuxt-drupal-utils",
|
|
3
3
|
"configKey": "drupalUtils",
|
|
4
4
|
"compatibility": {
|
|
5
|
-
"nuxt": "^
|
|
5
|
+
"nuxt": "^3.0.0 || ^4.0.0"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.3.1",
|
|
8
8
|
"builder": {
|
|
9
9
|
"@nuxt/module-builder": "1.0.2",
|
|
10
10
|
"unbuild": "unknown"
|
package/dist/module.mjs
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit';
|
|
2
|
+
export { getApiUrl, getAppUrl, getLagoonDevelopmentDomain, getServerUrl } from '../dist/runtime/utils/index.js';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"babel": {
|
|
10
|
-
"plugins": []
|
|
4
|
+
const module$1 = defineNuxtModule({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "@attributech/nuxt-drupal-utils",
|
|
7
|
+
configKey: "drupalUtils",
|
|
8
|
+
compatibility: {
|
|
9
|
+
nuxt: "^3.0.0 || ^4.0.0"
|
|
11
10
|
}
|
|
11
|
+
},
|
|
12
|
+
defaults: {},
|
|
13
|
+
setup() {
|
|
14
|
+
const resolver = createResolver(import.meta.url);
|
|
15
|
+
addImportsDir(resolver.resolve("./runtime/utils"));
|
|
12
16
|
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
/** @type {import("/home/luksak/Sites/nuxt-drupal-utils/src/module.js")} */
|
|
16
|
-
const _module = await jiti.import("/home/luksak/Sites/nuxt-drupal-utils/src/module.ts");
|
|
17
|
+
});
|
|
17
18
|
|
|
18
|
-
export
|
|
19
|
-
export const getApiUrl = _module.getApiUrl;
|
|
20
|
-
export const getAppUrl = _module.getAppUrl;
|
|
21
|
-
export const getServerUrl = _module.getServerUrl;
|
|
22
|
-
export const getLagoonDevelopmentDomain = _module.getLagoonDevelopmentDomain;
|
|
19
|
+
export { module$1 as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getApiUrl: (defaultServerUrl: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getAppUrl: (defaultUrl: string) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getLagoonDevelopmentDomain } from "./getLagoonDevelopmentDomain.js";
|
|
2
|
+
export const getAppUrl = function(defaultUrl) {
|
|
3
|
+
if (process.env.APP_URL !== void 0 && process.env.APP_URL !== "") {
|
|
4
|
+
return process.env.APP_URL;
|
|
5
|
+
}
|
|
6
|
+
if (process.env.LAGOON_ENVIRONMENT_TYPE !== void 0 && process.env.LAGOON_ENVIRONMENT_TYPE === "development") {
|
|
7
|
+
const lagoonDevelopmentDomain = getLagoonDevelopmentDomain();
|
|
8
|
+
if (lagoonDevelopmentDomain !== null) {
|
|
9
|
+
return `https://frontend.${lagoonDevelopmentDomain}`;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return defaultUrl;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLagoonDevelopmentDomain: () => string | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const getLagoonDevelopmentDomain = function() {
|
|
2
|
+
if (process.env.LAGOON_ENVIRONMENT !== void 0 && process.env.LAGOON_PROJECT !== void 0 && process.env.LAGOON_KUBERNETES !== void 0) {
|
|
3
|
+
return `${process.env.LAGOON_ENVIRONMENT}.${process.env.LAGOON_PROJECT}.${process.env.LAGOON_KUBERNETES}`;
|
|
4
|
+
}
|
|
5
|
+
return null;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getServerUrl: (defaultUrl: string) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getLagoonDevelopmentDomain } from "./getLagoonDevelopmentDomain.js";
|
|
2
|
+
export const getServerUrl = function(defaultUrl) {
|
|
3
|
+
if (process.env.API_SERVER !== void 0 && process.env.API_SERVER !== "") {
|
|
4
|
+
return process.env.API_SERVER;
|
|
5
|
+
}
|
|
6
|
+
if (process.env.LAGOON_ENVIRONMENT_TYPE !== void 0 && process.env.LAGOON_ENVIRONMENT_TYPE === "development") {
|
|
7
|
+
const lagoonDevelopmentDomain = getLagoonDevelopmentDomain();
|
|
8
|
+
if (lagoonDevelopmentDomain !== null) {
|
|
9
|
+
return `https://nginx.${lagoonDevelopmentDomain}`;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return defaultUrl;
|
|
13
|
+
};
|
package/dist/types.d.mts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
interface RuntimeNuxtHooks extends ModuleRuntimeHooks {}
|
|
5
|
-
}
|
|
3
|
+
import type { default as Module } from './module.mjs'
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
interface NuxtHooks extends ModuleHooks {}
|
|
9
|
-
interface RuntimeConfig extends ModuleRuntimeConfig {}
|
|
10
|
-
interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
|
|
11
|
-
}
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
12
6
|
|
|
13
|
-
export
|
|
7
|
+
export { type getApiUrl, type getAppUrl, type getLagoonDevelopmentDomain, type getServerUrl } from '../dist/runtime/utils/index.js'
|
|
8
|
+
|
|
9
|
+
export { default } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attributech/nuxt-drupal-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Shared utilities for Nuxt projects with Drupal backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,18 +11,6 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "nuxt-module-build build",
|
|
16
|
-
"dev": "nuxi dev playground",
|
|
17
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
18
|
-
"lint": "eslint .",
|
|
19
|
-
"lint:fix": "eslint . --fix",
|
|
20
|
-
"test": "vitest run",
|
|
21
|
-
"test:watch": "vitest",
|
|
22
|
-
"test:coverage": "vitest run --coverage",
|
|
23
|
-
"test:ui": "vitest --ui",
|
|
24
|
-
"release": "release-it"
|
|
25
|
-
},
|
|
26
14
|
"keywords": [
|
|
27
15
|
"nuxt",
|
|
28
16
|
"drupal",
|
|
@@ -62,5 +50,17 @@
|
|
|
62
50
|
"github": {
|
|
63
51
|
"release": true
|
|
64
52
|
}
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "nuxt-module-build build",
|
|
56
|
+
"dev": "nuxi dev playground",
|
|
57
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
58
|
+
"lint": "eslint .",
|
|
59
|
+
"lint:fix": "eslint . --fix",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"test:coverage": "vitest run --coverage",
|
|
63
|
+
"test:ui": "vitest --ui",
|
|
64
|
+
"release": "release-it"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|
package/dist/module.d.cts
DELETED