@kalel1500/kalion-js 0.7.0-beta.2
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/LICENSE +674 -0
- package/README.md +27 -0
- package/dist/app/kalion-js.es.js +5832 -0
- package/dist/app/kalion-js.es.js.map +1 -0
- package/dist/app/slimselect.css +62 -0
- package/dist/app/styles-old.css +2032 -0
- package/dist/app/styles.css +42 -0
- package/dist/app/sweetalert.css +1338 -0
- package/dist/app/tabulator.css +3861 -0
- package/dist/app/tailwind-config.css +61 -0
- package/dist/app/types/core/_types/index.d.ts +185 -0
- package/dist/app/types/core/application/LayoutListenersUseCase.d.ts +4 -0
- package/dist/app/types/core/application/index.d.ts +1 -0
- package/dist/app/types/core/domain/exceptions/CannotOpenModalException.d.ts +3 -0
- package/dist/app/types/core/domain/exceptions/CannotOpenModalWarning.d.ts +3 -0
- package/dist/app/types/core/domain/exceptions/InvalidValueException.d.ts +3 -0
- package/dist/app/types/core/domain/index.d.ts +8 -0
- package/dist/app/types/core/domain/objects/value-objects/EnumVo.d.ts +14 -0
- package/dist/app/types/core/domain/objects/value-objects/IntVo.d.ts +12 -0
- package/dist/app/types/core/domain/objects/value-objects/StringVo.d.ts +14 -0
- package/dist/app/types/core/domain/services/DomService.d.ts +7 -0
- package/dist/app/types/core/domain/services/Test.d.ts +4 -0
- package/dist/app/types/core/domain/services/ThemeSwitcher.d.ts +17 -0
- package/dist/app/types/core/infrastructure/index.d.ts +17 -0
- package/dist/app/types/core/infrastructure/utilities/components/Component.d.ts +4 -0
- package/dist/app/types/core/infrastructure/utilities/components/html/Btn.d.ts +6 -0
- package/dist/app/types/core/infrastructure/utilities/components/html/Icon.d.ts +5 -0
- package/dist/app/types/core/infrastructure/utilities/general/Constants.d.ts +10 -0
- package/dist/app/types/core/infrastructure/utilities/general/Cookie.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/general/Html.d.ts +4 -0
- package/dist/app/types/core/infrastructure/utilities/general/Instantiable.d.ts +5 -0
- package/dist/app/types/core/infrastructure/utilities/general/LDate.d.ts +30 -0
- package/dist/app/types/core/infrastructure/utilities/general/LStorage.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/general/Mutation.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/general/Notify.d.ts +19 -0
- package/dist/app/types/core/infrastructure/utilities/general/Ttable.d.ts +73 -0
- package/dist/app/types/core/infrastructure/utilities/general/global.d.ts +38 -0
- package/dist/app/types/core/infrastructure/utilities/modals/SModal.d.ts +111 -0
- package/dist/app/types/core/infrastructure/utilities/routing/Route.d.ts +8 -0
- package/dist/app/types/core/infrastructure/utilities/routing/Url.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/tests/TestConstants.d.ts +8 -0
- package/dist/app/types/core/infrastructure/utilities/translation/Translator.d.ts +13 -0
- package/dist/app/types/core/infrastructure/utilities/translation/TranslatorS.d.ts +0 -0
- package/dist/app/types/core/infrastructure/utilities/translation/lang/en.json.d.ts +48 -0
- package/dist/app/types/core/infrastructure/utilities/translation/lang/es.json.d.ts +48 -0
- package/dist/app/types/core/infrastructure/utilities/websockets/EchoService.d.ts +6 -0
- package/dist/app/types/core/infrastructure/utilities/websockets/Websocket.d.ts +23 -0
- package/dist/app/types/index.d.ts +5 -0
- package/dist/app/types/providers/UtilitiesServiceProvider.d.ts +12 -0
- package/dist/cli/index.js +64 -0
- package/dist/cli/stubs/.prettierrc +12 -0
- package/dist/cli/stubs/resources/css/app.css +12 -0
- package/dist/cli/stubs/resources/js/app/bootstrap.ts +21 -0
- package/dist/cli/stubs/resources/js/app/constants.ts +28 -0
- package/dist/cli/stubs/resources/js/app/lang/en.json +4 -0
- package/dist/cli/stubs/resources/js/app/lang/es.json +4 -0
- package/dist/cli/stubs/resources/js/app/routes.ts +6 -0
- package/dist/cli/stubs/resources/js/app/translations.ts +14 -0
- package/dist/cli/stubs/resources/js/app.ts +7 -0
- package/dist/cli/stubs/resources/js/src/shared/application/HomeUseCase.ts +8 -0
- package/dist/cli/stubs/resources/js/src/shared/infrastructure/DefaultController.ts +7 -0
- package/dist/cli/stubs/tsconfig.json +25 -0
- package/dist/cli/stubs/vite.config.ts +15 -0
- package/dist/plugins/tailwind/index.cjs +44 -0
- package/dist/plugins/tailwind/index.d.ts +5 -0
- package/dist/plugins/tailwind/tailwind.config.js +15 -0
- package/dist/plugins/vite/index.d.ts +2 -0
- package/dist/plugins/vite/index.js +75 -0
- package/package.json +86 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { existsSync } from "fs";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
import { loadEnv } from "vite";
|
|
4
|
+
const optionalDependencies = [
|
|
5
|
+
"bootstrap"
|
|
6
|
+
];
|
|
7
|
+
const isDependencyInstalled = (dep) => {
|
|
8
|
+
try {
|
|
9
|
+
const resolvedPath = resolve(`node_modules/${dep}`);
|
|
10
|
+
return existsSync(resolvedPath);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const getAppCode = (confAppCode, confAppName) => {
|
|
16
|
+
let code = confAppCode ?? confAppName;
|
|
17
|
+
return code == null ? void 0 : code.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\w\s-_]/g, "").replace(/_/g, "-").trim().replace(/^\-+|\-+$/g, "").replace(/\s+/g, "-").replace(/--+/g, "-").replace(/^-+|-+$/g, "");
|
|
18
|
+
};
|
|
19
|
+
function kalionJs() {
|
|
20
|
+
const externalDependencies = optionalDependencies.filter((dep) => !isDependencyInstalled(dep));
|
|
21
|
+
return {
|
|
22
|
+
name: "vite-plugin-kalion-js",
|
|
23
|
+
config(config, { mode }) {
|
|
24
|
+
const env = loadEnv(mode, process.cwd());
|
|
25
|
+
const confAppName = env.VITE_APP_NAME;
|
|
26
|
+
const confAppCode = env.VITE_APP_CODE;
|
|
27
|
+
const confAppMinify = env.VITE_CONF_MINIFY === "true";
|
|
28
|
+
const confAppSourcemap = env.VITE_CONF_SOURCEMAP === "true";
|
|
29
|
+
const confUseAppCodeInSourcePath = env.VITE_CONF_USE_APPCODE_IN_SOURCE_PATH === "true";
|
|
30
|
+
const modeIsProd = mode === "production";
|
|
31
|
+
const appCode = getAppCode(confAppCode, confAppName);
|
|
32
|
+
const basePublicPath = confUseAppCodeInSourcePath && modeIsProd ? `/${appCode}/build` : void 0;
|
|
33
|
+
return {
|
|
34
|
+
base: basePublicPath,
|
|
35
|
+
build: {
|
|
36
|
+
minify: confAppMinify,
|
|
37
|
+
cssMinify: confAppMinify,
|
|
38
|
+
sourcemap: confAppSourcemap,
|
|
39
|
+
target: "es2022",
|
|
40
|
+
rollupOptions: {
|
|
41
|
+
output: {
|
|
42
|
+
manualChunks: (id) => {
|
|
43
|
+
if (id.includes("node_modules")) {
|
|
44
|
+
return "vendor";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
external: externalDependencies
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
optimizeDeps: {
|
|
52
|
+
exclude: externalDependencies
|
|
53
|
+
},
|
|
54
|
+
css: {
|
|
55
|
+
devSourcemap: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
resolveId(source) {
|
|
60
|
+
if (externalDependencies.includes(source)) {
|
|
61
|
+
return "kalel--" + source;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
},
|
|
65
|
+
load(id) {
|
|
66
|
+
if (id.startsWith("kalel--")) {
|
|
67
|
+
return "";
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
kalionJs
|
|
75
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kalel1500/kalion-js",
|
|
3
|
+
"version": "0.7.0-beta.2",
|
|
4
|
+
"description": "Utilidades de typescript para Laravel",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/app/kalion-js.es.js",
|
|
7
|
+
"types": "dist/app/types/index.d.ts",
|
|
8
|
+
"style": "dist/app/style.css",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/app/types/index.d.ts",
|
|
12
|
+
"import": "./dist/app/kalion-js.es.js",
|
|
13
|
+
"default": "./dist/app/kalion-js.es.js"
|
|
14
|
+
},
|
|
15
|
+
"./dist/plugins/vite": {
|
|
16
|
+
"types": "./dist/plugins/vite/index.d.ts",
|
|
17
|
+
"import": "./dist/plugins/vite/index.js",
|
|
18
|
+
"default": "./dist/plugins/vite/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./dist/plugins/tailwind": {
|
|
21
|
+
"types": "./dist/plugins/tailwind/index.d.ts",
|
|
22
|
+
"import": "./dist/plugins/tailwind/index.cjs",
|
|
23
|
+
"default": "./dist/plugins/tailwind/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./dist/app/*.css": "./dist/app/*.css"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"bin": {
|
|
31
|
+
"kalion-js": "dist/cli/index.js"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build:library": "vite build",
|
|
35
|
+
"build:pluginV": "cross-env BUILD_TARGET=pluginV vite build",
|
|
36
|
+
"build:pluginT": "cross-env BUILD_TARGET=pluginT vite build",
|
|
37
|
+
"build:scripts": "cross-env BUILD_TARGET=scripts vite build",
|
|
38
|
+
"build:plugins": "npm run build:pluginV && npm run build:pluginT",
|
|
39
|
+
"build": "tsc && npm run build:library && npm run build:plugins && npm run build:scripts"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/kalel1500/kalion-js.git"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"laravel",
|
|
47
|
+
"ts",
|
|
48
|
+
"utilities",
|
|
49
|
+
"utils",
|
|
50
|
+
"typescript"
|
|
51
|
+
],
|
|
52
|
+
"author": "kalel1500",
|
|
53
|
+
"license": "GPL-3.0-or-later",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/kalel1500/kalion-js/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/kalel1500/kalion-js#readme",
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/bootstrap": "^5.2.10",
|
|
60
|
+
"autoprefixer": "^10.4.20",
|
|
61
|
+
"cross-env": "^7.0.3",
|
|
62
|
+
"flowbite": "^3.1.2",
|
|
63
|
+
"postcss-nested": "^7.0.2",
|
|
64
|
+
"tailwindcss": "^4.0.9",
|
|
65
|
+
"typescript": "^5.7.3",
|
|
66
|
+
"vite": "^6.1.0",
|
|
67
|
+
"vite-plugin-dts": "^4.5.0",
|
|
68
|
+
"vite-plugin-static-copy": "^2.2.0"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@types/luxon": "^3.4.2",
|
|
72
|
+
"@types/node": "20.11.1",
|
|
73
|
+
"@types/tabulator-tables": "^6.2.4",
|
|
74
|
+
"laravel-echo": "^2.0.0",
|
|
75
|
+
"luxon": "^3.5.0",
|
|
76
|
+
"pusher-js": "^8.4.0",
|
|
77
|
+
"slim-select": "^2.10.0",
|
|
78
|
+
"sweetalert2": "^11.11.2",
|
|
79
|
+
"tabulator-tables": "^6.3.1",
|
|
80
|
+
"ziggy-js": "^2.5.1"
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"node": "^20.11.1",
|
|
84
|
+
"npm": "^10.5.0"
|
|
85
|
+
}
|
|
86
|
+
}
|