@powerlines/plugin-date 0.12.151 → 0.12.153
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/components/date-fns.cjs +3 -2
- package/dist/components/date-fns.mjs +1 -1
- package/dist/components/dayjs.cjs +3 -2
- package/dist/components/dayjs.mjs +1 -1
- package/dist/components/luxon.cjs +3 -2
- package/dist/components/luxon.mjs +1 -1
- package/dist/components/moment.cjs +3 -2
- package/dist/components/moment.mjs +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +43 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +42 -0
- package/dist/packages/plugin-alloy/src/types/components.d.mts +2 -0
- package/dist/{plugin-env → packages/plugin-env}/src/types/plugin.d.mts +1 -1
- package/dist/{powerlines → packages/powerlines}/src/types/build.d.mts +6 -6
- package/dist/{powerlines → packages/powerlines}/src/types/config.d.mts +1 -2
- package/dist/{powerlines → packages/powerlines}/src/types/context.d.mts +1 -1
- package/dist/{powerlines → packages/powerlines}/src/types/tsconfig.d.mts +1 -1
- package/dist/powerlines/src/types/context.d.cts +1 -1
- package/dist/types/plugin.d.mts +1 -1
- package/package.json +5 -5
- package/dist/deepkit/schemas/reflection.cjs +0 -3998
- package/dist/deepkit/schemas/reflection.mjs +0 -3996
- package/dist/deepkit/schemas/reflection2.cjs +0 -4112
- package/dist/deepkit/schemas/reflection2.mjs +0 -4110
- package/dist/deepkit/src/capnp.cjs +0 -913
- package/dist/deepkit/src/capnp.mjs +0 -911
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
- package/dist/deepkit/src/reflect-type.cjs +0 -22
- package/dist/deepkit/src/reflect-type.mjs +0 -20
- package/dist/deepkit/src/resolve-reflections.cjs +0 -16
- package/dist/deepkit/src/resolve-reflections.mjs +0 -15
- package/dist/deepkit/src/transformer.cjs +0 -52
- package/dist/deepkit/src/transformer.mjs +0 -49
- package/dist/deepkit/src/transpile.cjs +0 -29
- package/dist/deepkit/src/transpile.mjs +0 -27
- package/dist/deepkit/src/utilities.cjs +0 -66
- package/dist/deepkit/src/utilities.mjs +0 -65
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -38
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -37
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -20
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -19
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -60
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -58
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
- package/dist/plugin-alloy/src/index.cjs +0 -103
- package/dist/plugin-alloy/src/index.mjs +0 -101
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -7
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -9
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -5
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -7
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -17
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
- package/dist/plugin-alloy/src/types/components.d.mts +0 -3
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -47
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -46
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -75
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -73
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -359
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -350
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -153
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -150
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -53
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -52
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -94
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -93
- package/dist/plugin-automd/src/index.cjs +0 -101
- package/dist/plugin-automd/src/index.mjs +0 -98
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
- package/dist/plugin-babel/src/helpers/index.cjs +0 -5
- package/dist/plugin-babel/src/helpers/index.mjs +0 -7
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
- package/dist/plugin-babel/src/helpers/options.cjs +0 -50
- package/dist/plugin-babel/src/helpers/options.mjs +0 -47
- package/dist/plugin-babel/src/index.cjs +0 -91
- package/dist/plugin-babel/src/index.mjs +0 -89
- package/dist/plugin-env/src/babel/index.cjs +0 -1
- package/dist/plugin-env/src/babel/index.mjs +0 -3
- package/dist/plugin-env/src/babel/plugin.cjs +0 -121
- package/dist/plugin-env/src/babel/plugin.mjs +0 -119
- package/dist/plugin-env/src/components/docs.cjs +0 -9
- package/dist/plugin-env/src/components/docs.mjs +0 -11
- package/dist/plugin-env/src/components/env.cjs +0 -487
- package/dist/plugin-env/src/components/env.mjs +0 -484
- package/dist/plugin-env/src/components/index.cjs +0 -2
- package/dist/plugin-env/src/components/index.mjs +0 -4
- package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
- package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
- package/dist/plugin-env/src/helpers/index.cjs +0 -6
- package/dist/plugin-env/src/helpers/index.mjs +0 -8
- package/dist/plugin-env/src/helpers/load.cjs +0 -83
- package/dist/plugin-env/src/helpers/load.mjs +0 -80
- package/dist/plugin-env/src/helpers/persistence.cjs +0 -201
- package/dist/plugin-env/src/helpers/persistence.mjs +0 -190
- package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
- package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
- package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
- package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
- package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
- package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
- package/dist/plugin-env/src/index.cjs +0 -172
- package/dist/plugin-env/src/index.mjs +0 -170
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
- package/dist/powerlines/src/lib/entry.cjs +0 -12
- package/dist/powerlines/src/lib/entry.mjs +0 -14
- package/dist/powerlines/src/lib/logger.cjs +0 -41
- package/dist/powerlines/src/lib/logger.mjs +0 -39
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
- package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -22
- package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -21
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
- /package/dist/{deepkit → packages/deepkit}/schemas/reflection.d.mts +0 -0
- /package/dist/{deepkit → packages/deepkit}/src/types.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/index.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/plugin.d.mts +0 -0
- /package/dist/{plugin-automd → packages/plugin-automd}/src/types/plugin.d.mts +0 -0
- /package/dist/{plugin-automd → packages/plugin-automd}/src/types/toc.d.mts +0 -0
- /package/dist/{plugin-babel → packages/plugin-babel}/src/types/index.d.mts +0 -0
- /package/dist/{plugin-babel → packages/plugin-babel}/src/types/plugin.d.mts +0 -0
- /package/dist/{plugin-env → packages/plugin-env}/src/types/runtime.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/internal/helpers/hooks.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/api.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/babel.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/commands.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/fs.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/hooks.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/plugin.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/resolved.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/unplugin.d.mts +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
2
3
|
|
|
3
4
|
//#region src/components/date-fns.ts
|
|
4
5
|
/**
|
|
@@ -15,7 +16,7 @@ function dateFnsModule(context) {
|
|
|
15
16
|
* @module ${context.config.output.builtinPrefix}:date
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
|
-
${
|
|
19
|
+
${(0, powerlines_lib_utilities_file_header.getFileHeader)(context)}
|
|
19
20
|
|
|
20
21
|
import { DateFormats, TimeUnit } from "@powerlines/plugin-date/types/runtime";
|
|
21
22
|
import { addDays as dateFnsAddDays } from "date-fns/addDays";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
2
3
|
|
|
3
4
|
//#region src/components/dayjs.ts
|
|
4
5
|
/**
|
|
@@ -15,7 +16,7 @@ function dayjsModule(context) {
|
|
|
15
16
|
* @module ${context.config.output.builtinPrefix}:date
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
|
-
${
|
|
19
|
+
${(0, powerlines_lib_utilities_file_header.getFileHeader)(context)}
|
|
19
20
|
|
|
20
21
|
import defaultDayjs, { QUnitType } from "dayjs";
|
|
21
22
|
import customParseFormatPlugin from "dayjs/plugin/customParseFormat";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
2
3
|
|
|
3
4
|
//#region src/components/luxon.ts
|
|
4
5
|
/**
|
|
@@ -15,7 +16,7 @@ function luxonModule(context) {
|
|
|
15
16
|
* @module ${context.config.output.builtinPrefix}:date
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
|
-
${
|
|
19
|
+
${(0, powerlines_lib_utilities_file_header.getFileHeader)(context)}
|
|
19
20
|
|
|
20
21
|
import { DateTime, Settings, Info } from "luxon";
|
|
21
22
|
import {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
2
3
|
|
|
3
4
|
//#region src/components/moment.ts
|
|
4
5
|
/**
|
|
@@ -15,7 +16,7 @@ function momentModule(context) {
|
|
|
15
16
|
* @module ${context.config.output.builtinPrefix}:date
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
|
-
${
|
|
19
|
+
${(0, powerlines_lib_utilities_file_header.getFileHeader)(context)}
|
|
19
20
|
|
|
20
21
|
import defaultMoment, { LongDateFormatKey } from "moment";
|
|
21
22
|
import {
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_defu = require('./node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs');
|
|
4
4
|
const require_date_fns = require('./components/date-fns.cjs');
|
|
5
5
|
const require_dayjs = require('./components/dayjs.cjs');
|
|
6
6
|
const require_luxon = require('./components/luxon.cjs');
|
|
7
7
|
const require_moment = require('./components/moment.cjs');
|
|
8
8
|
require('./components/index.cjs');
|
|
9
|
-
let
|
|
10
|
-
|
|
9
|
+
let __powerlines_plugin_env = require("@powerlines/plugin-env");
|
|
10
|
+
__powerlines_plugin_env = require_rolldown_runtime.__toESM(__powerlines_plugin_env);
|
|
11
11
|
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
12
12
|
|
|
13
13
|
//#region src/index.ts
|
|
@@ -15,11 +15,11 @@ let __storm_software_config_tools_types = require("@storm-software/config-tools/
|
|
|
15
15
|
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
16
16
|
*/
|
|
17
17
|
function plugin(options = {}) {
|
|
18
|
-
return [
|
|
18
|
+
return [(0, __powerlines_plugin_env.default)(options.env), {
|
|
19
19
|
name: "date",
|
|
20
20
|
async config() {
|
|
21
21
|
this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `date` build plugin.");
|
|
22
|
-
const config = { date:
|
|
22
|
+
const config = { date: require_defu.defu(options, { type: "date-fns" }) };
|
|
23
23
|
if (!config.date.type || ![
|
|
24
24
|
"date-fns",
|
|
25
25
|
"dayjs",
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
1
|
+
import { Plugin } from "./packages/powerlines/src/types/plugin.mjs";
|
|
2
2
|
import { DateLibraryType, DatePluginContext, DatePluginOptions, DatePluginResolvedConfig, DatePluginUserConfig, __ΩDateLibraryType, __ΩDatePluginContext, __ΩDatePluginOptions, __ΩDatePluginResolvedConfig, __ΩDatePluginUserConfig } from "./types/plugin.mjs";
|
|
3
3
|
import { dateFnsModule } from "./components/date-fns.mjs";
|
|
4
4
|
import { dayjsModule } from "./components/dayjs.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defu } from "./node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs";
|
|
2
2
|
import { dateFnsModule } from "./components/date-fns.mjs";
|
|
3
3
|
import { dayjsModule } from "./components/dayjs.mjs";
|
|
4
4
|
import { luxonModule } from "./components/luxon.mjs";
|
|
5
5
|
import { momentModule } from "./components/moment.mjs";
|
|
6
6
|
import "./components/index.mjs";
|
|
7
|
-
import
|
|
7
|
+
import env from "@powerlines/plugin-env";
|
|
8
8
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
9
9
|
|
|
10
10
|
//#region src/index.ts
|
|
@@ -12,7 +12,7 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
|
12
12
|
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
13
13
|
*/
|
|
14
14
|
function plugin(options = {}) {
|
|
15
|
-
return [
|
|
15
|
+
return [env(options.env), {
|
|
16
16
|
name: "date",
|
|
17
17
|
async config() {
|
|
18
18
|
this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `date` build plugin.");
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
3
|
+
function isPlainObject(value) {
|
|
4
|
+
if (value === null || typeof value !== "object") return false;
|
|
5
|
+
const prototype = Object.getPrototypeOf(value);
|
|
6
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
7
|
+
if (Symbol.iterator in value) return false;
|
|
8
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
12
|
+
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
13
|
+
const object = Object.assign({}, defaults);
|
|
14
|
+
for (const key in baseObject) {
|
|
15
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
16
|
+
const value = baseObject[key];
|
|
17
|
+
if (value === null || value === void 0) continue;
|
|
18
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
19
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
20
|
+
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
21
|
+
else object[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return object;
|
|
24
|
+
}
|
|
25
|
+
function createDefu(merger) {
|
|
26
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
27
|
+
}
|
|
28
|
+
const defu = createDefu();
|
|
29
|
+
const defuFn = createDefu((object, key, currentValue) => {
|
|
30
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
31
|
+
object[key] = currentValue(object[key]);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const defuArrayFn = createDefu((object, key, currentValue) => {
|
|
36
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
37
|
+
object[key] = currentValue(object[key]);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.defu = defu;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
if (value === null || typeof value !== "object") return false;
|
|
4
|
+
const prototype = Object.getPrototypeOf(value);
|
|
5
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
6
|
+
if (Symbol.iterator in value) return false;
|
|
7
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
11
|
+
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
12
|
+
const object = Object.assign({}, defaults);
|
|
13
|
+
for (const key in baseObject) {
|
|
14
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
15
|
+
const value = baseObject[key];
|
|
16
|
+
if (value === null || value === void 0) continue;
|
|
17
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
18
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
19
|
+
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
20
|
+
else object[key] = value;
|
|
21
|
+
}
|
|
22
|
+
return object;
|
|
23
|
+
}
|
|
24
|
+
function createDefu(merger) {
|
|
25
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
26
|
+
}
|
|
27
|
+
const defu = createDefu();
|
|
28
|
+
const defuFn = createDefu((object, key, currentValue) => {
|
|
29
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
30
|
+
object[key] = currentValue(object[key]);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const defuArrayFn = createDefu((object, key, currentValue) => {
|
|
35
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
36
|
+
object[key] = currentValue(object[key]);
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { defu };
|
|
@@ -5,9 +5,9 @@ import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.mjs
|
|
|
5
5
|
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.mjs";
|
|
6
6
|
import "../../../plugin-babel/src/types/index.mjs";
|
|
7
7
|
import { EnvInterface, SecretsInterface } from "./runtime.mjs";
|
|
8
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
9
8
|
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
10
9
|
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
10
|
+
import { DotenvParseOutput } from "@stryke/env/types";
|
|
11
11
|
|
|
12
12
|
//#region ../plugin-env/src/types/plugin.d.ts
|
|
13
13
|
type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BuildOptions } from "esbuild";
|
|
2
1
|
import { OutputOptions, RollupOptions } from "rollup";
|
|
3
2
|
import { UserConfig } from "@farmfe/core";
|
|
4
3
|
import { Configuration } from "@rspack/core";
|
|
5
|
-
import { BuildOptions
|
|
4
|
+
import { BuildOptions } from "@storm-software/tsup/types";
|
|
6
5
|
import { UnbuildOptions } from "@storm-software/unbuild/types";
|
|
6
|
+
import { BuildOptions as BuildOptions$1 } from "esbuild";
|
|
7
7
|
import { RolldownOptions } from "rolldown";
|
|
8
8
|
import { UserConfig as UserConfig$1 } from "tsdown";
|
|
9
9
|
import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
|
|
@@ -153,8 +153,8 @@ interface BuildConfig {
|
|
|
153
153
|
override?: Record<string, any>;
|
|
154
154
|
}
|
|
155
155
|
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
156
|
-
type ESBuildBuildConfig = Omit<BuildOptions, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
|
|
157
|
-
type ESBuildResolvedBuildConfig = Omit<BuildOptions, "inject"> & BuildResolvedConfig;
|
|
156
|
+
type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
|
|
157
|
+
type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
|
|
158
158
|
type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
|
|
159
159
|
/**
|
|
160
160
|
* Optimize deps config
|
|
@@ -173,8 +173,8 @@ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "o
|
|
|
173
173
|
type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
|
|
174
174
|
type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfig" | "logLevel" | "output"> & BuildConfig;
|
|
175
175
|
type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
|
|
176
|
-
type TsupBuildConfig = Partial<Omit<BuildOptions
|
|
177
|
-
type TsupResolvedBuildConfig = BuildOptions
|
|
176
|
+
type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
|
|
177
|
+
type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
|
|
178
178
|
type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
|
|
179
179
|
type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
|
|
180
180
|
type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
|
|
@@ -4,11 +4,10 @@ import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
|
4
4
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
5
|
import { PluginContext } from "./context.mjs";
|
|
6
6
|
import { Plugin } from "./plugin.mjs";
|
|
7
|
-
import "c12";
|
|
8
|
-
import { transformAsync } from "@babel/core";
|
|
9
7
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
10
8
|
import { MaybePromise } from "@stryke/types/base";
|
|
11
9
|
import { PreviewOptions } from "vite";
|
|
10
|
+
import { transformAsync } from "@babel/core";
|
|
12
11
|
import { Format } from "@storm-software/build-tools/types";
|
|
13
12
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
14
13
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
@@ -19,7 +19,7 @@ import { RequestInfo, Response } from "undici";
|
|
|
19
19
|
//#region ../powerlines/src/types/context.d.ts
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* The severity level of a
|
|
22
|
+
* The severity level of a log message.
|
|
23
23
|
*/
|
|
24
24
|
type LogLevel = "debug" | "info" | "warning" | "error" | "fatal";
|
|
25
25
|
declare const LogLevel: {
|
|
@@ -19,7 +19,7 @@ import { RequestInfo, Response } from "undici";
|
|
|
19
19
|
//#region ../powerlines/src/types/context.d.ts
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* The severity level of a
|
|
22
|
+
* The severity level of a log message.
|
|
23
23
|
*/
|
|
24
24
|
type LogLevel = "debug" | "info" | "warning" | "error" | "fatal";
|
|
25
25
|
declare const LogLevel: {
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "../plugin-env/src/types/plugin.mjs";
|
|
1
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "../packages/plugin-env/src/types/plugin.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/types/plugin.d.ts
|
|
4
4
|
type DateLibraryType = "date-fns" | "dayjs" | "luxon" | "moment";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-date",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.153",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -128,15 +128,15 @@
|
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@powerlines/plugin-env": "^0.15.
|
|
131
|
+
"@powerlines/plugin-env": "^0.15.15",
|
|
132
132
|
"@storm-software/config-tools": "^1.188.75",
|
|
133
133
|
"@stryke/path": "^0.24.1",
|
|
134
|
-
"powerlines": "^0.37.
|
|
134
|
+
"powerlines": "^0.37.4"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@powerlines/
|
|
137
|
+
"@powerlines/plugin-plugin": "^0.12.82",
|
|
138
138
|
"@types/node": "^24.10.4"
|
|
139
139
|
},
|
|
140
140
|
"publishConfig": { "access": "public" },
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "48a35579bd5535a267a420c160c273899920b2e7"
|
|
142
142
|
}
|