@strapi/upgrade 0.0.0-experimental.d362bf200f5f9359a4bbd4a549603de5ee1f04ca → 0.0.0-experimental.d3cdf79a0d5f803dfeb6d0f055bb2f3b913bb015
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 +19 -4
- package/README.md +1 -1
- package/dist/cli.js +1578 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.js +671 -412
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +667 -409
- package/dist/index.mjs.map +1 -1
- package/dist/modules/codemod/codemod.d.ts +4 -2
- package/dist/modules/codemod/codemod.d.ts.map +1 -1
- package/dist/modules/codemod/types.d.ts +8 -1
- package/dist/modules/codemod/types.d.ts.map +1 -1
- package/dist/modules/codemod-repository/constants.d.ts.map +1 -1
- package/dist/modules/codemod-repository/repository.d.ts +5 -5
- package/dist/modules/codemod-repository/repository.d.ts.map +1 -1
- package/dist/modules/codemod-repository/types.d.ts +7 -3
- package/dist/modules/codemod-repository/types.d.ts.map +1 -1
- package/dist/modules/codemod-runner/codemod-runner.d.ts +6 -3
- package/dist/modules/codemod-runner/codemod-runner.d.ts.map +1 -1
- package/dist/modules/codemod-runner/index.d.ts +1 -0
- package/dist/modules/codemod-runner/index.d.ts.map +1 -1
- package/dist/modules/codemod-runner/types.d.ts +1 -0
- package/dist/modules/codemod-runner/types.d.ts.map +1 -1
- package/dist/modules/error/utils.d.ts +8 -0
- package/dist/modules/error/utils.d.ts.map +1 -1
- package/dist/modules/file-scanner/scanner.d.ts.map +1 -1
- package/dist/modules/format/formats.d.ts +6 -0
- package/dist/modules/format/formats.d.ts.map +1 -1
- package/dist/modules/project/constants.d.ts +6 -5
- package/dist/modules/project/constants.d.ts.map +1 -1
- package/dist/modules/project/project.d.ts +17 -3
- package/dist/modules/project/project.d.ts.map +1 -1
- package/dist/modules/project/types.d.ts +4 -0
- package/dist/modules/project/types.d.ts.map +1 -1
- package/dist/modules/project/utils.d.ts +1 -1
- package/dist/modules/project/utils.d.ts.map +1 -1
- package/dist/modules/report/report.d.ts.map +1 -1
- package/dist/modules/runner/json/transform.d.ts.map +1 -1
- package/dist/modules/upgrader/types.d.ts +6 -0
- package/dist/modules/upgrader/types.d.ts.map +1 -1
- package/dist/modules/upgrader/upgrader.d.ts +4 -0
- package/dist/modules/upgrader/upgrader.d.ts.map +1 -1
- package/dist/modules/version/range.d.ts +2 -0
- package/dist/modules/version/range.d.ts.map +1 -1
- package/dist/modules/version/types.d.ts +2 -1
- package/dist/modules/version/types.d.ts.map +1 -1
- package/dist/tasks/codemods/index.d.ts +2 -1
- package/dist/tasks/codemods/index.d.ts.map +1 -1
- package/dist/tasks/codemods/list-codemods.d.ts +3 -0
- package/dist/tasks/codemods/list-codemods.d.ts.map +1 -0
- package/dist/tasks/codemods/run-codemods.d.ts +3 -0
- package/dist/tasks/codemods/run-codemods.d.ts.map +1 -0
- package/dist/tasks/codemods/types.d.ts +9 -3
- package/dist/tasks/codemods/types.d.ts.map +1 -1
- package/dist/tasks/codemods/utils.d.ts +6 -0
- package/dist/tasks/codemods/utils.d.ts.map +1 -0
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/upgrade/prompts/index.d.ts +2 -0
- package/dist/tasks/upgrade/prompts/index.d.ts.map +1 -0
- package/dist/tasks/upgrade/prompts/latest.d.ts +9 -0
- package/dist/tasks/upgrade/prompts/latest.d.ts.map +1 -0
- package/dist/tasks/upgrade/requirements/major.d.ts.map +1 -1
- package/dist/tasks/upgrade/upgrade.d.ts.map +1 -1
- package/package.json +11 -11
- package/resources/codemods/5.0.0/comment-out-lifecycle-files.code.ts +63 -0
- package/resources/codemods/5.0.0/dependency-upgrade-react-and-react-dom.json.ts +67 -0
- package/resources/codemods/5.0.0/dependency-upgrade-styled-components.json.ts +49 -0
- package/resources/codemods/5.0.0/deprecate-helper-plugin.code.ts +192 -0
- package/resources/codemods/5.0.0/entity-service-document-service.code.ts +437 -0
- package/resources/codemods/5.0.0/sqlite3-to-better-sqlite3.json.ts +0 -1
- package/resources/codemods/5.0.0/strapi-public-interface.code.ts +126 -0
- package/resources/codemods/5.0.0/utils-public-interface.code.ts +320 -0
- package/resources/codemods/5.1.0/dependency-better-sqlite3.json.ts +48 -0
- package/resources/utils/change-import.ts +118 -0
- package/resources/utils/replace-jsx.ts +49 -0
- package/dist/_chunks/codemod-runner-mXNzVpHm.js +0 -798
- package/dist/_chunks/codemod-runner-mXNzVpHm.js.map +0 -1
- package/dist/_chunks/codemods-S4mNX9Qg.js +0 -105
- package/dist/_chunks/codemods-S4mNX9Qg.js.map +0 -1
- package/dist/_chunks/index-Pt-TU9MN.js +0 -103
- package/dist/_chunks/index-Pt-TU9MN.js.map +0 -1
- package/dist/_chunks/upgrade-aWNYibWB.js +0 -361
- package/dist/_chunks/upgrade-aWNYibWB.js.map +0 -1
- package/dist/tasks/codemods/codemods.d.ts +0 -3
- package/dist/tasks/codemods/codemods.d.ts.map +0 -1
|
@@ -4,16 +4,19 @@ import type { CodemodRunnerInterface, CodemodRunnerReport, SelectCodemodsCallbac
|
|
|
4
4
|
import type { Version } from '../version';
|
|
5
5
|
export declare class CodemodRunner implements CodemodRunnerInterface {
|
|
6
6
|
private readonly project;
|
|
7
|
-
private range
|
|
7
|
+
private range;
|
|
8
8
|
private isDry;
|
|
9
9
|
private logger;
|
|
10
10
|
private selectCodemodsCallback;
|
|
11
|
-
constructor(project: Project, range
|
|
11
|
+
constructor(project: Project, range: Version.Range);
|
|
12
12
|
setRange(range: Version.Range): this;
|
|
13
13
|
setLogger(logger: Logger): this;
|
|
14
14
|
onSelectCodemods(callback: SelectCodemodsCallback | null): this;
|
|
15
15
|
dry(enabled?: boolean): this;
|
|
16
|
+
private createRepository;
|
|
17
|
+
private safeRunAndReport;
|
|
18
|
+
runByUID(uid: string, codemodsDirectory?: string): Promise<CodemodRunnerReport>;
|
|
16
19
|
run(codemodsDirectory?: string): Promise<CodemodRunnerReport>;
|
|
17
20
|
}
|
|
18
|
-
export declare const codemodRunnerFactory: (project: Project, range
|
|
21
|
+
export declare const codemodRunnerFactory: (project: Project, range: Version.Range) => CodemodRunner;
|
|
19
22
|
//# sourceMappingURL=codemod-runner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codemod-runner.d.ts","sourceRoot":"","sources":["../../../src/modules/codemod-runner/codemod-runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codemod-runner.d.ts","sourceRoot":"","sources":["../../../src/modules/codemod-runner/codemod-runner.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACnG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,aAAc,YAAW,sBAAsB;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,OAAO,CAAC,KAAK,CAAgB;IAE7B,OAAO,CAAC,KAAK,CAAU;IAEvB,OAAO,CAAC,MAAM,CAAgB;IAE9B,OAAO,CAAC,sBAAsB,CAAgC;gBAElD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK;IAUlD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK;IAK7B,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,gBAAgB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI;IAKxD,GAAG,CAAC,OAAO,GAAE,OAAc;IAK3B,OAAO,CAAC,gBAAgB;YAWV,gBAAgB;IA4BxB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAa/E,GAAG,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAmCpE;AAED,eAAO,MAAM,oBAAoB,YAAa,OAAO,SAAS,aAAa,kBAE1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/codemod-runner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/codemod-runner/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -15,5 +15,6 @@ export interface CodemodRunnerInterface {
|
|
|
15
15
|
dry(enabled?: boolean): this;
|
|
16
16
|
onSelectCodemods(callback: SelectCodemodsCallback | null): this;
|
|
17
17
|
run(codemodsDirectory?: string): Promise<CodemodRunnerReport>;
|
|
18
|
+
runByUID(uid: string, codemodsDirectory?: string): Promise<CodemodRunnerReport>;
|
|
18
19
|
}
|
|
19
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/codemod-runner/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,sBAAsB,GAAG,CACnC,QAAQ,EAAE,OAAO,CAAC,mBAAmB,EAAE,KACpC,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAC3B;IACE,OAAO,EAAE,IAAI,CAAC;I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I,CAAC;IAC7B,gBAAgB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;IAEhE,GAAG,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9D,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjF"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import type { Version } from '../version';
|
|
1
2
|
export declare class UnexpectedError extends Error {
|
|
2
3
|
constructor();
|
|
3
4
|
}
|
|
5
|
+
export declare class NPMCandidateNotFoundError extends Error {
|
|
6
|
+
target: Version.SemVer | Version.Range | Version.ReleaseType;
|
|
7
|
+
constructor(target: Version.SemVer | Version.Range | Version.ReleaseType, message?: string);
|
|
8
|
+
}
|
|
9
|
+
export declare class AbortedError extends Error {
|
|
10
|
+
constructor(message?: string);
|
|
11
|
+
}
|
|
4
12
|
export declare const unknownToError: (e: unknown) => Error;
|
|
5
13
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/error/utils.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;;CAIzC;AAED,eAAO,MAAM,cAAc,MAAO,OAAO,KAAG,KAU3C,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/error/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,eAAgB,SAAQ,KAAK;;CAIzC;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;gBAG3D,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,EAC5D,OAAO,GAAE,MAA8D;CAM1E;AAED,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,GAAE,MAA0B;CAGhD;AAED,eAAO,MAAM,cAAc,MAAO,OAAO,KAAG,KAU3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../../src/modules/file-scanner/scanner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEnE,qBAAa,WAAY,YAAW,oBAAoB;IAC/C,GAAG,EAAE,MAAM,CAAC;gBAEP,GAAG,EAAE,MAAM;IAIvB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../../src/modules/file-scanner/scanner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEnE,qBAAa,WAAY,YAAW,oBAAoB;IAC/C,GAAG,EAAE,MAAM,CAAC;gBAEP,GAAG,EAAE,MAAM;IAIvB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;CASxB;AAED,eAAO,MAAM,kBAAkB,QAAS,MAAM,gBAAyB,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import type { AppProject, PluginProject, ProjectType } from '../project';
|
|
2
|
+
import type { Codemod } from '../codemod';
|
|
1
3
|
import type { Version } from '../version';
|
|
2
4
|
import type { Report } from '../report';
|
|
3
5
|
export declare const path: (path: string) => string;
|
|
4
6
|
export declare const version: (version: Version.LiteralVersion | Version.SemVer) => string;
|
|
7
|
+
export declare const codemodUID: (uid: string) => string;
|
|
8
|
+
export declare const projectDetails: (project: AppProject | PluginProject) => string;
|
|
9
|
+
export declare const projectType: (type: ProjectType) => string;
|
|
5
10
|
export declare const versionRange: (range: Version.Range) => string;
|
|
6
11
|
export declare const transform: (transformFilePath: string) => string;
|
|
7
12
|
export declare const highlight: (arg: unknown) => string;
|
|
8
13
|
export declare const upgradeStep: (text: string, step: [current: number, total: number]) => string;
|
|
9
14
|
export declare const reports: (reports: Report.CodemodReport[]) => string;
|
|
15
|
+
export declare const codemodList: (codemods: Codemod.List) => string;
|
|
10
16
|
export declare const durationMs: (elapsedMs: number) => string;
|
|
11
17
|
//# sourceMappingURL=formats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../../src/modules/format/formats.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,eAAO,MAAM,IAAI,SAAU,MAAM,WAAqB,CAAC;AAEvD,eAAO,MAAM,OAAO,YAAa,QAAQ,cAAc,GAAG,QAAQ,MAAM,WAEvE,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,aAAa,
|
|
1
|
+
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../../src/modules/format/formats.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,eAAO,MAAM,IAAI,SAAU,MAAM,WAAqB,CAAC;AAEvD,eAAO,MAAM,OAAO,YAAa,QAAQ,cAAc,GAAG,QAAQ,MAAM,WAEvE,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,WAErC,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,UAAU,GAAG,aAAa,WAEjE,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,WAAW,WAAqB,CAAC;AAEnE,eAAO,MAAM,YAAY,UAAW,aAAa,WAAmC,CAAC;AAErF,eAAO,MAAM,SAAS,sBAAuB,MAAM,WAAkC,CAAC;AAEtF,eAAO,MAAM,SAAS,QAAS,OAAO,WAA8B,CAAC;AAErE,eAAO,MAAM,WAAW,SAAU,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,WAE/E,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,OAAO,aAAa,EAAE,WAgCtD,CAAC;AAEF,eAAO,MAAM,WAAW,oCA2BvB,CAAC;AAEF,eAAO,MAAM,UAAU,cAAe,MAAM,WAI3C,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare const PROJECT_PACKAGE_JSON = "package.json";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
2
|
+
export declare const PROJECT_APP_ALLOWED_ROOT_PATHS: string[];
|
|
3
|
+
export declare const PROJECT_PLUGIN_ALLOWED_ROOT_PATHS: string[];
|
|
4
|
+
export declare const PROJECT_PLUGIN_ROOT_FILES: string[];
|
|
5
|
+
export declare const PROJECT_CODE_EXTENSIONS: string[];
|
|
6
|
+
export declare const PROJECT_JSON_EXTENSIONS: string[];
|
|
7
|
+
export declare const PROJECT_ALLOWED_EXTENSIONS: string[];
|
|
7
8
|
export declare const SCOPED_STRAPI_PACKAGE_PREFIX = "@strapi/";
|
|
8
9
|
export declare const STRAPI_DEPENDENCY_NAME = "@strapi/strapi";
|
|
9
10
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/project/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/project/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,eAAO,MAAM,8BAA8B,UAA8B,CAAC;AAE1E,eAAO,MAAM,iCAAiC,UAAsB,CAAC;AAErE,eAAO,MAAM,yBAAyB,UAA0C,CAAC;AAEjF,eAAO,MAAM,uBAAuB,UAQnC,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAW,CAAC;AAEhD,eAAO,MAAM,0BAA0B,UAA2D,CAAC;AAEnG,eAAO,MAAM,4BAA4B,aAAa,CAAC;AAEvD,eAAO,MAAM,sBAAsB,mBAA0C,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Version } from '../version';
|
|
2
2
|
import type { Codemod } from '../codemod';
|
|
3
3
|
import type { Report } from '../report';
|
|
4
|
-
import type { FileExtension, MinimalPackageJSON, RunCodemodsOptions } from './types';
|
|
4
|
+
import type { FileExtension, MinimalPackageJSON, ProjectConfig, RunCodemodsOptions } from './types';
|
|
5
5
|
export declare class Project {
|
|
6
6
|
cwd: string;
|
|
7
7
|
files: string[];
|
|
8
8
|
packageJSONPath: string;
|
|
9
9
|
packageJSON: MinimalPackageJSON;
|
|
10
|
-
|
|
10
|
+
readonly paths: string[];
|
|
11
|
+
constructor(cwd: string, config: ProjectConfig);
|
|
11
12
|
getFilesByExtensions(extensions: FileExtension[]): string[];
|
|
12
13
|
refresh(): this;
|
|
13
14
|
runCodemods(codemods: Codemod.List, options: RunCodemodsOptions): Promise<Report.CodemodReport[]>;
|
|
@@ -17,7 +18,13 @@ export declare class Project {
|
|
|
17
18
|
}
|
|
18
19
|
export declare class AppProject extends Project {
|
|
19
20
|
strapiVersion: Version.SemVer;
|
|
20
|
-
readonly type: "
|
|
21
|
+
readonly type: "application";
|
|
22
|
+
/**
|
|
23
|
+
* Returns an array of allowed file paths for a Strapi application
|
|
24
|
+
*
|
|
25
|
+
* The resulting paths include app default files and the root package.json file.
|
|
26
|
+
*/
|
|
27
|
+
private static get paths();
|
|
21
28
|
constructor(cwd: string);
|
|
22
29
|
refresh(): this;
|
|
23
30
|
private refreshStrapiVersion;
|
|
@@ -26,6 +33,13 @@ export declare class AppProject extends Project {
|
|
|
26
33
|
}
|
|
27
34
|
export declare class PluginProject extends Project {
|
|
28
35
|
readonly type: "plugin";
|
|
36
|
+
/**
|
|
37
|
+
* Returns an array of allowed file paths for a Strapi plugin
|
|
38
|
+
*
|
|
39
|
+
* The resulting paths include plugin default files, the root package.json file, and plugin-specific files.
|
|
40
|
+
*/
|
|
41
|
+
private static get paths();
|
|
42
|
+
constructor(cwd: string);
|
|
29
43
|
}
|
|
30
44
|
export declare const projectFactory: (cwd: string) => AppProject | PluginProject;
|
|
31
45
|
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/modules/project/project.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/modules/project/project.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EAEb,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,qBAAa,OAAO;IACX,GAAG,EAAE,MAAM,CAAC;IAIZ,KAAK,EAAG,MAAM,EAAE,CAAC;IAEjB,eAAe,EAAG,MAAM,CAAC;IAEzB,WAAW,EAAG,kBAAkB,CAAC;IAExC,SAAgB,KAAK,EAAE,MAAM,EAAE,CAAC;gBAEpB,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IAW9C,oBAAoB,CAAC,UAAU,EAAE,aAAa,EAAE;IAQhD,OAAO;IAOD,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,kBAAkB;IAgBrE,OAAO,CAAC,4BAA4B;IAwBpC,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,mBAAmB;CAK5B;AAED,qBAAa,UAAW,SAAQ,OAAO;IAC9B,aAAa,EAAG,OAAO,CAAC,MAAM,CAAC;IAEtC,QAAQ,CAAC,IAAI,gBAAgD;IAE7D;;;;OAIG;IACH,OAAO,CAAC,MAAM,KAAK,KAAK,GAYvB;gBAEW,GAAG,EAAE,MAAM;IAKvB,OAAO;IAMP,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,uCAAuC;IAgB/C,OAAO,CAAC,iCAAiC;CA2B1C;AAWD,qBAAa,aAAc,SAAQ,OAAO;IACxC,QAAQ,CAAC,IAAI,WAA2C;IAExD;;;;OAIG;IACH,OAAO,CAAC,MAAM,KAAK,KAAK,GAgBvB;gBAEW,GAAG,EAAE,MAAM;CAGxB;AAmBD,eAAO,MAAM,cAAc,QAAS,MAAM,+BAIzC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { Utils } from '@strapi/types';
|
|
|
2
2
|
import type { Codemod } from '../codemod';
|
|
3
3
|
import type { Report } from '../report';
|
|
4
4
|
export type FileExtension = `.${string}`;
|
|
5
|
+
export type ProjectType = 'plugin' | 'application';
|
|
5
6
|
export interface RunCodemodsOptions {
|
|
6
7
|
dry?: boolean;
|
|
7
8
|
onCodemodStartRunning?(codemod: Codemod.Codemod, index: number): Promise<void> | void;
|
|
@@ -12,4 +13,7 @@ export type MinimalPackageJSON = {
|
|
|
12
13
|
version: string;
|
|
13
14
|
dependencies?: Record<string, string>;
|
|
14
15
|
} & Utils.JSONObject;
|
|
16
|
+
export interface ProjectConfig {
|
|
17
|
+
paths: string[];
|
|
18
|
+
}
|
|
15
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,IAAI,MAAM,EAAE,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qBAAqB,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtF,sBAAsB,CAAC,CACrB,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,GAAG,KAAK,CAAC,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,IAAI,MAAM,EAAE,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qBAAqB,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtF,sBAAsB,CAAC,CACrB,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,GAAG,KAAK,CAAC,UAAU,CAAC;AAErB,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppProject, PluginProject } from './project';
|
|
2
2
|
export declare const isPluginProject: (project: unknown) => project is PluginProject;
|
|
3
3
|
export declare function assertPluginProject(project: unknown): asserts project is PluginProject;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const isApplicationProject: (project: unknown) => project is AppProject;
|
|
5
5
|
export declare function assertAppProject(project: unknown): asserts project is AppProject;
|
|
6
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/project/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEtD,eAAO,MAAM,eAAe,YAAa,OAAO,6BAE/C,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,aAAa,CAItF;AAED,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/project/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEtD,eAAO,MAAM,eAAe,YAAa,OAAO,6BAE/C,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,aAAa,CAItF;AAED,eAAO,MAAM,oBAAoB,YAAa,OAAO,0BAEpD,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,UAAU,CAIhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/modules/report/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,oBAAoB,YAAa,
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/modules/report/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,oBAAoB,YAAa,QAAQ,OAAO,UAAU,MAAM,KAAG,aAG9E,CAAC;AAEH,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/modules/runner/json/transform.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,uBAAuB,EAAuC,MAAM,SAAS,CAAC;AAE5F,eAAO,MAAM,aAAa,gBACX,MAAM,SACZ,MAAM,EAAE,UACP,uBAAuB,KAC9B,QAAQ,aAAa,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/modules/runner/json/transform.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,uBAAuB,EAAuC,MAAM,SAAS,CAAC;AAE5F,eAAO,MAAM,aAAa,gBACX,MAAM,SACZ,MAAM,EAAE,UACP,uBAAuB,KAC9B,QAAQ,aAAa,CAiFvB,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type { NPM } from '../npm';
|
|
2
|
+
import type { AppProject } from '../project';
|
|
1
3
|
import type { Version } from '../version';
|
|
2
4
|
import type { Requirement } from '../requirement';
|
|
3
5
|
import type { Logger } from '../logger';
|
|
4
6
|
import type { ConfirmationCallback } from '../common/types';
|
|
5
7
|
export interface Upgrader {
|
|
8
|
+
getNPMPackage(): NPM.Package;
|
|
9
|
+
getProject(): AppProject;
|
|
10
|
+
getTarget(): Version.SemVer;
|
|
6
11
|
setTarget(target: Version.SemVer): this;
|
|
7
12
|
setRequirements(requirements: Requirement.Requirement[]): this;
|
|
8
13
|
setLogger(logger: Logger): this;
|
|
@@ -10,6 +15,7 @@ export interface Upgrader {
|
|
|
10
15
|
syncCodemodsTarget(): this;
|
|
11
16
|
dry(enabled?: boolean): this;
|
|
12
17
|
onConfirm(callback: ConfirmationCallback | null): this;
|
|
18
|
+
confirm(message: string): Promise<boolean>;
|
|
13
19
|
addRequirement(requirement: Requirement.Requirement): this;
|
|
14
20
|
upgrade(): Promise<UpgradeReport>;
|
|
15
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/upgrader/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,YAAY,EAAE,WAAW,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IACrD,kBAAkB,IAAI,IAAI,CAAC;IAE3B,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAC;IAEvD,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IAE3D,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,aAAa,GACrB;IACE,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;CACb,GACD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts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AAI,CAAC;CACb,GACD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
|
@@ -15,6 +15,9 @@ export declare class Upgrader implements UpgraderInterface {
|
|
|
15
15
|
private requirements;
|
|
16
16
|
private confirmationCallback;
|
|
17
17
|
constructor(project: AppProject, target: Version.SemVer, npmPackage: NPM.Package);
|
|
18
|
+
getNPMPackage(): NPM.Package;
|
|
19
|
+
getProject(): AppProject;
|
|
20
|
+
getTarget(): Version.SemVer;
|
|
18
21
|
setRequirements(requirements: Requirement.Requirement[]): this;
|
|
19
22
|
setTarget(target: Version.SemVer): this;
|
|
20
23
|
syncCodemodsTarget(): this;
|
|
@@ -24,6 +27,7 @@ export declare class Upgrader implements UpgraderInterface {
|
|
|
24
27
|
dry(enabled?: boolean): this;
|
|
25
28
|
addRequirement(requirement: Requirement.Requirement): this;
|
|
26
29
|
upgrade(): Promise<UpgradeReport>;
|
|
30
|
+
confirm(message: string): Promise<boolean>;
|
|
27
31
|
private checkRequirements;
|
|
28
32
|
private onSuccessfulRequirement;
|
|
29
33
|
private onFailedRequirement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrader.d.ts","sourceRoot":"","sources":["../../../src/modules/upgrader/upgrader.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,QAAQ,IAAI,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB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UAAU,UACX,QAAQ,WAAW,GAAG,QAAQ,MAAM,cAChC,IAAI,OAAO,aAUxB,CAAC"}
|
|
@@ -3,4 +3,6 @@ import * as Version from './types';
|
|
|
3
3
|
export declare const rangeFactory: (range: string) => Version.Range;
|
|
4
4
|
export declare const rangeFromReleaseType: (current: Version.SemVer, identifier: Version.ReleaseType) => semver.Range;
|
|
5
5
|
export declare const rangeFromVersions: (currentVersion: Version.SemVer, target: Version.ReleaseType | Version.SemVer) => semver.Range;
|
|
6
|
+
export declare const isValidStringifiedRange: (str: string) => boolean;
|
|
7
|
+
export declare const isRangeInstance: (range: unknown) => range is semver.Range;
|
|
6
8
|
//# sourceMappingURL=range.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/modules/version/range.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,aAE5C,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAa,QAAQ,MAAM,cAAc,QAAQ,WAAW,
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/modules/version/range.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,aAE5C,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAa,QAAQ,MAAM,cAAc,QAAQ,WAAW,iBAiD5F,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBACZ,QAAQ,MAAM,UACtB,QAAQ,WAAW,GAAG,QAAQ,MAAM,iBAW7C,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,MAAM,YAAoC,CAAC;AAExF,eAAO,MAAM,eAAe,UAAW,OAAO,0BAE7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/version/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,MAAM,cAAc,GACtB,GAAG,OAAO,EAAE,GACZ,GAAG,OAAO,IAAI,OAAO,EAAE,GACvB,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AAE/D,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE5C,oBAAY,WAAW;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/version/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,MAAM,cAAc,GACtB,GAAG,OAAO,EAAE,GACZ,GAAG,OAAO,IAAI,OAAO,EAAE,GACvB,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AAE/D,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE5C,oBAAY,WAAW;IAErB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IAEf,MAAM,WAAW;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-codemods.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/list-codemods.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,YAAY,YAAmB,mBAAmB,kBAmC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-codemods.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/run-codemods.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,eAAO,MAAM,WAAW,YAAmB,kBAAkB,kBAsC5D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SelectCodemodsCallback } from '../../modules/codemod-runner
|
|
2
|
-
import { ConfirmationCallback } from '../../modules/common/types';
|
|
1
|
+
import type { SelectCodemodsCallback } from '../../modules/codemod-runner';
|
|
2
|
+
import type { ConfirmationCallback } from '../../modules/common/types';
|
|
3
3
|
import type { Logger } from '../../modules/logger';
|
|
4
4
|
import type { Version } from '../../modules/version';
|
|
5
5
|
export interface RunCodemodsOptions {
|
|
@@ -8,6 +8,12 @@ export interface RunCodemodsOptions {
|
|
|
8
8
|
selectCodemods: SelectCodemodsCallback;
|
|
9
9
|
cwd?: string;
|
|
10
10
|
dry?: boolean;
|
|
11
|
-
target: Version.ReleaseType | Version.LiteralSemVer;
|
|
11
|
+
target: Version.ReleaseType | Version.LiteralSemVer | Version.Range;
|
|
12
|
+
uid?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ListCodemodsOptions {
|
|
15
|
+
logger: Logger;
|
|
16
|
+
cwd?: string;
|
|
17
|
+
target: Version.ReleaseType | Version.LiteralSemVer | Version.Range;
|
|
12
18
|
}
|
|
13
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,cAAc,EAAE,sBAAsB,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;CACrE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Version } from '../../modules/version';
|
|
2
|
+
import type { Project } from '../../modules/project';
|
|
3
|
+
export declare const resolvePath: (cwd?: string) => string;
|
|
4
|
+
export declare const getRangeFromTarget: (currentVersion: Version.SemVer, target: Version.ReleaseType | Version.LiteralSemVer) => Version.Range;
|
|
5
|
+
export declare const findRangeFromTarget: (project: Project, target: Version.ReleaseType | Version.LiteralSemVer | Version.Range) => Version.Range;
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tasks/codemods/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAmD,MAAM,uBAAuB,CAAC;AAEjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,WAAW,SAAU,MAAM,WAAuC,CAAC;AAEhF,eAAO,MAAM,kBAAkB,mBACb,QAAQ,MAAM,UACtB,QAAQ,WAAW,GAAG,QAAQ,aAAa,kBAoBpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,YACrB,OAAO,UACR,QAAQ,WAAW,GAAG,QAAQ,aAAa,GAAG,aAAa,KAClE,aAeF,CAAC"}
|
package/dist/tasks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tasks/upgrade/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Upgrader } from '../../../modules/upgrader';
|
|
2
|
+
import type { UpgradeOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Handles the upgrade prompts when using the latest tag.
|
|
5
|
+
*
|
|
6
|
+
* - checks if an upgrade involves a major bump, warning and asking for user confirmation before proceeding
|
|
7
|
+
*/
|
|
8
|
+
export declare const latest: (upgrader: Upgrader, options: UpgradeOptions) => Promise<void>;
|
|
9
|
+
//# sourceMappingURL=latest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latest.d.ts","sourceRoot":"","sources":["../../../../src/tasks/upgrade/prompts/latest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,MAAM,aAAoB,QAAQ,WAAW,cAAc,kBAgDvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"major.d.ts","sourceRoot":"","sources":["../../../../src/tasks/upgrade/requirements/major.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"major.d.ts","sourceRoot":"","sources":["../../../../src/tasks/upgrade/requirements/major.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,gEAYxC,CAAC;AAEF,eAAO,MAAM,gCAAgC,gEAmB5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/tasks/upgrade/upgrade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/tasks/upgrade/upgrade.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,OAAO,YAAmB,cAAc,kBAuDpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/upgrade",
|
|
3
|
-
"version": "0.0.0-experimental.
|
|
3
|
+
"version": "0.0.0-experimental.d3cdf79a0d5f803dfeb6d0f055bb2f3b913bb015",
|
|
4
4
|
"description": "CLI to upgrade Strapi applications effortless",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"watch": "pack-up watch"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@strapi/utils": "0.0.0-experimental.
|
|
62
|
+
"@strapi/utils": "0.0.0-experimental.d3cdf79a0d5f803dfeb6d0f055bb2f3b913bb015",
|
|
63
63
|
"chalk": "4.1.2",
|
|
64
64
|
"cli-table3": "0.6.2",
|
|
65
65
|
"commander": "8.3.0",
|
|
66
66
|
"esbuild-register": "3.5.0",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
67
|
+
"fast-glob": "3.3.2",
|
|
68
|
+
"fs-extra": "11.2.0",
|
|
69
69
|
"jscodeshift": "0.15.1",
|
|
70
70
|
"lodash": "4.17.21",
|
|
71
71
|
"memfs": "4.6.0",
|
|
@@ -75,15 +75,15 @@
|
|
|
75
75
|
"simple-git": "3.21.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@strapi/pack-up": "
|
|
79
|
-
"@strapi/types": "0.0.0-experimental.
|
|
78
|
+
"@strapi/pack-up": "5.0.2",
|
|
79
|
+
"@strapi/types": "0.0.0-experimental.d3cdf79a0d5f803dfeb6d0f055bb2f3b913bb015",
|
|
80
|
+
"@types/fs-extra": "11.0.4",
|
|
80
81
|
"@types/jscodeshift": "0.11.10",
|
|
81
|
-
"eslint-config-custom": "0.0.0-experimental.
|
|
82
|
-
"rimraf": "
|
|
82
|
+
"eslint-config-custom": "0.0.0-experimental.d3cdf79a0d5f803dfeb6d0f055bb2f3b913bb015",
|
|
83
|
+
"rimraf": "5.0.5"
|
|
83
84
|
},
|
|
84
85
|
"engines": {
|
|
85
|
-
"node": ">=18.0.0 <=
|
|
86
|
+
"node": ">=18.0.0 <=22.x.x",
|
|
86
87
|
"npm": ">=6.0.0"
|
|
87
|
-
}
|
|
88
|
-
"gitHead": "d362bf200f5f9359a4bbd4a549603de5ee1f04ca"
|
|
88
|
+
}
|
|
89
89
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Transform } from 'jscodeshift';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* comments out lifecycles.js/ts files and adds a description for the reason at the top
|
|
5
|
+
*/
|
|
6
|
+
const transform: Transform = (file, api) => {
|
|
7
|
+
const j = api.jscodeshift;
|
|
8
|
+
const root = j(file.source);
|
|
9
|
+
|
|
10
|
+
// check if file path follows this pattern `content-types/[content-type-name]/lifecycles`
|
|
11
|
+
if (/content-types\/[^/]+\/lifecycles\.(js|ts)$/.test(file.path)) {
|
|
12
|
+
// Get the entire source code as a string
|
|
13
|
+
const sourceCode = root.toSource();
|
|
14
|
+
|
|
15
|
+
// Split the source code into lines and prepend // to each line
|
|
16
|
+
// we are using line comments instead of block comments so we don't face issues with existing block comments
|
|
17
|
+
const commentedCode = sourceCode
|
|
18
|
+
.split('\n')
|
|
19
|
+
.map((line) => `// ${line}`)
|
|
20
|
+
.join('\n');
|
|
21
|
+
|
|
22
|
+
// Add a header comment at the top to explain why the file is commented out
|
|
23
|
+
const headerComment = `
|
|
24
|
+
/*
|
|
25
|
+
*
|
|
26
|
+
* ============================================================
|
|
27
|
+
* WARNING: THIS FILE HAS BEEN COMMENTED OUT
|
|
28
|
+
* ============================================================
|
|
29
|
+
*
|
|
30
|
+
* CONTEXT:
|
|
31
|
+
*
|
|
32
|
+
* The lifecycles.js file has been commented out to prevent unintended side effects when starting Strapi 5 for the first time after migrating to the document service.
|
|
33
|
+
*
|
|
34
|
+
* STRAPI 5 introduces a new document service that handles lifecycles differently compared to previous versions. Without migrating your lifecycles to document service middlewares, you may experience issues such as:
|
|
35
|
+
*
|
|
36
|
+
* - \`unpublish\` actions triggering \`delete\` lifecycles for every locale with a published entity, which differs from the expected behavior in v4.
|
|
37
|
+
* - \`discardDraft\` actions triggering both \`create\` and \`delete\` lifecycles, leading to potential confusion.
|
|
38
|
+
*
|
|
39
|
+
* MIGRATION GUIDE:
|
|
40
|
+
*
|
|
41
|
+
* For a thorough guide on migrating your lifecycles to document service middlewares, please refer to the following link:
|
|
42
|
+
* [Document Services Middlewares Migration Guide](https://docs.strapi.io/dev-docs/migration/v4-to-v5/breaking-changes/lifecycle-hooks-document-service)
|
|
43
|
+
*
|
|
44
|
+
* IMPORTANT:
|
|
45
|
+
*
|
|
46
|
+
* Simply uncommenting this file without following the migration guide may result in unexpected behavior and inconsistencies. Ensure that you have completed the migration process before re-enabling this file.
|
|
47
|
+
*
|
|
48
|
+
* ============================================================
|
|
49
|
+
*/
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
// Combine the header comment with the commented-out code
|
|
53
|
+
const finalCode = `${headerComment}\n${commentedCode}`;
|
|
54
|
+
|
|
55
|
+
return finalCode;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return root.toSource();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const parser = 'tsx';
|
|
62
|
+
|
|
63
|
+
export default transform;
|