@vighnalabs-packages/utilities 0.0.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.
- package/.github/workflows/deploy-production.yml +17 -0
- package/.prettierignore +4 -0
- package/.prettierrc +8 -0
- package/README.md +1 -0
- package/deploy.production.sh +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/text.utility.d.ts +3 -0
- package/dist/text.utility.js +19 -0
- package/eslint.config.mjs +29 -0
- package/package.json +33 -0
- package/test +1 -0
- package/vitest.config.ts +14 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Deploy Production
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [production]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build-and-deploy:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- name: Get SSH keys and set permissions
|
|
13
|
+
run: |
|
|
14
|
+
mkdir -p ~/.ssh
|
|
15
|
+
echo "${{ secrets.MAC_AIR_PRIVATE_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
|
16
|
+
- name: Deploy to Server
|
|
17
|
+
run: ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.SH_USER }}@${{ secrets.DEBIAN_SERVER_IP }} 'cd vighnalabs/vighnalabs-packages/utilities/ && sh deploy.production.sh'
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node -v 24
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./text.utility";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./text.utility"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camelToFlat = exports.capitalize = void 0;
|
|
4
|
+
const capitalize = (val) => {
|
|
5
|
+
if (typeof val !== "string")
|
|
6
|
+
val = "";
|
|
7
|
+
return val.toLowerCase().replace(/\b./g, function (a) {
|
|
8
|
+
return a.toUpperCase();
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.capitalize = capitalize;
|
|
12
|
+
const camelToFlat = (str) => {
|
|
13
|
+
return str
|
|
14
|
+
.replace(/([a-z])([A-Z])/g, "$1 $2")
|
|
15
|
+
.split(" ")
|
|
16
|
+
.map((word) => word[0].toUpperCase() + word.slice(1))
|
|
17
|
+
.join(" ");
|
|
18
|
+
};
|
|
19
|
+
exports.camelToFlat = camelToFlat;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
import prettier from "eslint-plugin-prettier";
|
|
4
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
5
|
+
|
|
6
|
+
export default tseslint.config(
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
...tseslint.configs.recommended,
|
|
9
|
+
eslintConfigPrettier,
|
|
10
|
+
{
|
|
11
|
+
ignores: ["dist", "coverage"],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
files: ["**/*.ts"],
|
|
15
|
+
plugins: {
|
|
16
|
+
prettier,
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
"prettier/prettier": "error",
|
|
20
|
+
"no-console": "warn",
|
|
21
|
+
"@typescript-eslint/no-unused-vars": [
|
|
22
|
+
"error",
|
|
23
|
+
{
|
|
24
|
+
argsIgnorePattern: "^_",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
);
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vighnalabs-packages/utilities",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"start": "tsc --watch",
|
|
10
|
+
"deploy": "npm i && npm run build && npm publish --access public",
|
|
11
|
+
"test": "vitest",
|
|
12
|
+
"test:watch": "vitest --watch",
|
|
13
|
+
"coverage": "vitest --coverage",
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"lint:fix": "eslint . --fix",
|
|
16
|
+
"format": "prettier . --write",
|
|
17
|
+
"format:check": "prettier . --check"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@eslint/js": "^10.0.1",
|
|
24
|
+
"@types/node": "^20.19.25",
|
|
25
|
+
"@vitest/coverage-v8": "^4.0.13",
|
|
26
|
+
"eslint-config-prettier": "^10.1.8",
|
|
27
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
28
|
+
"prettier": "^3.9.6",
|
|
29
|
+
"typescript": "^5.4.5",
|
|
30
|
+
"typescript-eslint": "^8.65.0",
|
|
31
|
+
"vitest": "^4.0.13"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/test
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { defineConfig } from "vitest/config";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
globals: true,
|
|
7
|
+
environment: "node", // utils package → node environment
|
|
8
|
+
include: ["src/**/*.test.ts"], // adjust if needed
|
|
9
|
+
coverage: {
|
|
10
|
+
provider: "v8",
|
|
11
|
+
reportsDirectory: "./coverage",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|