try adding cjs bundle to get it working for astro

This commit is contained in:
adueck 2024-12-21 15:06:35 -05:00
parent cee11eb565
commit b58c5635da
7 changed files with 7609 additions and 34 deletions

View File

@ -0,0 +1,5 @@
@media screen and (max-width: 600px) {
.hide-on-mobile {
display: none;
}
}

7509
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "pashto-inflector-website", "name": "pashto-inflector-website",
"version": "7.7.6", "version": "7.7.7",
"type": "module", "type": "module",
"scripts": { "scripts": {
"patch": "npm version patch --no-git-tag-version && cd src/lib && npm version patch --no-git-tag-version && cd ../components && npm version patch --no-git-tag-version", "patch": "npm version patch --no-git-tag-version && cd src/lib && npm version patch --no-git-tag-version && cd ../components && npm version patch --no-git-tag-version",
@ -12,7 +12,7 @@
"preview": "vite preview", "preview": "vite preview",
"install-all": "yarn install && node get-words.cjs && cd src/lib && yarn install && cd ../components && yarn install", "install-all": "yarn install && node get-words.cjs && cd src/lib && yarn install && cd ../components && yarn install",
"build-website": "tsc -b && vite build", "build-website": "tsc -b && vite build",
"build-components": "rm -rf src/components/dist && tsc --project src/components/tsconfig.json && cd src/components && node post-build.cjs", "build-components": "rm -rf src/components/dist && tsc --project src/components/tsconfig.json && cd src/components && node post-build.cjs && cd ../.. && rollup -c",
"build-lib": "rm -rf src/lib/dist && tsc --project src/lib/tsconfig.json && tsup src/lib/library.ts --format cjs && mv dist/library.cjs src/lib/dist/lib", "build-lib": "rm -rf src/lib/dist && tsc --project src/lib/tsconfig.json && tsup src/lib/library.ts --format cjs && mv dist/library.cjs src/lib/dist/lib",
"get-words": "node get-words.cjs && tsx get-mini-dict-and-split-verbs.ts", "get-words": "node get-words.cjs && tsx get-mini-dict-and-split-verbs.ts",
"check-all-inflections": "tsx check-all-inflections.ts" "check-all-inflections": "tsx check-all-inflections.ts"
@ -39,6 +39,9 @@
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0", "jest-environment-jsdom": "^29.7.0",
"jest-extended": "^4.0.2", "jest-extended": "^4.0.2",
"rollup": "^4.29.1",
"rollup-plugin-import-css": "^3.5.8",
"rollup-plugin-svg-import": "^3.0.0",
"ts-jest": "^29.2.4", "ts-jest": "^29.2.4",
"tsc-alias": "^1.8.10", "tsc-alias": "^1.8.10",
"tsx": "^4.17.0", "tsx": "^4.17.0",

22
rollup.config.mjs Normal file
View File

@ -0,0 +1,22 @@
// rollup.config.mjs
import svg from "rollup-plugin-svg-import";
import css from "rollup-plugin-import-css";
export default {
input: "src/components/dist/components/library.js",
output: {
file: "src/components/dist/components/library-cjs.js",
format: "cjs",
},
plugins: [
svg({
/**
* If `true`, instructs the plugin to import an SVG as string.
* For example, for Server Side Rendering.
* Otherwise, the plugin imports SVG as DOM node.
*/
stringify: true,
}),
css(),
],
};

View File

@ -1,8 +1,8 @@
{ {
"name": "@lingdocs/ps-react", "name": "@lingdocs/ps-react",
"version": "7.7.6", "version": "7.7.7",
"description": "Pashto inflector library module with React components", "description": "Pashto inflector library module with React components",
"main": "dist/components/library.js", "main": "dist/components/library-cjs.js",
"module": "dist/components/library.js", "module": "dist/components/library.js",
"types": "dist/components/library.d.ts", "types": "dist/components/library.d.ts",
"repository": { "repository": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/inflect", "name": "@lingdocs/inflect",
"version": "7.7.6", "version": "7.7.7",
"description": "Pashto inflector library", "description": "Pashto inflector library",
"main": "dist/lib/library.cjs", "main": "dist/lib/library.cjs",
"module": "dist/lib/library.js", "module": "dist/lib/library.js",

View File

@ -664,10 +664,19 @@
dependencies: dependencies:
dequal "^2.0.3" dequal "^2.0.3"
"@rollup/rollup-darwin-arm64@4.20.0": "@rollup/pluginutils@^5.0.1", "@rollup/pluginutils@^5.1.3":
version "4.20.0" version "5.1.4"
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz" resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz"
integrity sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q== integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==
dependencies:
"@types/estree" "^1.0.0"
estree-walker "^2.0.2"
picomatch "^4.0.2"
"@rollup/rollup-darwin-arm64@4.29.1":
version "4.29.1"
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz"
integrity sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==
"@sinclair/typebox@^0.27.8": "@sinclair/typebox@^0.27.8":
version "0.27.8" version "0.27.8"
@ -733,10 +742,10 @@
dependencies: dependencies:
classnames "*" classnames "*"
"@types/estree@1.0.5": "@types/estree@^1.0.0", "@types/estree@1.0.6":
version "1.0.5" version "1.0.6"
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz"
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==
"@types/graceful-fs@^4.1.3": "@types/graceful-fs@^4.1.3":
version "4.1.9" version "4.1.9"
@ -1739,6 +1748,11 @@ estraverse@^5.1.0, estraverse@^5.2.0:
resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz"
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
estree-walker@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
esutils@^2.0.2: esutils@^2.0.2:
version "2.0.3" version "2.0.3"
resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz"
@ -3098,6 +3112,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1:
resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
picomatch@^4.0.2:
version "4.0.2"
resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz"
integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==
pirates@^4.0.1, pirates@^4.0.4: pirates@^4.0.1, pirates@^4.0.4:
version "4.0.6" version "4.0.6"
resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz"
@ -3353,29 +3372,46 @@ reusify@^1.0.4:
resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
rollup@^4.13.0, rollup@^4.19.0: rollup-plugin-import-css@^3.5.8:
version "4.20.0" version "3.5.8"
resolved "https://registry.npmjs.org/rollup/-/rollup-4.20.0.tgz" resolved "https://registry.npmjs.org/rollup-plugin-import-css/-/rollup-plugin-import-css-3.5.8.tgz"
integrity sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw== integrity sha512-a3YsZnwHz66mRHCKHjaPCSfWczczvS/HTkgDc+Eogn0mt/0JZXz0WjK0fzM5WwBpVtOqHB4/gHdmEY40ILsaVg==
dependencies: dependencies:
"@types/estree" "1.0.5" "@rollup/pluginutils" "^5.1.3"
rollup-plugin-svg-import@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/rollup-plugin-svg-import/-/rollup-plugin-svg-import-3.0.0.tgz"
integrity sha512-5fUESTM5hdqJojrwO53JQUO7NespLNx4iLeMsToQfuaGGqGT5sz85Ns5gCDNxLO6yBPbn7p0A/6YA+Rq3clg4Q==
dependencies:
"@rollup/pluginutils" "^5.0.1"
rollup@^1.20.0||^2.0.0||^3.0.0||^4.0.0, "rollup@^2.x.x || ^3.x.x || ^4.x.x", rollup@^3.0.0||^4.0.0, rollup@^4.13.0, rollup@^4.19.0, rollup@^4.29.1:
version "4.29.1"
resolved "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz"
integrity sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==
dependencies:
"@types/estree" "1.0.6"
optionalDependencies: optionalDependencies:
"@rollup/rollup-android-arm-eabi" "4.20.0" "@rollup/rollup-android-arm-eabi" "4.29.1"
"@rollup/rollup-android-arm64" "4.20.0" "@rollup/rollup-android-arm64" "4.29.1"
"@rollup/rollup-darwin-arm64" "4.20.0" "@rollup/rollup-darwin-arm64" "4.29.1"
"@rollup/rollup-darwin-x64" "4.20.0" "@rollup/rollup-darwin-x64" "4.29.1"
"@rollup/rollup-linux-arm-gnueabihf" "4.20.0" "@rollup/rollup-freebsd-arm64" "4.29.1"
"@rollup/rollup-linux-arm-musleabihf" "4.20.0" "@rollup/rollup-freebsd-x64" "4.29.1"
"@rollup/rollup-linux-arm64-gnu" "4.20.0" "@rollup/rollup-linux-arm-gnueabihf" "4.29.1"
"@rollup/rollup-linux-arm64-musl" "4.20.0" "@rollup/rollup-linux-arm-musleabihf" "4.29.1"
"@rollup/rollup-linux-powerpc64le-gnu" "4.20.0" "@rollup/rollup-linux-arm64-gnu" "4.29.1"
"@rollup/rollup-linux-riscv64-gnu" "4.20.0" "@rollup/rollup-linux-arm64-musl" "4.29.1"
"@rollup/rollup-linux-s390x-gnu" "4.20.0" "@rollup/rollup-linux-loongarch64-gnu" "4.29.1"
"@rollup/rollup-linux-x64-gnu" "4.20.0" "@rollup/rollup-linux-powerpc64le-gnu" "4.29.1"
"@rollup/rollup-linux-x64-musl" "4.20.0" "@rollup/rollup-linux-riscv64-gnu" "4.29.1"
"@rollup/rollup-win32-arm64-msvc" "4.20.0" "@rollup/rollup-linux-s390x-gnu" "4.29.1"
"@rollup/rollup-win32-ia32-msvc" "4.20.0" "@rollup/rollup-linux-x64-gnu" "4.29.1"
"@rollup/rollup-win32-x64-msvc" "4.20.0" "@rollup/rollup-linux-x64-musl" "4.29.1"
"@rollup/rollup-win32-arm64-msvc" "4.29.1"
"@rollup/rollup-win32-ia32-msvc" "4.29.1"
"@rollup/rollup-win32-x64-msvc" "4.29.1"
fsevents "~2.3.2" fsevents "~2.3.2"
run-parallel@^1.1.9: run-parallel@^1.1.9: