Skip to content

Commit

Permalink
Merge branch 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jan 6, 2025
2 parents c549621 + 1904e57 commit e221f9a
Show file tree
Hide file tree
Showing 58 changed files with 5,521 additions and 2,527 deletions.
5 changes: 0 additions & 5 deletions .changeset/bright-rules-yell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/curvy-lobsters-tell.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/red-glasses-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clack/core": patch
---

Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See [Issue #127](https://github.com/bombshell-dev/clack/issues/127).
5 changes: 0 additions & 5 deletions .changeset/red-news-rule.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/red-seas-try.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/seven-fireants-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clack/core": patch
---

Fixes a rendering bug with cursor positions for `TextPrompt`
5 changes: 5 additions & 0 deletions .changeset/slimy-dolphins-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clack/prompts": patch
---

Replace custom utility for stripping ANSI control sequences with Node's built-in [`stripVTControlCharacters`](https://nodejs.org/docs/latest/api/util.html#utilstripvtcontrolcharactersstr) utility.
2 changes: 0 additions & 2 deletions .changeset/small-pens-refuse.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/stale-pans-approve.md

This file was deleted.

Binary file added .github/assets/clack-logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 11 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
packages: write
pull_request_target:
types: [assigned, opened, synchronize, reopened]
branches:
- main

# Automatically cancel in-progress actions on the same branch
concurrency:
Expand All @@ -20,24 +19,12 @@ jobs:
name: Build Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: "pnpm"
- if: ${{ steps.cache-node.outputs.cache-hit != 'true' }}
run: pnpm install
# TODO: is this manual build step actually needed?
# `prepack` hook _should_ run but doesn't seem to.
- run: pnpm run build
- uses: changesets/action@v1
if: ${{ github.event_name != 'pull_request' }}
with:
version: pnpm run ci:version
publish: pnpm run ci:publish
commit: "[ci] release"
title: "[ci] release"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm install
- run: pnpm run type-check
- run: pnpm run test
12 changes: 6 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Format code
run: pnpm run ci:format
run: pnpm run format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[ci] format"
branch: ${{ github.head_ref }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/issue-edited.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: issue edited

on:
issues:
types:
- edited
- labeled

jobs:
move-issue-to-backlog:
name: move issue to backlog
uses: bombshell-dev/automation/.github/workflows/move-issue-to-backlog.yml@main
secrets:
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/issue-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Issue opened

on:
issues:
types:
- reopened
- opened

jobs:
add-issue-to-project:
name: add issue to project
uses: bombshell-dev/automation/.github/workflows/add-issue-to-project.yml@main
secrets:
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
12 changes: 5 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: "pnpm"
- if: ${{ steps.cache-node.outputs.cache-hit != 'true' }}
run: pnpm install
- run: pnpm build
- run: pnpm install
- run: pnpm type-check
25 changes: 25 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Preview
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- run: pnpx pkg-pr-new publish './packages/*' --template './examples/*'
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
packages: write

# Automatically cancel in-progress actions on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
# TODO: is this manual build step actually needed?
# `prepack` hook _should_ run but doesn't seem to.
- run: pnpm run build
- uses: changesets/action@v1
with:
version: pnpm run ci:version
publish: pnpm run ci:publish
commit: "[ci] release"
title: "[ci] release"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/require-allow-edits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ permissions:
jobs:
_:
permissions:
pull-requests: read # for ljharb/require-allow-edits to check 'allow edits' on PR
pull-requests: read

name: "Require “Allow Edits”"

runs-on: ubuntu-latest

steps:
- uses: ljharb/require-allow-edits@main
- uses: ljharb/require-allow-edits@v2
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Important! Never install `astro` even when new version is in registry
# Important! Never install from registry even when new version is available
prefer-workspace-packages=true
link-workspace-packages=true
save-workspace-protocol=false
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.18.1
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

16 changes: 0 additions & 16 deletions .prettierrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
41 changes: 41 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false, "ignore": ["**/dist/**"] },
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "tab",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto",
"bracketSpacing": true,
"ignore": [".github/workflows/**/*.yml", ".changeset/**/*.md", "**/pnpm-lock.yaml"]
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": { "recommended": true, "suspicious": { "noExplicitAny": "off" } }
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
},
"overrides": [
{
"include": ["*.json", "*.toml", "*.yml"],
"formatter": { "indentStyle": "space" }
}
]
}
13 changes: 11 additions & 2 deletions examples/basic/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import * as p from '@clack/prompts';
import { setTimeout } from 'node:timers/promises';
import * as p from '@clack/prompts';
import color from 'picocolors';

async function main() {
console.clear();

await setTimeout(1000);

p.updateSettings({
aliases: {
w: 'up',
s: 'down',
a: 'left',
d: 'right',
},
});

p.intro(`${color.bgCyan(color.black(' create-app '))}`);

const project = await p.group(
Expand Down Expand Up @@ -74,7 +83,7 @@ async function main() {
s.stop('Installed via pnpm');
}

let nextSteps = `cd ${project.path} \n${project.install ? '' : 'pnpm install\n'}pnpm dev`;
const nextSteps = `cd ${project.path} \n${project.install ? '' : 'pnpm install\n'}pnpm dev`;

p.note(nextSteps, 'Next steps.');

Expand Down
3 changes: 2 additions & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"scripts": {
"start": "jiti ./index.ts",
"spinner": "jiti ./spinner.ts"
"spinner": "jiti ./spinner.ts",
"spinner-ci": "npx cross-env CI=\"true\" jiti ./spinner-ci.ts"
},
"devDependencies": {
"jiti": "^1.17.0"
Expand Down
Loading

0 comments on commit e221f9a

Please sign in to comment.