Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truncate file title #6

Merged
merged 6 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn --immutable

- name: Get changeset status
id: get-changeset-status
run: |
yarn changeset status --output .changeset/status.json
new_version=$(jq -r '.releases[0].newVersion' < .changeset/status.json)
rm -v .changeset/status.json
echo "new-version=${new_version}" >> "$GITHUB_OUTPUT"

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: Release ${{ steps.get-changeset-status.outputs.new-version }}
title: Release ${{ steps.get-changeset-status.outputs.new-version }}
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,25 @@ To fix this issue, you need to use dynamic imports for the PDF component (to ind
+ );
```

## Contributing

When making changes to this project, please follow these steps:

1. Make your code changes
2. Create a changeset to document your changes:
```bash
yarn changeset
```
3. Commit your changes and the changeset
4. When ready to release a new version:
```bash
yarn new-version
```
5. To publish the new version:
```bash
yarn release
```

## 🙏 Thanks

Thanks to the developers of the following dependencies that we're using:
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
"prepack": "yarn clean && yarn build",
"test": "yarn lint && yarn tsc && yarn format",
"tsc": "tsc",
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\""
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\"",
"new-snapshot": "yarn build && changeset version --snapshot",
"new-version": "yarn build && changeset version",
"release": "yarn build && changeset publish",
"release-snapshot": "yarn build && changeset publish --tag snapshot"
},
"dependencies": {
"@wojtekmaj/react-hooks": "1.17.2",
Expand All @@ -44,6 +48,7 @@
"react-window": "1.8.9"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@types/lodash": "^4.14.195",
"@types/lodash.debounce": "^4.0.7",
"@types/node": "*",
Expand Down
2 changes: 1 addition & 1 deletion src/view/PdfOptionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const PDFOptionsBar: React.FC<PDFOptionsBarProps> = ({

return (
<div className="optionBar">
<div className="title">File ID: {file.id}</div>
<div className="title truncate">File ID: {file.id}</div>
<div className="control">
<div className="pageControl">
<button className="pageUp" onClick={prevPage} disabled={scrolledIndex === 0}>
Expand Down
3 changes: 0 additions & 3 deletions src/view/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
padding-left: 8px;
margin-left: 8px;
border-right: 1px solid lightslategray;
display: flex;
align-items: center;
height: 100%;
}

.pdf-viewer-container .optionBar .control {
Expand Down