Private github module

Maybe I'm just being stupid but: We have 2 Nuxt projects that partly use the same components. That's why I wanted to outsource them to a module. As this is only internal, I obtained this directly from git via NPM. However, in node_modules there is only the package.json and the readme. what am I doing wrong?
9 Replies
conner
conner3d ago
Maybe you show is the package.json of your Package/Lib.
Moritz Walter
Moritz Walter3d ago
Sorry, forgot about that:
{
"name": "",
"version": "1.0.0",
"description": "A collection of components for the Dashboard",
"repository": "",
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "nuxt-module-build build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch",
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
},
"dependencies": {
"@nuxt/kit": "^3.13.2",
"bootstrap": "^5.3.3",
"alwan": "^2.1.1",

"@fortawesome/vue-fontawesome": "^3.0.8",
"@fortawesome/pro-solid-svg-icons": "^6.6.0"
},
"devDependencies": {
"@nuxt/devtools": "^1.6.0",
"@nuxt/eslint-config": "^0.6.0",
"@nuxt/module-builder": "^0.8.4",
"@nuxt/schema": "^3.13.2",
"@nuxt/test-utils": "^3.14.2",
"@types/node": "latest",
"changelogen": "^0.5.7",
"eslint": "^9.12.0",
"nuxt": "^3.13.0",
"typescript": "latest",
"vitest": "^2.1.3",
"vue-tsc": "^2.1.6",
"@types/bootstrap": "^5.2.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {
"vue/multi-word-component-names": "off",
"regexp/no-unused-capturing-group": "off"
}
}
}
{
"name": "",
"version": "1.0.0",
"description": "A collection of components for the Dashboard",
"repository": "",
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "nuxt-module-build build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch",
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
},
"dependencies": {
"@nuxt/kit": "^3.13.2",
"bootstrap": "^5.3.3",
"alwan": "^2.1.1",

"@fortawesome/vue-fontawesome": "^3.0.8",
"@fortawesome/pro-solid-svg-icons": "^6.6.0"
},
"devDependencies": {
"@nuxt/devtools": "^1.6.0",
"@nuxt/eslint-config": "^0.6.0",
"@nuxt/module-builder": "^0.8.4",
"@nuxt/schema": "^3.13.2",
"@nuxt/test-utils": "^3.14.2",
"@types/node": "latest",
"changelogen": "^0.5.7",
"eslint": "^9.12.0",
"nuxt": "^3.13.0",
"typescript": "latest",
"vitest": "^2.1.3",
"vue-tsc": "^2.1.6",
"@types/bootstrap": "^5.2.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {
"vue/multi-word-component-names": "off",
"regexp/no-unused-capturing-group": "off"
}
}
}
conner
conner3d ago
And how do you install it?
Moritz Walter
Moritz Walter3d ago
as dependency: "x": "github:x/DashboardComponents",
Moritz Walter
Moritz Walter2d ago
I'll take a look, thanks works. But: I get a “unhandled Promise Rejection: ReferenceError: Can't find variable: useId” when i componets own my module. If it is directly in Nuxt projects it works. anyone idea why?
conner
conner2d ago
Any hooks from nuxt used in it?
Moritz Walter
Moritz Walter2d ago
sorry, I'm still too new to this 😅 component: https://just-paste.it/GAiGRVIr20
conner
conner2d ago
Where does useId come from?
Want results from more Discord servers?
Add your server