Skip to content

Commit 92533fc

Browse files
Alexander Elguezabal (from Dev Box)Copilot
andcommitted
Convert to proper npm library package (resolves #118)
- Fix .npmignore: remove /dist exclusion so compiled output ships with package - Add files whitelist in package.json for explicit publish control - Rename package to @microsoft/fluentui-editable-grid with public access - Widen peerDependencies to support React 17, 18, and 19 - Replace Windows-only build scripts with cross-platform cross-env/rimraf/mkdirp - Add CI workflow (build + verify on Node 16/18/20) - Add publish workflow (npm publish on GitHub Release) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e87b34d commit 92533fc

5 files changed

Lines changed: 1416 additions & 44 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [16, 18, 20]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci --ignore-scripts
27+
28+
- name: Build library
29+
run: npm run build
30+
31+
- name: Verify dist output
32+
run: |
33+
test -f dist/index.js || (echo "dist/index.js not found" && exit 1)
34+
test -f dist/index.d.ts || (echo "dist/index.d.ts not found" && exit 1)
35+
echo "✅ dist/ output verified"
36+
37+
- name: Check package contents
38+
run: npm pack --dry-run

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
registry-url: https://registry.npmjs.org
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci --ignore-scripts
27+
28+
- name: Build library
29+
run: npm run build
30+
31+
- name: Verify dist output
32+
run: |
33+
test -f dist/index.js || (echo "dist/index.js not found" && exit 1)
34+
test -f dist/index.d.ts || (echo "dist/index.d.ts not found" && exit 1)
35+
echo "✅ dist/ output verified"
36+
37+
- name: Publish to npm
38+
run: npm publish --provenance --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7-
/dist
87

98
# testing
109
/coverage

0 commit comments

Comments
 (0)