diff --git a/.github/workflows/sample-publish.yml b/.github/workflows/sample-publish.yml index 005af5ce1..552148e0e 100644 --- a/.github/workflows/sample-publish.yml +++ b/.github/workflows/sample-publish.yml @@ -9,7 +9,7 @@ permissions: contents: read jobs: - build: + build-and-publish: runs-on: ubuntu-latest steps: - name: Harden Runner @@ -17,14 +17,27 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 + - name: Checkout repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup Node.js # Setup .npmrc file to publish to npm + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 with: node-version: '18.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 }} diff --git a/.npmignore b/.npmignore index 27087e67d..baaf02578 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +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/ +plugins/ \ No newline at end of file diff --git a/package.json b/package.json index 757dfbd92..22d66f8e7 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,8 @@ "name": "@finos/git-proxy", "version": "1.10.0", "description": "Deploy custom push protections and policies on top of Git.", + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "cli": "node ./packages/git-proxy-cli/index.js", "client": "vite --config vite.config.js", diff --git a/tsconfig.json b/tsconfig.json index 805153d01..331c876ef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,13 +7,20 @@ "jsx": "react-jsx", "moduleResolution": "Node", "strict": true, - "noEmit": 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": ["src"] + "include": ["src"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] }