Skip to content

refactor: Add TypeScript support #1142

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
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
25 changes: 19 additions & 6 deletions .github/workflows/sample-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,35 @@ permissions:
contents: read

jobs:
build:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup Node.js # Setup .npmrc file to publish to npm
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: publish sample package
run: npm install --include peer && npm publish --access=public

- name: Install dependencies
working-directory: plugins/git-proxy-plugin-samples
run: npm ci

- name: Build TypeScript
working-directory: plugins/git-proxy-plugin-samples
run: npm run build

- name: Install peers and publish
working-directory: plugins/git-proxy-plugin-samples
run: |
npm install --include=peer
npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 10 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# This file required to override .gitignore when publishing to npm
src/
tests/
*.test.ts

tsconfig.json
jest.config.js
.eslintrc.js
.prettierrc

website/
plugins/
experimental/
cypress/
plugins/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
plugins/
plugins/

Missing EOL

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "@finos/git-proxy",
"version": "2.0.0-rc.1",
"description": "Deploy custom push protections and policies on top of Git.",
"main": "dist/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files don't live in dist due to ./scripts/build-for-publish.sh

"types": "dist/index.d.ts",
"scripts": {
"cli": "node ./packages/git-proxy-cli/index.js",
"client": "vite --config vite.config.ts",
Expand Down
17 changes: 11 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@
"jsx": "react-jsx",
"moduleResolution": "Node",
"strict": true,
"noEmit": true,
"declaration": true,
"skipLibCheck": true,
"isolatedModules": true,
"isolatedModules": false,
"module": "CommonJS",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
"resolveJsonModule": true,

"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"rootDir": "./src",
"noEmit": false,
"types": ["node"]
},
"include": ["."],
"exclude": ["experimental/**", "plugins/**"]
"include": ["src"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]
}
Loading