Skip to content

Commit

Permalink
fix(create-medusa-app): remove glob-related warnings (#7985)
Browse files Browse the repository at this point in the history
On every new installation of `create-medusa-app`, you get a warning related to `glob`'s version.

Since we don't need `glob` anymore (it was used to remove boilerplate files), I've removed it along with its usage. This includes removing the `--no-boilerplate` option.
  • Loading branch information
shahednasser authored Jul 8, 2024
1 parent 4d750c1 commit d2c89e7
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 69 deletions.
3 changes: 1 addition & 2 deletions packages/cli/create-medusa-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"bin": "dist/index.js",
"license": "MIT",
"scripts": {
"dev": "ts-node --esm src/index.ts",
"dev": "node --loader ts-node/esm src/index.ts",
"start": "node dist/index.js",
"build": "tsc",
"watch": "tsc --watch",
Expand All @@ -17,7 +17,6 @@
"boxen": "^5",
"chalk": "^5.2.0",
"commander": "^10.0.1",
"glob": "^7.1.6",
"inquirer": "^9.2.2",
"medusa-telemetry": "^0.0.17",
"nanoid": "^4.0.2",
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/create-medusa-app/src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const slugify = slugifyType.default
export type CreateOptions = {
repoUrl?: string
seed?: boolean
boilerplate?: boolean
skipDb?: boolean
dbUrl?: string
browser?: boolean
Expand All @@ -46,7 +45,6 @@ export type CreateOptions = {
export default async ({
repoUrl = "",
seed,
boilerplate,
skipDb,
dbUrl,
browser,
Expand Down Expand Up @@ -108,7 +106,6 @@ export default async ({
track("CMA_OPTIONS", {
repoUrl,
seed,
boilerplate,
skipDb,
browser,
migrations,
Expand Down Expand Up @@ -176,7 +173,6 @@ export default async ({
directory: projectPath,
dbConnectionString,
seed,
boilerplate,
spinner,
processManager,
abortController,
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/create-medusa-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ program
.description("Create a new Medusa project")
.option("--repo-url <url>", "URL of repository to use to setup project.")
.option("--seed", "Seed the created database with demo data.")
.option(
"--no-boilerplate",
"Install a Medusa project without the boilerplate and demo files."
)
.option(
"--skip-db",
"Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser.",
Expand Down
25 changes: 0 additions & 25 deletions packages/cli/create-medusa-app/src/utils/clear-project.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/cli/create-medusa-app/src/utils/prepare-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import execute from "./execute.js"
import { EOL } from "os"
import { displayFactBox, FactBoxOptions } from "./facts.js"
import ProcessManager from "./process-manager.js"
import { clearProject } from "./clear-project.js"
import type { Client } from "pg"

const ADMIN_EMAIL = "[email protected]"
Expand All @@ -18,7 +17,6 @@ type PrepareOptions = {
directory: string
dbConnectionString: string
seed?: boolean
boilerplate?: boolean
spinner: Ora
processManager: ProcessManager
abortController?: AbortController
Expand All @@ -34,7 +32,6 @@ export default async ({
directory,
dbConnectionString,
seed,
boilerplate,
spinner,
processManager,
abortController,
Expand Down Expand Up @@ -111,19 +108,6 @@ export default async ({
message: "Installed Dependencies",
})

if (!boilerplate) {
factBoxOptions.interval = displayFactBox({
...factBoxOptions,
title: "Preparing Project Directory...",
})
// delete files and directories related to onboarding
clearProject(directory)
displayFactBox({
...factBoxOptions,
message: "Prepared Project Directory",
})
}

factBoxOptions.interval = displayFactBox({
...factBoxOptions,
title: "Building Project...",
Expand Down
17 changes: 0 additions & 17 deletions www/apps/resources/app/create-medusa-app/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ npx create-medusa-app@latest

</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>

`--no-boilerplate`

</Table.Cell>
<Table.Cell>

Whether to remove all files added for an enhanced onboarding experience (files under `src/admin`, `src/api`, etc...). Useful if you want to create a clean project, and is only recommended if you're familiar with Medusa.

</Table.Cell>
<Table.Cell>

`false`

</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>

Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15409,7 +15409,6 @@ __metadata:
eslint-config-google: ^0.14.0
eslint-config-prettier: ^8.8.0
eslint-plugin-prettier: ^4.2.1
glob: ^7.1.6
inquirer: ^9.2.2
medusa-telemetry: ^0.0.17
nanoid: ^4.0.2
Expand Down

0 comments on commit d2c89e7

Please sign in to comment.