Skip to content

Commit

Permalink
Merge pull request #840 from samchon/features/wizard
Browse files Browse the repository at this point in the history
Ban `yarn berry` on setup wizard.
  • Loading branch information
samchon committed Oct 11, 2023
2 parents 6ac2a8d + 2d8d302 commit 1a6d4b9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typia",
"version": "5.2.0",
"version": "5.2.1",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript-json",
"version": "5.2.0",
"version": "5.2.1-dev.20231011",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -72,7 +72,7 @@
},
"homepage": "https://typia.io",
"dependencies": {
"typia": "5.2.0"
"typia": "5.2.1-dev.20231011"
},
"peerDependencies": {
"typescript": ">= 4.8.0"
Expand Down
28 changes: 15 additions & 13 deletions src/executable/TypiaSetupWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,29 @@ export namespace TypiaSetupWizard {
await pack.save((data) => {
// COMPOSE POSTINSTALL COMMAND
data.scripts ??= {};
if (
typeof data.scripts.postinstall === "string" &&
data.scripts.postinstall.trim().length
) {
if (data.scripts.postinstall.indexOf("ts-patch install") === -1)
data.scripts.postinstall =
"ts-patch install && " + data.scripts.postinstall;
} else data.scripts.postinstall = "ts-patch install";

// FOR OLDER VERSIONS
if (typeof data.scripts.prepare === "string") {
data.scripts.prepare = data.scripts.prepare
if (typeof data.scripts.postinstall === "string") {
data.scripts.postinstall = data.scripts.postinstall
.split("&&")
.map((str) => str.trim())
.filter((str) => str.indexOf("ts-patch install") === -1)
.join(" && ");
if (data.scripts.prepare.length === 0)
delete data.scripts.prepare;
if (data.scripts.postinstall.length === 0)
delete data.scripts.postinstall;
}

// THE PREPARE SCRIPT
if (
typeof data.scripts.prepare === "string" &&
data.scripts.prepare.trim().length
) {
if (data.scripts.prepare.indexOf("ts-patch install") === -1)
data.scripts.prepare =
"ts-patch install && " + data.scripts.prepare;
} else data.scripts.prepare = "ts-patch install";
});
CommandExecutor.run(`${pack.manager} run postinstall`);
CommandExecutor.run(`${pack.manager} run prepare`);

// CONFIGURE TYPIA
await PluginConfigurator.configure(args);
Expand Down

0 comments on commit 1a6d4b9

Please sign in to comment.