{"id":23719297,"url":"https://github.com/ionaru/rangers-mono","last_synced_at":"2026-02-12T01:30:17.014Z","repository":{"id":261430435,"uuid":"884268114","full_name":"Ionaru/rangers-mono","owner":"Ionaru","description":"Monorepo for 7R website \u0026 tooling","archived":false,"fork":false,"pushed_at":"2024-12-30T15:34:55.000Z","size":41899,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T16:28:24.944Z","etag":null,"topics":["arma","gaming","nuxt"],"latest_commit_sha":null,"homepage":"https://7th-ranger.com/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ionaru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T12:58:04.000Z","updated_at":"2024-12-30T15:35:00.000Z","dependencies_parsed_at":"2024-11-06T14:52:02.292Z","dependency_job_id":null,"html_url":"https://github.com/Ionaru/rangers-mono","commit_stats":null,"previous_names":["ionaru/rangers-mono"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ionaru%2Frangers-mono","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ionaru%2Frangers-mono/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ionaru%2Frangers-mono/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ionaru%2Frangers-mono/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ionaru","download_url":"https://codeload.github.com/Ionaru/rangers-mono/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239808522,"owners_count":19700455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arma","gaming","nuxt"],"created_at":"2024-12-30T21:49:03.908Z","updated_at":"2026-02-12T01:30:16.947Z","avatar_url":"https://github.com/Ionaru.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nuxt Integrated\n\n[![integrated monorepo](https://img.shields.io/static/v1?label=Nx%20setup\u0026message=integrated%20monorepo\u0026color=blue)](https://nx.dev/concepts/integrated-vs-package-based#integrated-repos)\n\nAdd a Nuxt app to an existing Nx workspace.\n\n## What's inside?\n\nThis workspace contains 3 projects, A [Nuxt app](https://nuxt.com/) and 2 libraries, `ui` and `utils`.\n\n### How did we set this up?\n\nFor this example, a basic getting Nuxt app was used via [`nuxi init`](https://nuxt.com/docs/getting-started/installation) and the two libraries were created with the `@nx/js` plugin.\n\nCreate a Nuxt app in an existing Nx workspace.\n\n\u003e You can create a new Nx workspace with [`create-nx-worksapce`](https://nx.dev/getting-started/intro)\n\n```shell\n❯ cd apps\n❯ npx nuxi@latest init \u003capp-name\u003e\nNuxi 3.6.5\n✨ Nuxt project is created with v3 template.\n```\n\nTell nx how to cache the build with the `nx` key in the package.json\n\n```json\n{\n  \"name\": \"\u003capp-name\u003e\",\n  \"private\": true,\n  \"scripts\": {\n    /***/\n  },\n  \"nx\": {\n    \"targets\": {\n      \"build\": {\n        // Tells Nx what files to cache after running build\n        \"outputs\": [\"{projectRoot}/.output\", \"{projectRoot}/.nuxt\"]\n      }\n    },\n    // used for project graph construction, explained down below\n    \"tags\": [\"scope:\u003capp-name\u003e\"],\n    \"implicitDependencies\": [\"tag:scope:\u003capp-name\u003e\"]\n  }\n}\n```\n\nTo add alias paths from the root level `tsconfig.base.json`, Nuxt recommends [using the `nuxt.config.ts` instead of a tsconfig for alias paths](https://nuxt.com/docs/guide/directory-structure/tsconfig).\nThese paths are added to the auto-generated tsconfig by Nuxt.\n\nHere is an example of loaded the `tsconfig.base.json` paths. [See source file](./apps/website/nuxt.config.ts)\n\n```ts\nimport { defineNuxtConfig } from \"nuxt/config\";\nimport { join } from \"path\";\nimport { workspaceRoot } from \"@nx/devkit\";\n\n/**\n * Load tsconfig paths from a tsconfig file\n **/\nfunction getMonorepoTsConfigPaths(tsConfigPath: string) {\n  const tsPaths = require(tsConfigPath)?.compilerOptions?.paths as Record\u003cstring, string[]\u003e;\n\n  const alias: Record\u003cstring, string\u003e = {};\n  if (tsPaths) {\n    for (const p in tsPaths) {\n      alias[p.replace(/\\/\\*$/, \"\")] = join(workspaceRoot, tsPaths[p][0].replace(/\\/\\*$/, \"\"));\n    }\n  } else {\n    console.warn(\"Root level tsconfig \", tsConfigPath, \" does not contain any paths\");\n  }\n\n  return alias;\n}\n\n// https://nuxt.com/docs/api/configuration/nuxt-config\nexport default defineNuxtConfig({\n  /**\n   * Nuxt recommends setting custom alias from a tsconfig here,\n   * instead of in tsconfig since it will override the auto generated tsconfig.\n   * all aliases added here will be added to the auto generated tsconfig.\n   * Other projects generated with Nx will be added to the root level tsconfig.base.json\n   * which might want to be used in this project.\n   *\n   * https://nuxt.com/docs/guide/directory-structure/tsconfig\n   **/\n  alias: getMonorepoTsConfigPaths(\"../../tsconfig.base.json\"),\n  devtools: { enabled: true },\n});\n```\n\nMove dependencies/devDependencies from the `apps/\u003capp-name\u003e/package.json` to the root level `package.json`. This is to use a [single version policy](https://nx.dev/concepts/more-concepts/dependency-management#single-version-policy) which makes managing dependencies across the monorepo easier at scale.\n\nUpdate the `nx.json` inputs to [include the `package.json` as projects](https://nx.dev/recipes/tips-n-tricks/include-all-packagejson#include-all-package.json-files-as-projects) and exclude the output directories of Nuxt for [cache inputs](https://nx.dev/reference/project-configuration#inputs-\u0026-namedinputs)\n\n```json\n{\n  \"plugins\": [\"nx/plugins/package-json\"], // tell nx to read package.json files\n  \"namedInputs\": {\n    \"default\": [\n      \"{projectRoot}/**/*\",\n      \"!{projectRoot}/.nuxt/**/*\", // ignore nuxt specific output folders\n      \"!{projectRoot}/.output/**/*\",\n      \"sharedGlobals\"\n    ],\n    \"production\": [\"default\", \"!{projectRoot}/.eslintrc.json\"],\n    \"sharedGlobals\": []\n  }\n}\n```\n\n### Generate new projects\n\nFor other vue based libraries you can use the `@nx/js` plugin as the base for the project.\n\n\u003e Note the version of `@nx/js` should match the version of `nx` in your `package.json`\n\n```shell\nnpm i -DE @nx/js@\u003cnx-version\u003e\n```\n\n\u003e Feel free to pick which options make the most sense for you, such as using vitest for a test runner or using rollup/vite to bundle the project if you plan to publish the project outside the monorepo.\n\n```shell\n❯ nx g lib --minimal --simpleName\n\n\u003e  NX  Generating @nx/js:library\n\n✔ What name would you like to use for the library? · ui\n✔ Which unit test runner would you like to use? · none\n✔ Which bundler would you like to use to build the library? Choose 'none' to skip build setup. · none\nCREATE libs/ui/tsconfig.json\nCREATE libs/ui/src/index.ts\nCREATE libs/ui/src/lib/cmp.ts\nCREATE libs/ui/tsconfig.lib.json\nCREATE libs/ui/project.json\nCREATE libs/ui/.eslintrc.json\nUPDATE tsconfig.base.json\n```\n\nIf re-exporting `.vue` file, you might run into TS error about not understanding the files. In that case, you can add a small `d.ts` file with the following contents\n\n```ts\ndeclare module \"*.vue\";\n```\n\nSince Nx only processes typescript files by default, the project graph won't show the usage of the `ui` library in the Nuxt app.\nThere are a couple ways to solve this problem, but the simplest will be to use [`tags`](https://nx.dev/reference/project-configuration#tags) and use those tags within the projects [`implicitDependencies`](https://nx.dev/reference/project-configuration#implicitdependencies).\n\nSetting a tag for all project being used with `\u003capp-name\u003e` in project.json files would look like\n\n```json\n{\n  \"tags\": [\"scope:\u003capp-name\u003e\"]\n}\n```\n\nand in the `\u003capp-name\u003e` package.json, the `implicitDependencies` is set for that tag.\n\n\u003e Note the `scope` part of a tag is not special, using `tag:` in the `implicitDependencies` is special syntax that tells Nx to search for all projects with that specific tag.\n\n```json\n{\n  \"name\": \"\u003capp-name\u003e\",\n  \"nx\": {\n    \"targets\": {\n      /***/\n    },\n    \"tags\": [\"scope:\u003capp-name\u003e\"],\n    \"implicitDependencies\": [\"tag:scope:\u003capp-name\u003e\"]\n  }\n}\n```\n\n## How to run it\n\n- `nx dev \u003capp-name\u003e` to run the Nuxt application.\n- `nx build \u003capp-name\u003e` to run the Nuxt build.\n\n## Learn more\n\n- [Adopting Nx](https://nx.dev/recipes/adopting-nx)\n- [Why Nx?](https://nx.dev/getting-started/why-nx)\n- [Nuxt Docs](https://nuxt.com/docs/getting-started/introduction)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionaru%2Frangers-mono","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionaru%2Frangers-mono","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionaru%2Frangers-mono/lists"}