@shwfed/nuxt 0.1.36 → 0.1.37
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
CHANGED
|
@@ -13,11 +13,14 @@ interface ModuleOptions {
|
|
|
13
13
|
}>;
|
|
14
14
|
}
|
|
15
15
|
interface Env {
|
|
16
|
-
ci: boolean;
|
|
17
16
|
git: Readonly<{
|
|
18
17
|
commit?: string;
|
|
19
18
|
branch?: string;
|
|
20
19
|
}>;
|
|
20
|
+
ci: Readonly<{
|
|
21
|
+
job?: string;
|
|
22
|
+
build?: number;
|
|
23
|
+
}>;
|
|
21
24
|
}
|
|
22
25
|
declare module 'nuxt/schema' {
|
|
23
26
|
interface PublicRuntimeConfig {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -11,10 +11,13 @@ const module$1 = defineNuxtModule({
|
|
|
11
11
|
setup(options, nuxt) {
|
|
12
12
|
const resolver = createResolver(import.meta.url);
|
|
13
13
|
nuxt.options.runtimeConfig.public.shwfed = defu(options, {
|
|
14
|
-
ci: process.env.CI === "true",
|
|
15
14
|
git: {
|
|
16
15
|
commit: process.env.GIT_COMMIT,
|
|
17
16
|
branch: process.env.GIT_LOCAL_BRANCH
|
|
17
|
+
},
|
|
18
|
+
ci: {
|
|
19
|
+
job: process.env.JOB_NAME,
|
|
20
|
+
build: process.env.BUILD_NUMBER ? Number.parseInt(process.env.BUILD_NUMBER) : void 0
|
|
18
21
|
}
|
|
19
22
|
});
|
|
20
23
|
nuxt.options.css ||= [];
|
|
@@ -2,7 +2,7 @@ import { Environment, EvaluationError, Optional } from "@marcbachmann/cel-js";
|
|
|
2
2
|
import { startOfDay, startOfWeek, startOfYear, startOfMonth, endOfDay, endOfWeek, endOfYear, endOfMonth, addYears, addMonths, addDays, addWeeks, setDate, setMonth, setYear, formatDate, isBefore, isAfter, isEqual } from "date-fns";
|
|
3
3
|
import { TZDate } from "@date-fns/tz";
|
|
4
4
|
import { BigNumber } from "bignumber.js";
|
|
5
|
-
export function createEnvironment(
|
|
5
|
+
export function createEnvironment() {
|
|
6
6
|
const env = new Environment({
|
|
7
7
|
enableOptionalTypes: true,
|
|
8
8
|
homogeneousAggregateLiterals: false,
|
|
@@ -5,7 +5,10 @@ export default defineNuxtPlugin({
|
|
|
5
5
|
name: "shwfed-nuxt:cel",
|
|
6
6
|
setup: () => {
|
|
7
7
|
const config = useRuntimeConfig().public.shwfed;
|
|
8
|
-
const env = createEnvironment(
|
|
8
|
+
const env = createEnvironment().registerConstant("git", "map<string, string>", config.git).registerConstant("ci", "map<string, dyn>", {
|
|
9
|
+
...config.ci,
|
|
10
|
+
build: config.ci.build !== void 0 ? BigInt(config.ci.build) : void 0
|
|
11
|
+
});
|
|
9
12
|
return {
|
|
10
13
|
provide: {
|
|
11
14
|
dsl: {
|