@powerlines/plugin-date 0.12.364 → 0.12.366

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/index.d.cts CHANGED
@@ -9,8 +9,8 @@ import "./types/index.cjs";
9
9
  import { Plugin } from "powerlines";
10
10
 
11
11
  //#region src/index.d.ts
12
- declare module "powerlines" {
13
- interface UserConfig {
12
+ declare module "@powerlines/core" {
13
+ interface BaseConfig {
14
14
  date?: DatePluginOptions;
15
15
  }
16
16
  }
package/dist/index.d.mts CHANGED
@@ -9,8 +9,8 @@ import "./types/index.mjs";
9
9
  import { Plugin } from "powerlines";
10
10
 
11
11
  //#region src/index.d.ts
12
- declare module "powerlines" {
13
- interface UserConfig {
12
+ declare module "@powerlines/core" {
13
+ interface BaseConfig {
14
14
  date?: DatePluginOptions;
15
15
  }
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["dateModule!: (context: DatePluginContext) => string"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport env from \"@powerlines/plugin-env\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { dateFnsModule } from \"./components/date-fns\";\nimport { dayjsModule } from \"./components/dayjs\";\nimport { luxonModule } from \"./components/luxon\";\nimport { momentModule } from \"./components/moment\";\nimport {\n DatePluginContext,\n DatePluginOptions,\n DatePluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n export interface UserConfig {\n date?: DatePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport function plugin<TContext extends DatePluginContext = DatePluginContext>(\n options: DatePluginOptions = {}\n) {\n return [\n env(options.env),\n {\n name: \"date\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `date` build plugin.\"\n );\n\n const config = {\n date: defu(options, {\n type: \"date-fns\"\n })\n } as DatePluginUserConfig;\n\n if (\n !config.date!.type ||\n ![\"date-fns\", \"dayjs\", \"luxon\", \"moment\"].includes(config.date!.type)\n ) {\n if (config.date!.type) {\n this.warn(\n `Invalid date library type \"${config.date!.type}\" specified. Defaulting to \"date-fns\".`\n );\n }\n\n config.date!.type = \"date-fns\";\n }\n\n this.debug(`Using date library: ${config.date!.type}`);\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n this.dependencies[this.config.date.type] = \"latest\";\n },\n async prepare() {\n this.debug(\n `Preparing the Date runtime artifacts for the Powerlines project.`\n );\n\n let dateModule!: (context: DatePluginContext) => string;\n switch (this.config.date.type) {\n case \"dayjs\":\n dateModule = dayjsModule;\n break;\n case \"luxon\":\n dateModule = luxonModule;\n break;\n case \"moment\":\n dateModule = momentModule;\n break;\n case \"date-fns\":\n default:\n // Default to date-fns if no type is specified or if the type is not recognized\n dateModule = dateFnsModule;\n break;\n }\n\n await this.emitBuiltin(await Promise.resolve(dateModule(this)), \"date\");\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA2CA,SAAgB,OACd,UAA6B,EAAE,EAC/B;AACA,QAAO,CACL,IAAI,QAAQ,IAAI,EAChB;EACE,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,0EACD;GAED,MAAM,SAAS,EACb,MAAM,KAAK,SAAS,EAClB,MAAM,YACP,CAAC,EACH;AAED,OACE,CAAC,OAAO,KAAM,QACd,CAAC;IAAC;IAAY;IAAS;IAAS;IAAS,CAAC,SAAS,OAAO,KAAM,KAAK,EACrE;AACA,QAAI,OAAO,KAAM,KACf,MAAK,KACH,8BAA8B,OAAO,KAAM,KAAK,wCACjD;AAGH,WAAO,KAAM,OAAO;;AAGtB,QAAK,MAAM,uBAAuB,OAAO,KAAM,OAAO;AAEtD,UAAO;;EAET,MAAM,iBAAiB;AACrB,QAAK,MACH,iFACD;AAED,QAAK,aAAa,KAAK,OAAO,KAAK,QAAQ;;EAE7C,MAAM,UAAU;AACd,QAAK,MACH,mEACD;GAED,IAAIA;AACJ,WAAQ,KAAK,OAAO,KAAK,MAAzB;IACE,KAAK;AACH,kBAAa;AACb;IACF,KAAK;AACH,kBAAa;AACb;IACF,KAAK;AACH,kBAAa;AACb;IACF,KAAK;IACL;AAEE,kBAAa;AACb;;AAGJ,SAAM,KAAK,YAAY,MAAM,QAAQ,QAAQ,WAAW,KAAK,CAAC,EAAE,OAAO;;EAE1E,CACF;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["dateModule!: (context: DatePluginContext) => string"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport env from \"@powerlines/plugin-env\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { dateFnsModule } from \"./components/date-fns\";\nimport { dayjsModule } from \"./components/dayjs\";\nimport { luxonModule } from \"./components/luxon\";\nimport { momentModule } from \"./components/moment\";\nimport {\n DatePluginContext,\n DatePluginOptions,\n DatePluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n date?: DatePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport function plugin<TContext extends DatePluginContext = DatePluginContext>(\n options: DatePluginOptions = {}\n) {\n return [\n env(options.env),\n {\n name: \"date\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `date` build plugin.\"\n );\n\n const config = {\n date: defu(options, {\n type: \"date-fns\"\n })\n } as DatePluginUserConfig;\n\n if (\n !config.date!.type ||\n ![\"date-fns\", \"dayjs\", \"luxon\", \"moment\"].includes(config.date!.type)\n ) {\n if (config.date!.type) {\n this.warn(\n `Invalid date library type \"${config.date!.type}\" specified. Defaulting to \"date-fns\".`\n );\n }\n\n config.date!.type = \"date-fns\";\n }\n\n this.debug(`Using date library: ${config.date!.type}`);\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n this.dependencies[this.config.date.type] = \"latest\";\n },\n async prepare() {\n this.debug(\n `Preparing the Date runtime artifacts for the Powerlines project.`\n );\n\n let dateModule!: (context: DatePluginContext) => string;\n switch (this.config.date.type) {\n case \"dayjs\":\n dateModule = dayjsModule;\n break;\n case \"luxon\":\n dateModule = luxonModule;\n break;\n case \"moment\":\n dateModule = momentModule;\n break;\n case \"date-fns\":\n default:\n // Default to date-fns if no type is specified or if the type is not recognized\n dateModule = dateFnsModule;\n break;\n }\n\n await this.emitBuiltin(await Promise.resolve(dateModule(this)), \"date\");\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA2CA,SAAgB,OACd,UAA6B,EAAE,EAC/B;AACA,QAAO,CACL,IAAI,QAAQ,IAAI,EAChB;EACE,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,0EACD;GAED,MAAM,SAAS,EACb,MAAM,KAAK,SAAS,EAClB,MAAM,YACP,CAAC,EACH;AAED,OACE,CAAC,OAAO,KAAM,QACd,CAAC;IAAC;IAAY;IAAS;IAAS;IAAS,CAAC,SAAS,OAAO,KAAM,KAAK,EACrE;AACA,QAAI,OAAO,KAAM,KACf,MAAK,KACH,8BAA8B,OAAO,KAAM,KAAK,wCACjD;AAGH,WAAO,KAAM,OAAO;;AAGtB,QAAK,MAAM,uBAAuB,OAAO,KAAM,OAAO;AAEtD,UAAO;;EAET,MAAM,iBAAiB;AACrB,QAAK,MACH,iFACD;AAED,QAAK,aAAa,KAAK,OAAO,KAAK,QAAQ;;EAE7C,MAAM,UAAU;AACd,QAAK,MACH,mEACD;GAED,IAAIA;AACJ,WAAQ,KAAK,OAAO,KAAK,MAAzB;IACE,KAAK;AACH,kBAAa;AACb;IACF,KAAK;AACH,kBAAa;AACb;IACF,KAAK;AACH,kBAAa;AACb;IACF,KAAK;IACL;AAEE,kBAAa;AACb;;AAGJ,SAAM,KAAK,YAAY,MAAM,QAAQ,QAAQ,WAAW,KAAK,CAAC,EAAE,OAAO;;EAE1E,CACF;;AAGH,kBAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-date",
3
- "version": "0.12.364",
3
+ "version": "0.12.366",
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": {
@@ -100,18 +100,18 @@
100
100
  "files": ["dist/**/*"],
101
101
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
102
102
  "dependencies": {
103
- "@powerlines/plugin-env": "^0.16.20",
103
+ "@powerlines/plugin-env": "^0.16.22",
104
104
  "@storm-software/config-tools": "^1.189.10",
105
105
  "@stryke/path": "^0.26.6",
106
- "powerlines": "^0.39.10"
106
+ "powerlines": "^0.39.12"
107
107
  },
108
108
  "devDependencies": {
109
- "@powerlines/plugin-plugin": "^0.12.253",
109
+ "@powerlines/plugin-plugin": "^0.12.255",
110
110
  "@types/node": "^25.3.3"
111
111
  },
112
112
  "publishConfig": { "access": "public" },
113
113
  "main": "./dist/index.cjs",
114
114
  "module": "./dist/index.mjs",
115
115
  "types": "./dist/index.d.cts",
116
- "gitHead": "905dbeee1a9e2658cf70489e977cafac62733e46"
116
+ "gitHead": "cb34e2756e722735631673a7c06509d2640284c1"
117
117
  }