Skip to content

Commit

Permalink
Update tsconfig.json, package.json, and metadata.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Feb 23, 2024
1 parent 5f0c3e6 commit 8be1c6e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 53 deletions.
3 changes: 1 addition & 2 deletions packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@
"access": "public"
},
"dependencies": {
"@master/css": "2.0.0-rc.13",
"@techor/fs": "^3.0.11",
"@techor/log": "^3.0.11",
"commander": "^12.0.0",
"detect-package-manager": "^3.0.1",
"giget": "^1.2.1",
"nypm": "^0.3.6",
"ora": "^8.0.1"
},
"devDependencies": {
Expand Down
23 changes: 10 additions & 13 deletions packages/create/src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { resolve } from 'node:path'
import { Command } from 'commander'
import { readJSONFileSync } from '@techor/fs'
import log from '@techor/log'
import { PackageManager, addDependency, detectPackageManager, installDependencies, packageManagers } from 'nypm'
import { detect as detectPackageManager, PM } from 'detect-package-manager'
import detectAppExt from '../detect-app-ext'
import detectAppTech from '../detect-app-tech'
import { downloadTemplate } from 'giget'
Expand Down Expand Up @@ -35,15 +35,12 @@ program
.option('--pm <package manager>', 'Specify the package manager npm, yarn, pnpm, bun')
.option('--example <folder name>', 'Specify the example folder name', 'blank')
.action(async function (appName: string | undefined, options: Options) {
let pm: PackageManager
if (options.pm) {
pm = packageManagers.find((eachPM) => eachPM.name === options.pm)!
} else {
pm = await detectPackageManager(process.cwd()) || packageManagers.find((eachPM) => eachPM.name === 'npm')!
if (!options.pm) {
options.pm = await detectPackageManager()
}
// Create a new app with the example
if (appName) {
log.i(`Detected **${pm.name}**`)
log.i(`Detected **${options.pm}**`)
const spinner = ora(`Initializing Master CSS`).start()
const examplePath = `github:master-co/css/examples/${options.example}#${BRANCH}`
spinner.start(`Cloning example from "${examplePath}"`)
Expand Down Expand Up @@ -80,15 +77,15 @@ program
writeFileSync('package.json', JSON.stringify(appPkg, null, 4), { flag: 'w' })
spinner.stop()
log.ok`Cloned example from "${examplePath}"`
log.i`Start "${pm.name} install" for dependencies: ${targetPackages}`
log.i`Start "${options.pm} install" for dependencies: ${targetPackages}`
log``
try {
await installDependencies({ packageManager: pm })
execSync(`${options.pm} install`, { stdio: 'inherit' })
log``
log.ok`Created **${appName}**`
log.i`Commands in this app:`
console.table(appPkg.scripts)
log.i`Start by running "cd ${appName} && ${pm.command} run ${appPkg.scripts?.dev ? 'dev' : 'start'}"`
log.i`Start by running "cd ${appName} && ${options.pm} run ${appPkg.scripts?.dev ? 'dev' : 'start'}"`
} catch (error) {
spinner.fail()
throw error
Expand Down Expand Up @@ -121,10 +118,10 @@ program
break
}
if (!appPkg?.dependencies?.['@master/css']) {
log.i(`Detected **${pm.name}**`)
log.i`Start "${pm.command} add @master/css@${BRANCH}"`
log.i(`Detected **${options.pm}**`)
log.i`Start "${options.pm} add @master/css@${BRANCH}"`
log``
addDependency(`@master/css@${BRANCH}`, { packageManager: pm })
execSync(`${options.pm} add @master/css@rc`, { stdio: 'inherit' })
log``
}
const tech = detectAppTech()
Expand Down
45 changes: 10 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"baseUrl": ".",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand Down
10 changes: 8 additions & 2 deletions website/app/[locale]/(root)/docs/introduction/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { Metadata } from 'websites/types/Metadata'

const metadata: Metadata = {
title: 'Introduction',
title: 'The All-in-One CSS Solution for Building Modern and Performant Websites',
description: 'Get a quick overview of Master CSS and its benefits.',
category: 'Getting Started',
disabled: true,
order: 1
order: 1,
openGraph: {
title: 'Introduction'
},
other: {
subject: 'Introduction'
}
}

export default metadata

0 comments on commit 8be1c6e

Please sign in to comment.