Skip to content

Commit 91ed686

Browse files
committed
fix: install scripts
1 parent ea97aa3 commit 91ed686

File tree

5 files changed

+17
-34
lines changed

5 files changed

+17
-34
lines changed

.changeset/tall-experts-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pliny/cli': patch
3+
---
4+
5+
fix install scripts

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pliny install add-blog ContentDir=data ContentName=blog
3333
Add the blog-classic templates to the `layouts` folder:
3434

3535
```bash
36-
pliny install add-classic
36+
pliny install blog-classic
3737
```
3838

3939
## Features

packages/cli/oclif.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"0.0.1-rc.11","commands":{"install":{"id":"install","description":"Install a Pliny recipe into your Next app","strict":false,"pluginName":"@pliny/cli","pluginAlias":"@pliny/cli","pluginType":"core","aliases":["i"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"yes":{"name":"yes","type":"boolean","char":"y","description":"Install the recipe automatically without user confirmation","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Set app environment name","multiple":false}},"args":[{"name":"recipe","description":"Name of a Pliny recipe from timlrx/pliny/recipes, or a file path to a local recipe definition","required":false},{"name":"recipe-flags","description":"A list of flags to pass to the recipe. Pliny will only parse these in the form `key=value`"}],"_globalFlags":{}},"new":{"id":"new","description":"Create new pliny app","strict":true,"pluginName":"@pliny/cli","pluginAlias":"@pliny/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"template":{"name":"template","type":"option","description":"Pick your new app template. Options: starter-blog.","multiple":false,"options":["starter-blog"]},"npm":{"name":"npm","type":"boolean","description":"Use npm as the package manager","allowNo":true},"yarn":{"name":"yarn","type":"boolean","description":"Use yarn as the package manager","hidden":false,"allowNo":true},"pnpm":{"name":"pnpm","type":"boolean","description":"Use pnpm as the package manager","hidden":true,"allowNo":true},"ts":{"name":"ts","type":"boolean","description":"Initialize as a TypeScript project","allowNo":true}},"args":[{"name":"name","description":"name of your new project","required":true}],"_globalFlags":{}}}}
1+
{"version":"0.0.1-rc.13","commands":{"install":{"id":"install","description":"Install a Pliny recipe into your Next app","strict":false,"pluginName":"@pliny/cli","pluginAlias":"@pliny/cli","pluginType":"core","aliases":["i"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"yes":{"name":"yes","type":"boolean","char":"y","description":"Install the recipe automatically without user confirmation","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Set app environment name","multiple":false}},"args":[{"name":"recipe","description":"Name of a Pliny recipe from timlrx/pliny/recipes, or a file path to a local recipe definition","required":false},{"name":"recipe-flags","description":"A list of flags to pass to the recipe. Pliny will only parse these in the form `key=value`"}],"_globalFlags":{}},"new":{"id":"new","description":"Create new pliny app","strict":true,"pluginName":"@pliny/cli","pluginAlias":"@pliny/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"template":{"name":"template","type":"option","description":"Pick your new app template. Options: starter-blog.","multiple":false,"options":["starter-blog"]},"npm":{"name":"npm","type":"boolean","description":"Use npm as the package manager","allowNo":true},"yarn":{"name":"yarn","type":"boolean","description":"Use yarn as the package manager","hidden":false,"allowNo":true},"pnpm":{"name":"pnpm","type":"boolean","description":"Use pnpm as the package manager","hidden":true,"allowNo":true},"ts":{"name":"ts","type":"boolean","description":"Initialize as a TypeScript project","allowNo":true}},"args":[{"name":"name","description":"name of your new project","required":true}],"_globalFlags":{}}}}

packages/cli/src/commands/install.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function checkLockFileExists(filename: string) {
5252
}
5353

5454
const GH_ROOT = 'https://github.com/'
55-
const REPO_ROOT = `${GH_ROOT}timlrx/pliny/`
55+
const REPO_ROOT = `${GH_ROOT}timlrx/pliny`
5656
const API_ROOT = 'https://api.github.com/repos/'
5757
const RAW_ROOT = 'https://raw.githubusercontent.com/'
5858
const CODE_ROOT = 'https://codeload.github.com/'
@@ -154,7 +154,7 @@ export class Install extends Command {
154154
}
155155

156156
async getOfficialRecipeList(): Promise<string[]> {
157-
return await gotJSON(`${REPO_ROOT}git/trees/canary?recursive=1`).then(
157+
return await gotJSON(`${API_ROOT}timlrx/pliny/git/trees/main?recursive=1`).then(
158158
(release: GithubRepoAPITrees) =>
159159
release.tree.reduce((recipesList: string[], item) => {
160160
const filePath = item.path.split('/')
@@ -275,9 +275,9 @@ export class Install extends Command {
275275
console.log(`${chalk.bold('Please provide one of the following:')}
276276
277277
1. The name of a recipe to install (e.g. "blog-classic")
278-
${chalk.dim(`- Available recipes listed at ${REPO_ROOT}tree/main/recipes`)}
278+
${chalk.dim(`- Available recipes listed at ${REPO_ROOT}/tree/main/recipes`)}
279279
2. The full name of a GitHub repository (e.g. "blitz-js/example-recipe"),
280-
3. A full URL to a Github repository (e.g. "https://github.com/blitz-js/example-recipe"), or
280+
3. A full URL to a Github repository (e.g. "https://github.com/timlrx/pliny/example-recipe"), or
281281
4. A file path to a locally-written recipe.\n`)
282282
process.exit(1)
283283
} else {

packages/cli/test/commands/install.test.ts

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('`install` command', () => {
2020
it('properly parses remote installer args', () => {
2121
const normalizePath = Install.prototype.normalizeRecipePath
2222
expect(normalizePath('test-installer')).toEqual({
23-
path: 'https://github.com/timlrx/pliny/',
23+
path: 'https://github.com/timlrx/pliny',
2424
subdirectory: 'recipes/test-installer',
2525
location: RecipeLocation.Remote,
2626
})
@@ -34,32 +34,10 @@ describe('`install` command', () => {
3434
})
3535
})
3636

37-
// // TODO: update official list
38-
// it('list of official recipes', async () => {
39-
// const recipeList = await Install.prototype.getOfficialRecipeList()
37+
it('list of official recipes', async () => {
38+
const recipeList = await Install.prototype.getOfficialRecipeList()
4039

41-
// expect(recipeList).toEqual(
42-
// expect.arrayContaining([
43-
// 'base-web',
44-
// 'bumbag-ui',
45-
// 'chakra-ui',
46-
// 'emotion',
47-
// 'gh-action-yarn-mariadb',
48-
// 'gh-action-yarn-postgres',
49-
// 'ghost',
50-
// 'graphql-apollo-server',
51-
// 'logrocket',
52-
// 'material-ui',
53-
// 'quirrel',
54-
// 'reflexjs',
55-
// 'render',
56-
// 'secureheaders',
57-
// 'stitches',
58-
// 'styled-components',
59-
// 'tailwind',
60-
// 'theme-ui',
61-
// ])
62-
// )
63-
// expect(recipeList).toEqual(expect.not.arrayContaining(['tsconfig.json']))
64-
// }, 10000)
40+
expect(recipeList).toEqual(expect.arrayContaining(['add-blog', 'blog-classic', 'render']))
41+
expect(recipeList).toEqual(expect.not.arrayContaining(['tsconfig.json']))
42+
}, 10000)
6543
})

0 commit comments

Comments
 (0)