{"id":16328849,"url":"https://github.com/miguelramos/vtx","last_synced_at":"2025-03-23T08:31:45.965Z","repository":{"id":45004503,"uuid":"436819818","full_name":"miguelramos/vtx","owner":"miguelramos","description":"VTX, vite multi-apps, libs and packages.","archived":false,"fork":false,"pushed_at":"2022-01-14T12:32:52.000Z","size":174,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T18:58:10.208Z","etag":null,"topics":["cli","monorepo","vitejs","vuejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miguelramos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-10T02:01:52.000Z","updated_at":"2023-11-05T10:42:13.000Z","dependencies_parsed_at":"2022-08-12T11:40:45.675Z","dependency_job_id":null,"html_url":"https://github.com/miguelramos/vtx","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelramos%2Fvtx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelramos%2Fvtx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelramos%2Fvtx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelramos%2Fvtx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miguelramos","download_url":"https://codeload.github.com/miguelramos/vtx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245078067,"owners_count":20557274,"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":["cli","monorepo","vitejs","vuejs"],"created_at":"2024-10-10T23:14:34.452Z","updated_at":"2025-03-23T08:31:45.610Z","avatar_url":"https://github.com/miguelramos.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# VTX Workspace manager for vite\n\nVtx is an wrapper on vite cli tool to manage multi apps, libs and custom packages on monorepo style focus only with typescript support.\n\n## Dependencies\n\n- Node \u003e 12\n- yarn\n\n## Install\nStart to install cli as a globals package on your system. Monorepo is managed by yarn so it is mandatory using yarn as your dependency manager.\nInstall as:\n\n```\nyarn global add @websublime/vtx-cli\n```\n\nAfter this you will have binary vtx available as your cli tool.\n\n## Setup\nVtx cli tool can create, serve and build apps or libs. Run vtx --help for more info on the cli tool. \n\n```\nUsage:\n  $ vtx [root]\n\nCommands:\n  [root]\n  create-workspace\n  create-app\n  create-lib\n\nFor more info, run any command with the `--help` flag:\n  $ vtx --help\n  $ vtx create-workspace --help\n  $ vtx create-app --help\n  $ vtx create-lib --help\n\nOptions:\n  --host [host]           [string] specify hostname\n  --port \u003cport\u003e           [number] specify port\n  --https                 [boolean] use TLS + HTTP/2\n  --open [path]           [boolean | string] open browser on startup\n  --cors                  [boolean] enable CORS\n  --strictPort            [boolean] exit if specified port is already in use\n  --force                 [boolean] force the optimizer to ignore the cache and re-bundle\n  -b, --lib \u003clib\u003e         [string] use specified lib to build\n  -p, --app \u003capp\u003e         [string] use specified app to run\n  -c, --config \u003cfile\u003e     [string] use specified config file\n  --base \u003cpath\u003e           [string] public base path (default: /)\n  -l, --logLevel \u003clevel\u003e  [string] info | warn | error | silent\n  --clearScreen           [boolean] allow/disable clear screen when logging\n  -d, --debug [feat]      [string | boolean] show debug logs\n  -f, --filter \u003cfilter\u003e   [string] filter debug logs\n  -m, --mode \u003cmode\u003e       [string] set env mode\n  -h, --help              Display this message\n  -v, --version           Display version number\n```\n\n### Workspace\nStart to create a workspace for your apps. Just run:\n\n```\nvtx create-workspace\n```\n\nAnd answer to the questions from the cli to config your workspace.\nVite config produced will have a config to resolve every entry  from your workspace and also will automatic resolve alias for your apps and libs that are created with this tool.\n\n### Vue App\nAfter creating your workspace you are ready to add as many apps as you want. Inside your workspace directory run:\n\n```\nvtx create-app\n```\n\nAnd answer the questions to perform your app config. Then perform install.\n\n```\nyarn\n```\n\n### Lib\nInside your workspace directory run:\n\n```\nvtx create-lib\n```\n\n### Run\nBy default your first app will be the default app to serve. If you want to run a different app just define the name the app you want to run.\n\n```\nvtx dev --app my-app\n```\n\nOr you can adjust your package.json script to run different apps like:\n\n```\n\"scripts\": {\n  \"dev\": \"vtx dev --config ./vite.config.js --debug\",\n  \"dev:ready\": \"vtx dev --config ./vite.config.js --debug --app ready\",\n  \"build\": \"vtx build\",\n  \"preview\": \"vtx preview\"\n}\n```\n\nVtx supports all options from vite-cli plus --app and --lib.\n\n### Build\n\nTo build just run:\n\n```\nvtx build --app todo\n```\n\nFor type application will produce dist normally. The particular case goes for lib as:\n\n```\nvtx build --lib services\n```\n\nWhen your lib as created, is package.json as config entry for rollupOptions where you can pass vite rollupOtions as vite documentation describe. The lib will be created with the name that to you gave it and get necessary options from workspace package.json.\n\nIt is mandatory to indicate which type and name you are building.\n\n### Config\n\nVtx saves the configuration on root of your workspace in package.json. You can review it there.\n\n```\n\"config\": {\n  \"packages\": {\n    \"todo\": {\n      \"name\": \"todo\",\n      \"namespace\": \"@workspace/todo\",\n      \"dir\": \"/workspace/vtx/temp/my-awesome/apps/todo\",\n      \"type\": \"application\"\n    },\n    \"services\": {\n      \"name\": \"services\",\n      \"namespace\": \"@lib/services\",\n      \"dir\": \"/workspace/vtx/temp/my-awesome/libs/services\",\n      \"type\": \"lib\"\n    }\n  },\n  \"default\": \"todo\",\n  \"namespace\": \"@workspace\",\n  \"root\": \"/workspace/vtx/temp/my-awesome\"\n}\n```\n\nYou can then manually perform config on your app to resolve and include a lib. On package.json of your app you can add the lib as dependency:\n\n```\n\"dependencies\": {\n  \"@lib/services\": \"^1.0.0\"\n}\n```\n\nAnd on the tsconfig you can resolve typings and imports:\n\n```\n\"paths\": {\n  \"@workspace/todo/*\": [\n    \"./src/*\"\n  ],\n  \"@lib/services\": [\n    \"../../libs/services/src/index.ts\"\n  ]\n}\n```\n\nyarn workspace will resolve your dependency and perform the necessary link to it.\n\n## TODO\n\nMore info about the tool\n\n## Publish\n\n- Run yarn changeset on branch\n- Request PR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelramos%2Fvtx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelramos%2Fvtx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelramos%2Fvtx/lists"}