magic-renamer 21.0.82 → 21.0.84
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/VERIFIED-BUILD-DATA.jsonc +3 -3
- package/bin/magic-renamer +5 -5
- package/bin/magic-renamer-debug +5 -5
- package/bin/magic-renamer-debug-brk +4 -4
- package/browser/package.json +1 -1
- package/browser-prod/fesm2022/magic-renamer-browser-prod.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/html/assets/generated/pwa/html-pwa.html +60 -0
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib-esm/app.d.ts +0 -0
- package/lib-esm/app.electron.d.ts +0 -0
- package/lib-esm/app.electron.js +82 -0
- package/lib-esm/app.electron.js.map +1 -0
- package/lib-esm/app.hosts.d.ts +3 -0
- package/lib-esm/app.hosts.js +48 -0
- package/lib-esm/app.hosts.js.map +1 -0
- package/lib-esm/app.js +40 -0
- package/lib-esm/app.js.map +1 -0
- package/lib-esm/app.vscode.d.ts +9 -0
- package/lib-esm/app.vscode.js +56 -0
- package/lib-esm/app.vscode.js.map +1 -0
- package/lib-esm/cli.d.ts +1 -0
- package/lib-esm/cli.js +4 -0
- package/lib-esm/cli.js.map +1 -0
- package/lib-esm/index.d.ts +1 -0
- package/lib-esm/index.js +2 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/lib/build-info._auto-generated_.d.ts +24 -0
- package/lib-esm/lib/build-info._auto-generated_.js +27 -0
- package/lib-esm/lib/build-info._auto-generated_.js.map +1 -0
- package/lib-esm/lib/env/env.angular-node-app.d.ts +66 -0
- package/lib-esm/lib/env/env.angular-node-app.js +135 -0
- package/lib-esm/lib/env/env.angular-node-app.js.map +1 -0
- package/lib-esm/lib/env/env.docs-webapp.d.ts +66 -0
- package/lib-esm/lib/env/env.docs-webapp.js +135 -0
- package/lib-esm/lib/env/env.docs-webapp.js.map +1 -0
- package/lib-esm/lib/env/env.electron-app.d.ts +66 -0
- package/lib-esm/lib/env/env.electron-app.js +135 -0
- package/lib-esm/lib/env/env.electron-app.js.map +1 -0
- package/lib-esm/lib/env/env.mobile-app.d.ts +66 -0
- package/lib-esm/lib/env/env.mobile-app.js +135 -0
- package/lib-esm/lib/env/env.mobile-app.js.map +1 -0
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.d.ts +66 -0
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js +135 -0
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js.map +1 -0
- package/lib-esm/lib/env/env.vscode-plugin.d.ts +66 -0
- package/lib-esm/lib/env/env.vscode-plugin.js +135 -0
- package/lib-esm/lib/env/env.vscode-plugin.js.map +1 -0
- package/lib-esm/lib/env/index.d.ts +6 -0
- package/lib-esm/lib/env/index.js +7 -0
- package/lib-esm/lib/env/index.js.map +1 -0
- package/lib-esm/lib/index._auto-generated_.d.ts +0 -0
- package/lib-esm/lib/index._auto-generated_.js +6 -0
- package/lib-esm/lib/index._auto-generated_.js.map +1 -0
- package/lib-esm/lib/index.d.ts +3 -0
- package/lib-esm/lib/index.js +4 -0
- package/lib-esm/lib/index.js.map +1 -0
- package/lib-esm/lib/magic-renamer-data.d.ts +2 -0
- package/lib-esm/lib/magic-renamer-data.js +8 -0
- package/lib-esm/lib/magic-renamer-data.js.map +1 -0
- package/lib-esm/lib/magic-renamer.d.ts +14 -0
- package/lib-esm/lib/magic-renamer.js +184 -0
- package/lib-esm/lib/magic-renamer.js.map +1 -0
- package/lib-esm/lib/migrations/index.d.ts +1 -0
- package/lib-esm/lib/migrations/index.js +3 -0
- package/lib-esm/lib/migrations/index.js.map +1 -0
- package/lib-esm/lib/migrations/migrations_index._auto-generated_.d.ts +0 -0
- package/lib-esm/lib/migrations/migrations_index._auto-generated_.js +4 -0
- package/lib-esm/lib/migrations/migrations_index._auto-generated_.js.map +1 -0
- package/lib-esm/lib/rename-rule.d.ts +35 -0
- package/lib-esm/lib/rename-rule.js +171 -0
- package/lib-esm/lib/rename-rule.js.map +1 -0
- package/lib-esm/lib/start.d.ts +1 -0
- package/lib-esm/lib/start.js +13 -0
- package/lib-esm/lib/start.js.map +1 -0
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/magic-renamer.js.map +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/rename-rule.js.map +1 -1
- package/package.json +1 -1
- package/src.js +4 -20
- package/websql/package.json +1 -1
- package/websql-prod/fesm2022/magic-renamer-websql-prod.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
2
|
+
// website.domain
|
|
3
|
+
export const ENV_VSCODE_PLUGIN_WEBSITE_DOMAIN = 'magic-renamer.example.domain.com';
|
|
4
|
+
// website.title
|
|
5
|
+
export const ENV_VSCODE_PLUGIN_WEBSITE_TITLE = 'Magic Renamer';
|
|
6
|
+
// release.targetArtifact
|
|
7
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_TARGET_ARTIFACT = 'vscode-plugin';
|
|
8
|
+
// release.envName
|
|
9
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_ENV_NAME = '__';
|
|
10
|
+
// container.only
|
|
11
|
+
export const ENV_VSCODE_PLUGIN_CONTAINER_ONLY = undefined;
|
|
12
|
+
// container.end
|
|
13
|
+
export const ENV_VSCODE_PLUGIN_CONTAINER_END = undefined;
|
|
14
|
+
// container.start
|
|
15
|
+
export const ENV_VSCODE_PLUGIN_CONTAINER_START = undefined;
|
|
16
|
+
// container.skipReleased
|
|
17
|
+
export const ENV_VSCODE_PLUGIN_CONTAINER_SKIP_RELEASED = undefined;
|
|
18
|
+
// container.skip
|
|
19
|
+
export const ENV_VSCODE_PLUGIN_CONTAINER_SKIP = undefined;
|
|
20
|
+
// init.branding
|
|
21
|
+
export const ENV_VSCODE_PLUGIN_INIT_BRANDING = undefined;
|
|
22
|
+
// init.struct
|
|
23
|
+
export const ENV_VSCODE_PLUGIN_INIT_STRUCT = undefined;
|
|
24
|
+
// build.pwa.disableServiceWorker
|
|
25
|
+
export const ENV_VSCODE_PLUGIN_BUILD_PWA_DISABLE_SERVICE_WORKER = undefined;
|
|
26
|
+
// build.pwa.name
|
|
27
|
+
export const ENV_VSCODE_PLUGIN_BUILD_PWA_NAME = undefined;
|
|
28
|
+
// build.pwa.short_name
|
|
29
|
+
export const ENV_VSCODE_PLUGIN_BUILD_PWA_SHORT_NAME = undefined;
|
|
30
|
+
// build.pwa.start_url
|
|
31
|
+
export const ENV_VSCODE_PLUGIN_BUILD_PWA_START_URL = undefined;
|
|
32
|
+
// build.electron.showDevTools
|
|
33
|
+
export const ENV_VSCODE_PLUGIN_BUILD_ELECTRON_SHOW_DEV_TOOLS = undefined;
|
|
34
|
+
// build.ssr
|
|
35
|
+
export const ENV_VSCODE_PLUGIN_BUILD_SSR = undefined;
|
|
36
|
+
// build.websql
|
|
37
|
+
export const ENV_VSCODE_PLUGIN_BUILD_WEBSQL = undefined;
|
|
38
|
+
// build.prod
|
|
39
|
+
export const ENV_VSCODE_PLUGIN_BUILD_PROD = undefined;
|
|
40
|
+
// build.overrideOutputPath
|
|
41
|
+
export const ENV_VSCODE_PLUGIN_BUILD_OVERRIDE_OUTPUT_PATH = undefined;
|
|
42
|
+
// build.baseHref
|
|
43
|
+
export const ENV_VSCODE_PLUGIN_BUILD_BASE_HREF = undefined;
|
|
44
|
+
// build.watch
|
|
45
|
+
export const ENV_VSCODE_PLUGIN_BUILD_WATCH = undefined;
|
|
46
|
+
// build.genOnlyClientCode
|
|
47
|
+
export const ENV_VSCODE_PLUGIN_BUILD_GEN_ONLY_CLIENT_CODE = undefined;
|
|
48
|
+
// loading.preAngularBootstrap.loader
|
|
49
|
+
export const ENV_VSCODE_PLUGIN_LOADING_PRE_ANGULAR_BOOTSTRAP_LOADER = undefined;
|
|
50
|
+
// loading.preAngularBootstrap.background
|
|
51
|
+
export const ENV_VSCODE_PLUGIN_LOADING_PRE_ANGULAR_BOOTSTRAP_BACKGROUND = undefined;
|
|
52
|
+
// release.cli.minify
|
|
53
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_CLI_MINIFY = undefined;
|
|
54
|
+
// release.cli.includeNodeModules
|
|
55
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_CLI_INCLUDE_NODE_MODULES = undefined;
|
|
56
|
+
// release.cli.uglify
|
|
57
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_CLI_UGLIFY = undefined;
|
|
58
|
+
// release.cli.obscure
|
|
59
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_CLI_OBSCURE = undefined;
|
|
60
|
+
// release.cli.compress
|
|
61
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_CLI_COMPRESS = undefined;
|
|
62
|
+
// release.nodeBackendApp.minify
|
|
63
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_NODE_BACKEND_APP_MINIFY = undefined;
|
|
64
|
+
// release.lib.removeDts
|
|
65
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_LIB_REMOVE_DTS = undefined;
|
|
66
|
+
// release.lib.obscureFileByFile
|
|
67
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_LIB_OBSCURE_FILE_BY_FILE = undefined;
|
|
68
|
+
// release.lib.uglifyFileByFile
|
|
69
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_LIB_UGLIFY_FILE_BY_FILE = undefined;
|
|
70
|
+
// release.lib.includeSourceMaps
|
|
71
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_LIB_INCLUDE_SOURCE_MAPS = undefined;
|
|
72
|
+
// release.lib.compress
|
|
73
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_LIB_COMPRESS = undefined;
|
|
74
|
+
// release.lib.doNotIncludeLibFiles
|
|
75
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_LIB_DO_NOT_INCLUDE_LIB_FILES = undefined;
|
|
76
|
+
// release.resolvedNewVersion
|
|
77
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_RESOLVED_NEW_VERSION = undefined;
|
|
78
|
+
// release.releaseVersionBumpType
|
|
79
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_RELEASE_VERSION_BUMP_TYPE = undefined;
|
|
80
|
+
// release.envNumber
|
|
81
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_ENV_NUMBER = undefined;
|
|
82
|
+
// release.installLocally
|
|
83
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_INSTALL_LOCALLY = undefined;
|
|
84
|
+
// release.removeReleaseOutputAfterLocalInstall
|
|
85
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_REMOVE_RELEASE_OUTPUT_AFTER_LOCAL_INSTALL = undefined;
|
|
86
|
+
// release.releaseType
|
|
87
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_RELEASE_TYPE = undefined;
|
|
88
|
+
// release.autoReleaseUsingConfig
|
|
89
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_AUTO_RELEASE_USING_CONFIG = undefined;
|
|
90
|
+
// release.autoReleaseTaskName
|
|
91
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_AUTO_RELEASE_TASK_NAME = undefined;
|
|
92
|
+
// release.taonInstanceIp
|
|
93
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_TAON_INSTANCE_IP = undefined;
|
|
94
|
+
// release.skipNpmPublish
|
|
95
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_NPM_PUBLISH = undefined;
|
|
96
|
+
// release.skipDeploy
|
|
97
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_DEPLOY = undefined;
|
|
98
|
+
// release.skipTagGitPush
|
|
99
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_TAG_GIT_PUSH = undefined;
|
|
100
|
+
// release.skipReleaseQuestion
|
|
101
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_RELEASE_QUESTION = undefined;
|
|
102
|
+
// release.skipResolvingGitChanges
|
|
103
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_RESOLVING_GIT_CHANGES = undefined;
|
|
104
|
+
// release.skipCodeCutting
|
|
105
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_CODE_CUTTING = undefined;
|
|
106
|
+
// release.skipBuildingArtifacts
|
|
107
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_BUILDING_ARTIFACTS = undefined;
|
|
108
|
+
// release.pushToAllOriginsWhenLocalReleaseBranch
|
|
109
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_PUSH_TO_ALL_ORIGINS_WHEN_LOCAL_RELEASE_BRANCH = undefined;
|
|
110
|
+
// release.useLocalReleaseBranch
|
|
111
|
+
export const ENV_VSCODE_PLUGIN_RELEASE_USE_LOCAL_RELEASE_BRANCH = undefined;
|
|
112
|
+
// copyToManager.beforeCopyHook
|
|
113
|
+
export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_BEFORE_COPY_HOOK = undefined;
|
|
114
|
+
// copyToManager.copyToLocations
|
|
115
|
+
export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_COPY_TO_LOCATIONS = undefined;
|
|
116
|
+
// copyToManager.copyToProjects
|
|
117
|
+
export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_COPY_TO_PROJECTS = undefined;
|
|
118
|
+
// copyToManager.skip
|
|
119
|
+
export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_SKIP = undefined;
|
|
120
|
+
// website.useDomain
|
|
121
|
+
export const ENV_VSCODE_PLUGIN_WEBSITE_USE_DOMAIN = undefined;
|
|
122
|
+
// purpose
|
|
123
|
+
export const ENV_VSCODE_PLUGIN_PURPOSE = undefined;
|
|
124
|
+
// recursiveAction
|
|
125
|
+
export const ENV_VSCODE_PLUGIN_RECURSIVE_ACTION = undefined;
|
|
126
|
+
// isCiProcess
|
|
127
|
+
export const ENV_VSCODE_PLUGIN_IS_CI_PROCESS = undefined;
|
|
128
|
+
// docker.additionalContainer
|
|
129
|
+
export const ENV_VSCODE_PLUGIN_DOCKER_ADDITIONAL_CONTAINER = undefined;
|
|
130
|
+
// docker.skipStartInOrder
|
|
131
|
+
export const ENV_VSCODE_PLUGIN_DOCKER_SKIP_START_IN_ORDER = undefined;
|
|
132
|
+
// docker.skipUsingMysqlDb
|
|
133
|
+
export const ENV_VSCODE_PLUGIN_DOCKER_SKIP_USING_MYSQL_DB = undefined;
|
|
134
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
135
|
+
//# sourceMappingURL=env.vscode-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.vscode-plugin.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,yCAAyC;AACzC,iBAAiB;AACjB,MAAM,CAAC,MAAM,gCAAgC,GAAG,kCAAkC,CAAC;AACnF,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAAC;AAC/D,yBAAyB;AACzB,MAAM,CAAC,MAAM,yCAAyC,GAAG,eAAe,CAAC;AACzE,kBAAkB;AAClB,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AACvD,iBAAiB;AACjB,MAAM,CAAC,MAAM,gCAAgC,GAAG,SAAS,CAAC;AAC1D,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,SAAS,CAAC;AACzD,kBAAkB;AAClB,MAAM,CAAC,MAAM,iCAAiC,GAAG,SAAS,CAAC;AAC3D,yBAAyB;AACzB,MAAM,CAAC,MAAM,yCAAyC,GAAG,SAAS,CAAC;AACnE,iBAAiB;AACjB,MAAM,CAAC,MAAM,gCAAgC,GAAG,SAAS,CAAC;AAC1D,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,SAAS,CAAC;AACzD,cAAc;AACd,MAAM,CAAC,MAAM,6BAA6B,GAA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
+
export * from './env.docs-webapp';
|
|
3
|
+
export * from './env.electron-app';
|
|
4
|
+
export * from './env.mobile-app';
|
|
5
|
+
export * from './env.npm-lib-and-cli-tool';
|
|
6
|
+
export * from './env.vscode-plugin';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is auto-generated during init process. Do not modify.
|
|
3
|
+
// This is only placeholder.
|
|
4
|
+
// Use property "shouldGenerateAutogenIndexFile: true"
|
|
5
|
+
// in taon.jsonc to enable ts exports auto generation.
|
|
6
|
+
//# sourceMappingURL=index._auto-generated_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc;AACd,kEAAkE;AAClE,4BAA4B;AAC5B,uDAAuD;AACvD,uDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-renamer-data.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,MAAM,CAAC,MAAM,OAAO,GAAG;AACrB,mBAAmB;CACpB,CAAA;AAED,MAAM,UAAU,WAAW,CAAC,QAAe;IACzC,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RenameRule } from './rename-rule';
|
|
2
|
+
export declare class MagicRenamer {
|
|
3
|
+
private readonly cwd;
|
|
4
|
+
private verbose;
|
|
5
|
+
private static _instances;
|
|
6
|
+
private constructor();
|
|
7
|
+
static Instance(cwd?: string, silent?: boolean): MagicRenamer;
|
|
8
|
+
rules: RenameRule[];
|
|
9
|
+
omitPatterns: string[];
|
|
10
|
+
start(pArgs: string, omitPatterns?: string[]): void;
|
|
11
|
+
private changeFiles;
|
|
12
|
+
private changeContent;
|
|
13
|
+
private getAllFilesFoldersRecusively;
|
|
14
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
//#region imports
|
|
2
|
+
import * as micromatch from 'micromatch'; // @backend
|
|
3
|
+
import { Log, Level } from 'ng2-logger/lib';
|
|
4
|
+
import { _, path, crossPlatformPath, Utils, UtilsFilesFoldersSync, } from 'tnp-core/lib';
|
|
5
|
+
import { Helpers } from 'tnp-core/lib';
|
|
6
|
+
import { RenameRule } from './rename-rule';
|
|
7
|
+
//#endregion
|
|
8
|
+
const log = Log.create('magic-renemer', Level.WARN, Level.ERROR);
|
|
9
|
+
export class MagicRenamer {
|
|
10
|
+
cwd;
|
|
11
|
+
verbose;
|
|
12
|
+
//#region @backend
|
|
13
|
+
//#region singleton
|
|
14
|
+
static _instances = {};
|
|
15
|
+
constructor(cwd, verbose) {
|
|
16
|
+
this.cwd = cwd;
|
|
17
|
+
this.verbose = verbose;
|
|
18
|
+
}
|
|
19
|
+
static Instance(cwd = process.cwd(), silent = false) {
|
|
20
|
+
cwd = crossPlatformPath(cwd);
|
|
21
|
+
if (!MagicRenamer._instances[cwd]) {
|
|
22
|
+
MagicRenamer._instances[cwd] = new MagicRenamer(cwd, !silent);
|
|
23
|
+
}
|
|
24
|
+
return MagicRenamer._instances[cwd];
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region fields
|
|
28
|
+
rules = [];
|
|
29
|
+
//#endregion
|
|
30
|
+
omitPatterns = UtilsFilesFoldersSync.IGNORE_FOLDERS_FILES_PATTERNS;
|
|
31
|
+
//#region public api
|
|
32
|
+
//#region public api / start
|
|
33
|
+
start(pArgs, omitPatterns) {
|
|
34
|
+
if (_.isUndefined(omitPatterns)) {
|
|
35
|
+
omitPatterns = UtilsFilesFoldersSync.IGNORE_FOLDERS_FILES_PATTERNS;
|
|
36
|
+
}
|
|
37
|
+
this.omitPatterns = omitPatterns;
|
|
38
|
+
const orgArgs = pArgs;
|
|
39
|
+
this.verbose && Helpers.info('\n\n\nRebranding of files');
|
|
40
|
+
// let options = Helpers.cliTool.argsFrom<{}>(pArgs);
|
|
41
|
+
// pArgs = Helpers.cliTool.cleanCommand(pArgs, options);
|
|
42
|
+
// let relativePath = _.first(pArgs.split(' '));
|
|
43
|
+
// pArgs = pArgs.replace(relativePath, '');
|
|
44
|
+
pArgs = decodeURIComponent(pArgs);
|
|
45
|
+
// console.log({
|
|
46
|
+
// pArgs
|
|
47
|
+
// })
|
|
48
|
+
this.rules = RenameRule.from(pArgs);
|
|
49
|
+
this.verbose &&
|
|
50
|
+
console.log(`Detected rules (${this.rules.length}):
|
|
51
|
+
${this.rules.map(r => r.toString()).join('\n')}`);
|
|
52
|
+
if (this.rules.length === 0) {
|
|
53
|
+
// console.log({
|
|
54
|
+
// pArgs
|
|
55
|
+
// })
|
|
56
|
+
Helpers.error(`[magic-renamer] Please provide rules:
|
|
57
|
+
example:
|
|
58
|
+
<command> 'my-module -> my-new-modules'
|
|
59
|
+
your args: "${orgArgs}"
|
|
60
|
+
|
|
61
|
+
`, false, true);
|
|
62
|
+
}
|
|
63
|
+
let folder = this.cwd;
|
|
64
|
+
let files = this.getAllFilesFoldersRecusively(folder); //filter(f => crossPlatformPath(f) === folder)
|
|
65
|
+
this.verbose &&
|
|
66
|
+
Helpers.info(`Detecteed files (${files.length}) in folder ${folder}:
|
|
67
|
+
${files.map(f => `- ${f.replace(folder, '')}`).join('\n')}`);
|
|
68
|
+
const starCallback = newFolder => {
|
|
69
|
+
if (newFolder) {
|
|
70
|
+
folder = newFolder;
|
|
71
|
+
}
|
|
72
|
+
files = this.getAllFilesFoldersRecusively(folder);
|
|
73
|
+
this.changeFiles(folder, files, starCallback);
|
|
74
|
+
};
|
|
75
|
+
this.changeFiles(folder, files, starCallback);
|
|
76
|
+
files = this.getAllFilesFoldersRecusively(folder, true);
|
|
77
|
+
this.changeContent(files);
|
|
78
|
+
this.verbose && console.log('PROCESS DONE');
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region private methods
|
|
83
|
+
changeFiles(folder, files = [], startProcessAgain, isFirstCall = true) {
|
|
84
|
+
if (files.length === 0) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
let fileAbsPath = files.shift();
|
|
88
|
+
log.d(`Processing file: ${path.basename(fileAbsPath)}`);
|
|
89
|
+
const fileName = path.basename(fileAbsPath);
|
|
90
|
+
for (let index = 0; index < this.rules.length; index++) {
|
|
91
|
+
const rule = this.rules[index];
|
|
92
|
+
// log.d(`Checking rule ${r}`)
|
|
93
|
+
if (rule.applyTo(fileName) && !rule.includes(fileName)) {
|
|
94
|
+
log.d(`Apply to: ${fileName}`);
|
|
95
|
+
const destChangedToNewName = crossPlatformPath([
|
|
96
|
+
path.dirname(fileAbsPath),
|
|
97
|
+
rule.replace({
|
|
98
|
+
fileName,
|
|
99
|
+
orgString: fileName,
|
|
100
|
+
replaceAllPossibilities: false,
|
|
101
|
+
}),
|
|
102
|
+
]);
|
|
103
|
+
// console.log(`des ${destChangedToNewName}`);
|
|
104
|
+
if (crossPlatformPath(fileAbsPath) === folder) {
|
|
105
|
+
const filter = src => {
|
|
106
|
+
const exclude = micromatch.isMatch(src, this.omitPatterns, {
|
|
107
|
+
dot: true,
|
|
108
|
+
});
|
|
109
|
+
return !exclude;
|
|
110
|
+
// return !/.*node_modules.*/g.test(src);
|
|
111
|
+
};
|
|
112
|
+
UtilsFilesFoldersSync.copy(fileAbsPath, destChangedToNewName, {
|
|
113
|
+
filter,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
if (fileAbsPath !== destChangedToNewName) {
|
|
118
|
+
UtilsFilesFoldersSync.move(fileAbsPath, destChangedToNewName);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
console.warn(`Trying to move into same dest ${destChangedToNewName}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
fileAbsPath = destChangedToNewName;
|
|
125
|
+
if (path.extname(destChangedToNewName) === '') {
|
|
126
|
+
files.length = 0;
|
|
127
|
+
log.d(`Starting process again from: ${destChangedToNewName}`);
|
|
128
|
+
startProcessAgain(isFirstCall ? destChangedToNewName : void 0);
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
log.d(`Not apply to: ${fileName}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return this.changeFiles(folder, _.cloneDeep(files), startProcessAgain, false);
|
|
137
|
+
}
|
|
138
|
+
changeContent(files = []) {
|
|
139
|
+
if (files.length === 0) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const fileAbsPath = files.shift() || '';
|
|
143
|
+
log.d(`Processing content of file: ${path.basename(fileAbsPath)}`);
|
|
144
|
+
const fileContent = Helpers.readFile(fileAbsPath) || '';
|
|
145
|
+
const rules = this.rules;
|
|
146
|
+
for (let index = 0; index < rules.length; index++) {
|
|
147
|
+
const r = rules[index];
|
|
148
|
+
log.d(`Checking rule ${r}`);
|
|
149
|
+
if (r.applyTo(fileContent)) {
|
|
150
|
+
log.d(`Write file: ${fileAbsPath}`);
|
|
151
|
+
// shouldDebug(fileAbsPath) && console.log(fileContent)
|
|
152
|
+
const replaced = r.replace({
|
|
153
|
+
fileName: fileAbsPath,
|
|
154
|
+
orgString: fileContent,
|
|
155
|
+
replaceAllPossibilities: true,
|
|
156
|
+
});
|
|
157
|
+
// shouldDebug(fileAbsPath) && console.log(replaced)
|
|
158
|
+
Helpers.writeFile(fileAbsPath, replaced);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
log.d(`Not apply to: ${fileAbsPath}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
this.changeContent(files);
|
|
165
|
+
}
|
|
166
|
+
getAllFilesFoldersRecusively(cwdFolder, filesOnly) {
|
|
167
|
+
filesOnly = !!filesOnly;
|
|
168
|
+
const files = UtilsFilesFoldersSync.getFilesFrom(cwdFolder, {
|
|
169
|
+
recursive: true,
|
|
170
|
+
followSymlinks: false,
|
|
171
|
+
omitPatterns: this.omitPatterns,
|
|
172
|
+
});
|
|
173
|
+
if (filesOnly) {
|
|
174
|
+
return [...files].sort();
|
|
175
|
+
}
|
|
176
|
+
const folders = UtilsFilesFoldersSync.getFoldersFrom(cwdFolder, {
|
|
177
|
+
recursive: true,
|
|
178
|
+
followSymlinks: false,
|
|
179
|
+
omitPatterns: this.omitPatterns,
|
|
180
|
+
});
|
|
181
|
+
return Utils.uniqArray([cwdFolder, ...files, ...folders]).sort();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=magic-renamer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-renamer.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,iBAAiB;AACjB,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC,CAAC,WAAW;AACrD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,CAAC,EACD,IAAI,EAGJ,iBAAiB,EAEjB,KAAK,EAGL,qBAAqB,GAEtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OA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,CAAC,iBAAiB,WAAW,EAAE,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEO,4BAA4B,CAAC,SAAiB,EAAE,SAAmB;QACzE,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC;QACxB,MAAM,KAAK,GAAG,qBAAqB,CAAC,YAAY,CAAC,SAAS,EAAE;YAC1D,SAAS,EAAE,IAAI;YACf,cAAc,EAAE,KAAK;YACrB,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAC;QAEH,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC;QAED,MAAM,OAAO,GAAG,qBAAqB,CAAC,cAAc,CAAC,SAAS,EAAE;YAC9D,SAAS,EAAE,IAAI;YACf,cAAc,EAAE,KAAK;YACrB,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACnE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './migrations_index._auto-generated_';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,qCAAqC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations_index._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,yCAAyC;AAEzC,yCAAyC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class RenameRule {
|
|
2
|
+
readonly from: string;
|
|
3
|
+
readonly to: string;
|
|
4
|
+
static from(pArgs: string): RenameRule[];
|
|
5
|
+
readonly fromWhiteSpaceReplaced: string;
|
|
6
|
+
readonly toWhiteSpaceReplaced: string;
|
|
7
|
+
constructor(from: string, to: string);
|
|
8
|
+
applyTo(s: string): boolean;
|
|
9
|
+
toString: () => string;
|
|
10
|
+
includes(orgString: any): boolean;
|
|
11
|
+
combinationsData(getAll?: boolean): {
|
|
12
|
+
isWeakFrom: boolean;
|
|
13
|
+
combinationsAll?: string[][];
|
|
14
|
+
combinationsInClass?: string[][];
|
|
15
|
+
combinationsInTemplate?: string[][];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @param orgString input string
|
|
19
|
+
* @returns string with all possible combinations replaced
|
|
20
|
+
*/
|
|
21
|
+
replaceInString(orgString: string): string;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param orgString (file name OR file content)
|
|
25
|
+
* @param replaceAllPossibilities when changing file notent (not name only)
|
|
26
|
+
*/
|
|
27
|
+
replace(options: {
|
|
28
|
+
/**
|
|
29
|
+
* file name for debugging
|
|
30
|
+
*/
|
|
31
|
+
fileName?: string;
|
|
32
|
+
orgString: string;
|
|
33
|
+
replaceAllPossibilities?: boolean;
|
|
34
|
+
}): string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Log, Level } from 'ng2-logger/lib';
|
|
2
|
+
import { Helpers, Utils } from 'tnp-core/lib';
|
|
3
|
+
import { _, UtilsString } from 'tnp-core/lib';
|
|
4
|
+
const log = Log.create('rename-rule', Level.WARN, Level.ERROR);
|
|
5
|
+
export class RenameRule {
|
|
6
|
+
from;
|
|
7
|
+
to;
|
|
8
|
+
static from(pArgs) {
|
|
9
|
+
pArgs = pArgs.replace(/\=\>/g, '->');
|
|
10
|
+
let args = pArgs.split(/(\'|\")(\ )+(\'|\")/).filter(f => !!f);
|
|
11
|
+
log.d('---- Rules ----');
|
|
12
|
+
args.forEach(a => {
|
|
13
|
+
log.d(a);
|
|
14
|
+
});
|
|
15
|
+
log.d('---------------');
|
|
16
|
+
return args
|
|
17
|
+
.filter(a => a.search('->') !== -1)
|
|
18
|
+
.map(a => {
|
|
19
|
+
const [from, to] = a.split('->');
|
|
20
|
+
if (!from || !to) {
|
|
21
|
+
Helpers.error(`Incorrect rule
|
|
22
|
+
"${from}" -> "${to}"
|
|
23
|
+
please follow pattern: 'test name -> my new name '`, false, true);
|
|
24
|
+
}
|
|
25
|
+
return new RenameRule(from.trim(), to.trim());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
fromWhiteSpaceReplaced;
|
|
29
|
+
toWhiteSpaceReplaced;
|
|
30
|
+
constructor(from, to) {
|
|
31
|
+
this.from = from;
|
|
32
|
+
this.to = to;
|
|
33
|
+
this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\W/g, ' ');
|
|
34
|
+
this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\W/g, ' ');
|
|
35
|
+
}
|
|
36
|
+
applyTo(s) {
|
|
37
|
+
s = s.trim().toLowerCase().replace(/\W/g, '');
|
|
38
|
+
const res = s.search(this.from.replace(/\W/g, '')) !== -1;
|
|
39
|
+
return res;
|
|
40
|
+
}
|
|
41
|
+
toString = () => {
|
|
42
|
+
return `${this.from} => ${this.to}`;
|
|
43
|
+
};
|
|
44
|
+
includes(orgString) {
|
|
45
|
+
return !_.isUndefined(this.combinationsData(true).combinationsAll.find(v => {
|
|
46
|
+
const [from, to] = v;
|
|
47
|
+
return orgString === to;
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
combinationsData(getAll = false) {
|
|
51
|
+
const thisTo = this.toWhiteSpaceReplaced;
|
|
52
|
+
const thisFrom = this.fromWhiteSpaceReplaced;
|
|
53
|
+
/**
|
|
54
|
+
* Example: thisFrom === 'entity'; thisTo => 'entity-new'
|
|
55
|
+
* - we are not sure if 'entity' alone should be 'entity-new' or 'entityNew'
|
|
56
|
+
*/
|
|
57
|
+
const isWeakFrom = _.kebabCase(thisFrom).split('-').length <= 1;
|
|
58
|
+
if (isWeakFrom && !getAll) {
|
|
59
|
+
return {
|
|
60
|
+
isWeakFrom,
|
|
61
|
+
combinationsInTemplate: [
|
|
62
|
+
[_.upperCase(thisFrom), _.snakeCase(thisTo).toUpperCase()], // ENTITY => HELLO_KITTY
|
|
63
|
+
[
|
|
64
|
+
_.upperFirst(_.camelCase(thisFrom)),
|
|
65
|
+
_.upperFirst(_.camelCase(thisTo)),
|
|
66
|
+
], // Entity => HelloKitty
|
|
67
|
+
['"' + _.camelCase(thisFrom) + '.', '"' + _.camelCase(thisTo) + '.'], // entity => helloKitty
|
|
68
|
+
[
|
|
69
|
+
UtilsString.kebabCaseNoSplitNumbers(thisFrom),
|
|
70
|
+
UtilsString.kebabCaseNoSplitNumbers(thisTo),
|
|
71
|
+
], // entity1 => hello1-kitty
|
|
72
|
+
],
|
|
73
|
+
combinationsInClass: [
|
|
74
|
+
[
|
|
75
|
+
_.upperFirst(_.camelCase(thisFrom)),
|
|
76
|
+
_.upperFirst(_.camelCase(thisTo)),
|
|
77
|
+
], // Entity => HelloKitty
|
|
78
|
+
[_.upperCase(thisFrom), _.snakeCase(thisTo).toUpperCase()], // MY ENTITY => HELLO_KITTY
|
|
79
|
+
[_.camelCase(thisFrom), _.camelCase(thisTo)], // entity => helloKitty
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
isWeakFrom: false,
|
|
85
|
+
combinationsAll: [
|
|
86
|
+
// TODO 'rs.asdasd-asd-A.'
|
|
87
|
+
[
|
|
88
|
+
UtilsString.kebabCaseNoSplitNumbers(thisFrom),
|
|
89
|
+
UtilsString.kebabCaseNoSplitNumbers(thisTo),
|
|
90
|
+
], // my-entity => hello1-kitty
|
|
91
|
+
[_.kebabCase(thisFrom), _.kebabCase(thisTo)], // my-entity => hello-kitty
|
|
92
|
+
[_.camelCase(thisFrom), _.camelCase(thisTo)], // myEntity => helloKitty
|
|
93
|
+
[
|
|
94
|
+
_.upperFirst(_.camelCase(thisFrom)),
|
|
95
|
+
_.upperFirst(_.camelCase(thisTo)),
|
|
96
|
+
], // MyEntity => HelloKitty
|
|
97
|
+
[_.snakeCase(thisFrom), _.snakeCase(thisTo)], // my_entity => hello_kitty
|
|
98
|
+
[
|
|
99
|
+
_.snakeCase(thisFrom).toUpperCase(),
|
|
100
|
+
_.snakeCase(thisTo).toUpperCase(),
|
|
101
|
+
], // MY_ENTITY => HELLO_KITTY
|
|
102
|
+
[_.startCase(thisFrom), _.startCase(thisTo)], // My Entity => Hello Kitty
|
|
103
|
+
[_.upperCase(thisFrom), _.upperCase(thisTo)], // MY ENTITY => HELLO KITTY
|
|
104
|
+
[_.lowerCase(thisFrom), _.lowerCase(thisTo)], // my entity => hello kitty
|
|
105
|
+
[
|
|
106
|
+
_.camelCase(thisFrom).toLocaleLowerCase(),
|
|
107
|
+
_.camelCase(thisTo).toLocaleLowerCase(),
|
|
108
|
+
], // myentity => hellokitty
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @param orgString input string
|
|
114
|
+
* @returns string with all possible combinations replaced
|
|
115
|
+
*/
|
|
116
|
+
replaceInString(orgString) {
|
|
117
|
+
return this.replace({
|
|
118
|
+
orgString,
|
|
119
|
+
replaceAllPossibilities: true,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param orgString (file name OR file content)
|
|
125
|
+
* @param replaceAllPossibilities when changing file notent (not name only)
|
|
126
|
+
*/
|
|
127
|
+
replace(options) {
|
|
128
|
+
let { fileName, orgString, replaceAllPossibilities } = options;
|
|
129
|
+
if (typeof orgString !== 'string') {
|
|
130
|
+
Helpers.log({ orgString });
|
|
131
|
+
Helpers.warn(`[magic-renamer][not a string] fielname ${fileName}`);
|
|
132
|
+
return orgString;
|
|
133
|
+
}
|
|
134
|
+
replaceAllPossibilities = !!replaceAllPossibilities;
|
|
135
|
+
const combinationsData = this.combinationsData();
|
|
136
|
+
if (combinationsData.isWeakFrom) {
|
|
137
|
+
const lines = orgString.split('\n');
|
|
138
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
139
|
+
const line = lines[lineIndex];
|
|
140
|
+
let combinations = combinationsData.combinationsInTemplate;
|
|
141
|
+
if (line.includes('inject(')) {
|
|
142
|
+
// QUICK_FIX for component class variables
|
|
143
|
+
combinations = combinationsData.combinationsInClass;
|
|
144
|
+
}
|
|
145
|
+
for (let combinationIndex = 0; combinationIndex < combinations.length; combinationIndex++) {
|
|
146
|
+
let [from, to] = combinations[combinationIndex];
|
|
147
|
+
// console.log({ from, to });
|
|
148
|
+
lines[lineIndex] = lines[lineIndex].replace(new RegExp(Utils.escapeStringForRegEx(from), 'g'), to);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
orgString = lines.join('\n');
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
const combinations = combinationsData.combinationsAll;
|
|
155
|
+
for (let combinationIndex = 0; combinationIndex < combinations.length; combinationIndex++) {
|
|
156
|
+
const combination = combinations[combinationIndex];
|
|
157
|
+
let [from, to] = combination;
|
|
158
|
+
if (orgString.search(from) !== -1) {
|
|
159
|
+
const regex = new RegExp(Utils.escapeStringForRegEx(from));
|
|
160
|
+
log.i(`apply! "${regex.source}" to file ${fileName} => "${to}"`);
|
|
161
|
+
orgString = orgString.replace(new RegExp(Utils.escapeStringForRegEx(from), 'g'), to);
|
|
162
|
+
if (!replaceAllPossibilities) {
|
|
163
|
+
return orgString;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return orgString;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=rename-rule.js.map
|