Skip to content

Commit

Permalink
feat: local ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kettei-sproutty committed Jan 16, 2024
1 parent 66bb087 commit 63b478c
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 18 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,10 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
- run: wasm-pack pack
if: ${{ steps.release.outputs.release_created }}
- name: Update Package Name
if: ${{ steps.release.outputs.release_created }}
run: |
new_name="@scuderia-fe/docx-to-html"
if [ -d "pkg" ]; then
cd pkg || exit
if [ -f "package.json" ]; then
# Update the "name" field in package.json
sed -i "s/\"name\": \".*\",/\"name\": \"$new_name\",/" package.json
echo "Package name updated to $new_name"
else
echo "Error: package.json not found in the pkg folder."
fi
cd ..
else
echo "Error: pkg folder not found."
fi
- uses: oven-sh/setup-bun@v1
if: ${{ steps.release.outputs.release_created }}
- run: bun rename
if: ${{ steps.release.outputs.release_created }}
- run: wasm-pack publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
target

# WASM
!pkg/package.json
pkg

# Node
node_modules

# NPMJS
.npmrc
Expand Down
Binary file added bun.lockb
Binary file not shown.
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "docx-to-html",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"simple-git-hooks": {
"commit-msg": "bun commitlint --edit ${1}"
},
"scripts": {
"rename": "bun scripts/rename.mjs"
},
"devDependencies": {
"@types/bun": "latest",
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"simple-git-hooks": "^2.9.0"
}
}
16 changes: 16 additions & 0 deletions scripts/rename.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import fs from "fs";
import { join } from "path";

const packageJson = fs.readFileSync(
join(process.cwd(), "pkg", "package.json"),
"utf8"
);

const pkgJson = JSON.parse(packageJson);
pkgJson.name = "@scuderia-fe/docx-to-html";

fs.writeFileSync(
join(process.cwd(), "pkg", "package.json"),
JSON.stringify(pkgJson, null, 2),
"utf8"
);
22 changes: 22 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

/* Linting */
"skipLibCheck": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
}
}

0 comments on commit 63b478c

Please sign in to comment.