Skip to content
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
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/canary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish Canary

on:
pull_request:
branches:
- 'master'

jobs:
publish-canary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Build package
run: pnpm build
working-directory: packages/use-file-picker

- name: Test package
run: pnpm test
working-directory: packages/use-file-picker

- name: Lint package
run: pnpm lint

- name: Bump version for canary
working-directory: packages/use-file-picker
run: |
# Get current version from package.json
CURRENT_VERSION=$(node -p "require('./package.json').version")
# Remove any existing pre-release identifiers
BASE_VERSION=$(echo $CURRENT_VERSION | sed 's/-.*$//')

# Create canary version with PR number and run number
CANARY_VERSION="${BASE_VERSION}-canary.${GITHUB_PR_NUMBER}.${GITHUB_RUN_NUMBER}"

# Update package.json with new version
npm pkg set version=$CANARY_VERSION
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}

- name: Configure NPM
run: |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
working-directory: packages/use-file-picker
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish canary
run: pnpm publish --tag canary --no-git-checks
working-directory: packages/use-file-picker
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Check if package.json version is already published
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
LATEST_VERSION=$(npm view use-file-picker version)
if [ "$LATEST_VERSION" = "$PACKAGE_VERSION" ]; then
echo "Version $PACKAGE_VERSION is already published"
exit 1
fi
working-directory: packages/use-file-picker
35 changes: 0 additions & 35 deletions .github/workflows/main.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Publish Package

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Build package
run: pnpm build
working-directory: packages/use-file-picker

- name: Test package
run: pnpm test
working-directory: packages/use-file-picker

- name: Lint package
run: pnpm lint

- name: Configure NPM
run: |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
working-directory: packages/use-file-picker
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish package
run: pnpm publish --no-git-checks
working-directory: packages/use-file-picker
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/size.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.log
.DS_Store
node_modules
.cache
dist
storybook-static
.turbo
/**/dist
8 changes: 0 additions & 8 deletions .storybook/main.js

This file was deleted.

5 changes: 0 additions & 5 deletions .storybook/preview.js

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Milosz
Copyright (c) 2025 Milosz Jankiewicz, Kamil Planer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import { defineConfig } from 'eslint/config';

export default defineConfig([
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { js },
extends: ['js/recommended'],
ignores: ['**/dist/**', '**/node_modules/**', '**/build/**'],
},
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
languageOptions: { globals: globals.browser },
ignores: ['**/dist/**', '**/node_modules/**', '**/build/**'],
},
...tseslint.configs.recommended.map(config => ({
...config,
ignores: ['**/dist/**', '**/node_modules/**', '**/build/**'],
})),
{
...pluginReact.configs.flat.recommended,
rules: {
...pluginReact.configs.flat.recommended.rules,
'react/react-in-jsx-scope': 'off',
},
settings: {
...pluginReact.configs.flat.recommended.settings,
react: {
version: '19',
},
},
ignores: ['**/dist/**', '**/node_modules/**', '**/build/**'],
},
]);
3 changes: 0 additions & 3 deletions example/.npmignore

This file was deleted.

14 changes: 0 additions & 14 deletions example/index.html

This file was deleted.

26 changes: 0 additions & 26 deletions example/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions example/tsconfig.json

This file was deleted.

11 changes: 0 additions & 11 deletions example/vite.config.js

This file was deleted.

Loading