magic-renamer 19.0.21 → 19.0.24
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/browser/package.json +1 -1
- package/client/package.json +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/rename-rule.backend.d.ts +18 -0
- package/lib/rename-rule.backend.js +77 -0
- package/lib/rename-rule.backend.js.map +1 -0
- package/package.json +21 -1
- package/tmp-environment.json +6 -6
- package/websql/package.json +1 -1
package/browser/package.json
CHANGED
package/client/package.json
CHANGED
|
@@ -4,6 +4,6 @@ exports.CURRENT_PACKAGE_VERSION = exports.PROJECT_NPM_NAME = exports.BUILD_FRAME
|
|
|
4
4
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
5
5
|
exports.BUILD_FRAMEWORK_CLI_NAME = 'tnp';
|
|
6
6
|
exports.PROJECT_NPM_NAME = 'magic-renamer';
|
|
7
|
-
exports.CURRENT_PACKAGE_VERSION = '19.0.
|
|
7
|
+
exports.CURRENT_PACKAGE_VERSION = '19.0.24';
|
|
8
8
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
9
9
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class RenameRule {
|
|
2
|
+
readonly from: string;
|
|
3
|
+
readonly to: string;
|
|
4
|
+
readonly fromWhiteSpaceReplaced: string;
|
|
5
|
+
readonly toWhiteSpaceReplaced: string;
|
|
6
|
+
constructor(from: string, to: string);
|
|
7
|
+
applyTo(s: string): boolean;
|
|
8
|
+
toString: () => string;
|
|
9
|
+
includes(orgString: any): boolean;
|
|
10
|
+
get combinations(): string[][];
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param orgString (file name OR file content)
|
|
14
|
+
* @param replaceallPossibliliteis when changin file notent (not name only)
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
replace(filename: string, orgString: string, replaceallPossibliliteis?: boolean): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RenameRule = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var tnp_helpers_1 = require("tnp-helpers");
|
|
6
|
+
var tnp_core_1 = require("tnp-core");
|
|
7
|
+
var ng2_logger_1 = require("ng2-logger");
|
|
8
|
+
var log = ng2_logger_1.Log.create('magic-renemer', ng2_logger_1.Level.__NOTHING);
|
|
9
|
+
var RenameRule = /** @class */ (function () {
|
|
10
|
+
function RenameRule(from, to) {
|
|
11
|
+
var _this = this;
|
|
12
|
+
this.from = from;
|
|
13
|
+
this.to = to;
|
|
14
|
+
this.toString = function () {
|
|
15
|
+
return "".concat(_this.from, " => ").concat(_this.to);
|
|
16
|
+
};
|
|
17
|
+
this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\W/g, ' ');
|
|
18
|
+
this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\W/g, ' ');
|
|
19
|
+
}
|
|
20
|
+
RenameRule.prototype.applyTo = function (s) {
|
|
21
|
+
s = s.trim().toLowerCase().replace(/\W/g, '');
|
|
22
|
+
var res = (s.search(this.from.replace(/\W/g, '')) !== -1);
|
|
23
|
+
return res;
|
|
24
|
+
};
|
|
25
|
+
RenameRule.prototype.includes = function (orgString) {
|
|
26
|
+
return !tnp_core_1._.isUndefined(this.combinations.find(function (v) {
|
|
27
|
+
var _a = tslib_1.__read(v, 2), from = _a[0], to = _a[1];
|
|
28
|
+
return orgString === to;
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(RenameRule.prototype, "combinations", {
|
|
32
|
+
get: function () {
|
|
33
|
+
var thisTo = this.toWhiteSpaceReplaced;
|
|
34
|
+
var thisFrom = this.fromWhiteSpaceReplaced;
|
|
35
|
+
return [
|
|
36
|
+
// TODO 'rs.asdasd-asd-A.'
|
|
37
|
+
[tnp_core_1._.kebabCase(thisFrom), tnp_core_1._.kebabCase(thisTo)], // my-entity => hello-kitty
|
|
38
|
+
[tnp_core_1._.camelCase(thisFrom), tnp_core_1._.camelCase(thisTo)], // myEntity => helloKitty
|
|
39
|
+
[tnp_core_1._.upperFirst(tnp_core_1._.camelCase(thisFrom)), tnp_core_1._.upperFirst(tnp_core_1._.camelCase(thisTo))], // MyEntity => HelloKitty
|
|
40
|
+
[tnp_core_1._.snakeCase(thisFrom), tnp_core_1._.snakeCase(thisTo)], // my_entity => hello_kitty
|
|
41
|
+
[tnp_core_1._.snakeCase(thisFrom).toUpperCase(), tnp_core_1._.snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY
|
|
42
|
+
[tnp_core_1._.startCase(thisFrom), tnp_core_1._.startCase(thisTo)], // My Entity => Hello Kitty
|
|
43
|
+
[tnp_core_1._.upperCase(thisFrom), tnp_core_1._.upperCase(thisTo)], // MY ENTITY => HELLO KITTY
|
|
44
|
+
[tnp_core_1._.lowerCase(thisFrom), tnp_core_1._.lowerCase(thisTo)], // my entity => hello kitty
|
|
45
|
+
[tnp_core_1._.camelCase(thisFrom).toLocaleLowerCase(), tnp_core_1._.camelCase(thisTo).toLocaleLowerCase()], // myentity => hellokitty
|
|
46
|
+
];
|
|
47
|
+
},
|
|
48
|
+
enumerable: false,
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param orgString (file name OR file content)
|
|
54
|
+
* @param replaceallPossibliliteis when changin file notent (not name only)
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
RenameRule.prototype.replace = function (filename, orgString, replaceallPossibliliteis) {
|
|
58
|
+
if (replaceallPossibliliteis === void 0) { replaceallPossibliliteis = false; }
|
|
59
|
+
var combinations = this.combinations;
|
|
60
|
+
for (var index = 0; index < combinations.length; index++) {
|
|
61
|
+
var v = combinations[index];
|
|
62
|
+
var _a = tslib_1.__read(v, 2), from = _a[0], to = _a[1];
|
|
63
|
+
if (orgString.search(from) !== -1) {
|
|
64
|
+
var regex = new RegExp(tnp_helpers_1.Helpers.escapeStringForRegEx(from));
|
|
65
|
+
log.i("apply! \"".concat(regex.source, "\" to file ").concat(filename, " => \"").concat(to, "\""));
|
|
66
|
+
orgString = orgString.replace(new RegExp(tnp_helpers_1.Helpers.escapeStringForRegEx(from), 'g'), to);
|
|
67
|
+
if (!replaceallPossibliliteis) {
|
|
68
|
+
return orgString;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return orgString;
|
|
73
|
+
};
|
|
74
|
+
return RenameRule;
|
|
75
|
+
}());
|
|
76
|
+
exports.RenameRule = RenameRule;
|
|
77
|
+
//# sourceMappingURL=rename-rule.backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-rule.backend.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/magic-renamer/src/lib/rename-rule.backend.ts"],"names":[],"mappings":";;;;AAAA,2CAAsC;AACtC,qCAA6B;AAC7B,yCAAwC;AACxC,IAAM,GAAG,GAAG,gBAAG,CAAC,MAAM,CAAC,eAAe,EACpC,kBAAK,CAAC,SAAS,CAChB,CAAA;AAGD;IAIE,oBACkB,IAAY,EACZ,EAAU;QAF5B,iBAOC;QANiB,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QAa5B,aAAQ,GAAG;YACT,OAAO,UAAG,KAAI,CAAC,IAAI,iBAAO,KAAI,CAAC,EAAE,CAAE,CAAA;QACrC,CAAC,CAAC;QAZA,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAC3E,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC,IAAI,EAAE,C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C,KAAK,CAAC,CAAC,EAAE,CAAC;gBAClC,IAAM,KAAK,GAAG,IAAI,MAAM,CAAC,qBAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC7D,GAAG,CAAC,CAAC,CAAC,mBAAW,KAAK,CAAC,MAAM,wBAAa,QAAQ,mBAAQ,EAAE,OAAG,CAAC,CAAA;gBAChE,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,qBAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;gBACvF,IAAI,CAAC,wBAAwB,EAAE,CAAC;oBAC9B,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEH,iBAAC;AAAD,CAAC,AAvED,IAuEC;AAvEY,gCAAU"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magic-renamer",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.24",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"taon init": "taon init",
|
|
6
|
+
"taon start": "taon start",
|
|
7
|
+
"taon build:lib": "taon build:lib",
|
|
8
|
+
"taon build:watch:lib": "taon build:watch:lib",
|
|
9
|
+
"taon build:watch:app": "taon build:watch:app",
|
|
10
|
+
"taon build:watch:electron": "taon build:watch:electron",
|
|
11
|
+
"taon docs": "taon docs",
|
|
12
|
+
"taon docs:watch": "taon docs:watch",
|
|
13
|
+
"taon clear": "taon clear",
|
|
14
|
+
"taon release": "taon release",
|
|
15
|
+
"taon release:auto": "taon release:auto",
|
|
16
|
+
"taon release:install:locally": "taon release:install:locally",
|
|
17
|
+
"taon migration:create": "taon migration:create",
|
|
18
|
+
"taon migration:run": "taon migration:run",
|
|
19
|
+
"taon migration:revert": "taon migration:revert",
|
|
20
|
+
"taon vscode:temp:show": "taon vscode:temp:show",
|
|
21
|
+
"taon vscode:temp:hide": "taon vscode:temp:hide"
|
|
22
|
+
},
|
|
4
23
|
"license": "UNLICENSED",
|
|
5
24
|
"author": "Dariusz Filipiak",
|
|
6
25
|
"private": false,
|
|
7
26
|
"dependencies": {
|
|
8
27
|
"tnp-helpers": "~19.0.0"
|
|
9
28
|
},
|
|
29
|
+
"main": "dist/app.electron.js",
|
|
10
30
|
"bin": {
|
|
11
31
|
"magic-renamer": "bin/magic-renamer",
|
|
12
32
|
"magic-renamer-debug": "bin/magic-renamer-debug"
|
package/tmp-environment.json
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"only": []
|
|
10
10
|
},
|
|
11
11
|
"ports": {
|
|
12
|
-
"ngNormalAppPort":
|
|
13
|
-
"ngWebsqlAppPort":
|
|
14
|
-
"nodeBeAppPort":
|
|
12
|
+
"ngNormalAppPort": 4213,
|
|
13
|
+
"ngWebsqlAppPort": 4214,
|
|
14
|
+
"nodeBeAppPort": 4107
|
|
15
15
|
},
|
|
16
16
|
"init": {},
|
|
17
17
|
"build": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"releaseType": "manual",
|
|
31
31
|
"targetArtifact": "npm-lib-and-cli-tool",
|
|
32
32
|
"envName": "__",
|
|
33
|
-
"resolvedNewVersion": "19.0.
|
|
33
|
+
"resolvedNewVersion": "19.0.24"
|
|
34
34
|
},
|
|
35
35
|
"copyToManager": {},
|
|
36
36
|
"buildInfo": {
|
|
37
|
-
"date": "2025-05-
|
|
38
|
-
"hash": "
|
|
37
|
+
"date": "2025-05-20T23:26:42.000Z",
|
|
38
|
+
"hash": "ce47e59a6a8c4321dabb949bc57d3aec4946fe45"
|
|
39
39
|
},
|
|
40
40
|
"currentProjectName": "magic-renamer",
|
|
41
41
|
"currentProjectType": "isomorphic-lib",
|