@intlayer/config 3.1.0 → 3.2.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.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var detectPlatform_exports = {};
20
30
  __export(detectPlatform_exports, {
@@ -22,16 +32,14 @@ __export(detectPlatform_exports, {
22
32
  getPrefix: () => getPrefix
23
33
  });
24
34
  module.exports = __toCommonJS(detectPlatform_exports);
35
+ var import_process = __toESM(require("process"));
25
36
  const import_meta = {};
26
37
  const getPlatform = () => {
27
- if (
28
- // eslint-disable-next-line
29
- typeof import_meta !== "undefined" && typeof import_meta.env !== "undefined" && typeof import_meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== "undefined"
30
- ) {
38
+ if (typeof import_meta !== "undefined" && typeof import_meta.env !== "undefined" && typeof import_meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== "undefined") {
31
39
  return "vite";
32
- } else if (typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== "undefined") {
40
+ } else if (typeof import_process.default.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== "undefined") {
33
41
  return "next";
34
- } else if (typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== "undefined") {
42
+ } else if (typeof import_process.default.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== "undefined") {
35
43
  return "react_app";
36
44
  }
37
45
  return "unknown";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\n\nexport const getPlatform = (): Platform => {\n if (\n // eslint-disable-next-line\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Vite\n return 'vite';\n } else if (\n typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Create React App\n return 'react_app';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return 'INTLAYER_';\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,cAAc,MAAgB;AACzC;AAAA;AAAA,IAEE,OAAO,gBAAgB,eACvB,OAAO,YAAY,QAAQ,eAC3B,OAAO,YAAY,IAAI,iCAAiC;AAAA,IACxD;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,wCAAwC,aAC3D;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,sCAAsC,aACzD;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["import process from 'process';\n\nexport type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\n\nexport const getPlatform = (): Platform => {\n if (\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Vite\n return 'vite';\n } else if (\n typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Create React App\n return 'react_app';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return 'INTLAYER_';\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAApB;AAIO,MAAM,cAAc,MAAgB;AACzC,MACE,OAAO,gBAAgB,eACvB,OAAO,YAAY,QAAQ,eAC3B,OAAO,YAAY,IAAI,iCAAiC,aACxD;AAEA,WAAO;AAAA,EACT,WACE,OAAO,eAAAA,QAAQ,IAAI,wCAAwC,aAC3D;AAEA,WAAO;AAAA,EACT,WACE,OAAO,eAAAA,QAAQ,IAAI,sCAAsC,aACzD;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":["process"]}
@@ -1,8 +1,6 @@
1
+ import process from "process";
1
2
  const getPlatform = () => {
2
- if (
3
- // eslint-disable-next-line
4
- typeof import.meta !== "undefined" && typeof import.meta.env !== "undefined" && typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== "undefined"
5
- ) {
3
+ if (typeof import.meta !== "undefined" && typeof import.meta.env !== "undefined" && typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== "undefined") {
6
4
  return "vite";
7
5
  } else if (typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== "undefined") {
8
6
  return "next";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\n\nexport const getPlatform = (): Platform => {\n if (\n // eslint-disable-next-line\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Vite\n return 'vite';\n } else if (\n typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Create React App\n return 'react_app';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return 'INTLAYER_';\n }\n};\n"],"mappings":"AAEO,MAAM,cAAc,MAAgB;AACzC;AAAA;AAAA,IAEE,OAAO,gBAAgB,eACvB,OAAO,YAAY,QAAQ,eAC3B,OAAO,YAAY,IAAI,iCAAiC;AAAA,IACxD;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,wCAAwC,aAC3D;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,sCAAsC,aACzD;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["import process from 'process';\n\nexport type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\n\nexport const getPlatform = (): Platform => {\n if (\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Vite\n return 'vite';\n } else if (\n typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Create React App\n return 'react_app';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return 'INTLAYER_';\n }\n};\n"],"mappings":"AAAA,OAAO,aAAa;AAIb,MAAM,cAAc,MAAgB;AACzC,MACE,OAAO,gBAAgB,eACvB,OAAO,YAAY,QAAQ,eAC3B,OAAO,YAAY,IAAI,iCAAiC,aACxD;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,wCAAwC,aAC3D;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,sCAAsC,aACzD;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"detectPlatform.d.ts","sourceRoot":"","sources":["../../../src/envVariables/detectPlatform.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAEjE,eAAO,MAAM,WAAW,QAAO,QAsB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,aAAc,QAAQ,KAAG,MAW9C,CAAC"}
1
+ {"version":3,"file":"detectPlatform.d.ts","sourceRoot":"","sources":["../../../src/envVariables/detectPlatform.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAEjE,eAAO,MAAM,WAAW,QAAO,QAqB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,aAAc,QAAQ,KAAG,MAW9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/config",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "private": false,
5
5
  "description": "Shared configuration package for IntLayer - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
6
6
  "keywords": [
@@ -68,7 +68,7 @@
68
68
  "dotenv": "^16.4.5",
69
69
  "esbuild": "^0.24.0",
70
70
  "swc-loader": "^0.2.6",
71
- "intlayer": "^3.1.0"
71
+ "intlayer": "^3.2.1"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/node": "^22.9.0",
@@ -80,13 +80,14 @@
80
80
  "tsc-alias": "^1.8.10",
81
81
  "tsup": "^8.3.5",
82
82
  "typescript": "^5.6.3",
83
- "@utils/eslint-config": "^1.0.4",
84
83
  "@utils/ts-config": "^1.0.4",
84
+ "@utils/tsup-config": "^1.0.4",
85
85
  "@utils/ts-config-types": "^1.0.4",
86
- "@utils/tsup-config": "^1.0.4"
86
+ "@utils/eslint-config": "^1.0.4"
87
87
  },
88
88
  "peerDependencies": {
89
- "react": ">=16.0.0 <19.0.0"
89
+ "react": ">=16.0.0 <19.0.0",
90
+ "intlayer": "^3.2.1"
90
91
  },
91
92
  "engines": {
92
93
  "node": ">=14.18"