Skip to content

Commit

Permalink
Merge pull request #27 from 10play/build-web
Browse files Browse the repository at this point in the history
fix: build lib-web and fix types
  • Loading branch information
17Amir17 committed Feb 7, 2024
2 parents a8b1491 + 59bec5e commit 122e0fc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Build simple editor bundle
run: yarn editor:build
- name: Build web utils
run: yarn vite build
working-directory: src/webEditorUtils
run: yarn editor:build-web-utils
- name: Build package
run: yarn prepare
- run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"./web": {
"import": "./lib-web/index.mjs",
"require": "./lib-web/index.umd.cjs",
"types": "./lib/typescript/src/index.d.ts"
"types": "./lib-web/typescript/webEditorUtils/index.d.ts"
}
},
"source": "src/index",
Expand All @@ -39,7 +39,8 @@
],
"scripts": {
"editor:dev": "vite",
"editor:build": "vite build && node ./scripts/buildEditor.js",
"editor:build": "vite build && node ./scripts/buildEditor.js && editor:build-web-utils",
"editor:build-web-utils": "rimraf lib-web && vite build --config ./src/webEditorUtils/vite.config.ts && tsc --project ./src/webEditorUtils",
"example": "yarn workspace tentap-example",
"test": "jest",
"typecheck": "tsc --noEmit",
Expand Down Expand Up @@ -90,6 +91,7 @@
"react-native": "0.73.2",
"react-native-builder-bob": "^0.20.0",
"release-it": "^15.0.0",
"rimraf": "^5.0.5",
"turbo": "^1.12.2",
"typescript": "^5.0.2",
"vite": "^5.0.12",
Expand Down
4 changes: 3 additions & 1 deletion src/webEditorUtils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"_version": "2.0.0",
"compilerOptions": {
"outDir": "../../lib-web/typescript",
"declaration": true,
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "bundler",
Expand All @@ -13,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react-jsx",
"noEmit": true,
"noEmit": false,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion src/webEditorUtils/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
// into your library
external: ['react'],
output: {
dir: '../../lib-web',
dir: 'lib-web',
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
Expand Down
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ __metadata:
react-native-builder-bob: ^0.20.0
react-native-webview: 13.6.4
release-it: ^15.0.0
rimraf: ^5.0.5
turbo: ^1.12.2
typescript: ^5.0.2
vite: ^5.0.12
Expand Down Expand Up @@ -10809,7 +10810,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^10.2.2, glob@npm:^10.3.10":
"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7":
version: 10.3.10
resolution: "glob@npm:10.3.10"
dependencies:
Expand Down Expand Up @@ -18442,6 +18443,17 @@ __metadata:
languageName: node
linkType: hard

"rimraf@npm:^5.0.5":
version: 5.0.5
resolution: "rimraf@npm:5.0.5"
dependencies:
glob: ^10.3.7
bin:
rimraf: dist/esm/bin.mjs
checksum: d66eef829b2e23b16445f34e73d75c7b7cf4cbc8834b04720def1c8f298eb0753c3d76df77325fad79d0a2c60470525d95f89c2475283ad985fd7441c32732d1
languageName: node
linkType: hard

"rimraf@npm:~2.6.2":
version: 2.6.3
resolution: "rimraf@npm:2.6.3"
Expand Down

0 comments on commit 122e0fc

Please sign in to comment.