{"id":15490057,"url":"https://github.com/harentius/vue2-ts-class-component-example","last_synced_at":"2026-05-08T08:07:29.437Z","repository":{"id":96540214,"uuid":"456664665","full_name":"harentius/vue2-ts-class-component-example","owner":"harentius","description":"Example project to demonstrate the best practices of usage Vue 2 with typescript","archived":false,"fork":false,"pushed_at":"2022-05-16T07:59:58.000Z","size":191,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T09:04:02.630Z","etag":null,"topics":["typescript","vue","vue2","vue2-demo","vue2js","vuejs","vuejs2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/harentius.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":"2022-02-07T20:24:15.000Z","updated_at":"2023-12-25T18:08:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"0cc487f6-ac3c-48e3-9ed2-7617dfd20ea7","html_url":"https://github.com/harentius/vue2-ts-class-component-example","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"e36004ae66cfc6d5659e8290eaa96e991bc50e4a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harentius%2Fvue2-ts-class-component-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harentius%2Fvue2-ts-class-component-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harentius%2Fvue2-ts-class-component-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harentius%2Fvue2-ts-class-component-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harentius","download_url":"https://codeload.github.com/harentius/vue2-ts-class-component-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246061538,"owners_count":20717461,"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":["typescript","vue","vue2","vue2-demo","vue2js","vuejs","vuejs2"],"created_at":"2024-10-02T07:09:08.850Z","updated_at":"2026-05-08T08:07:29.403Z","avatar_url":"https://github.com/harentius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example project to demonstrate the best practices of usage of Vue 2 with typescript\n\nThis is a demo project to just show how we are trying to build frontend application with vue 2 and typescript.\nIt uses a set of tools as well as methodologies and conventions which help us to build well-designed and maintanable code.\n\n## What is covered:\n### Generic\n1. Vue Class Component itself https://github.com/vuejs/vue-class-component\n1. Vue property decorator https://github.com/kaorun343/vue-property-decorator\n1. Vuex Class https://github.com/ktsn/vuex-class\n1. Only scoped styles in components.\nHowever one global not-scoped style is allowed for really global things.\nCan be in App component, for example.\n1. Directory @types for types https://www.typescriptlang.org/tsconfig#types\n1. Default slots (while you can)\n1. Use facades\n1. Relative imports inside modules, absolute - outside modules or to the core\n### Modules best practices\n\n1. Use public interfaces (known also as \"facades\") for every module. (index.ts or index.js file)\nThis serves a lot of purposes. Some of them:\n    * Manage complexity of code.\n    To use a module, you need to understand only pubic interface and not entire module.\n    * Facade defines how to use a module\n    * It can serve well for backward compatibility: you only need to preserve the public interface\n    * Facades give an opportunity to control modules connections\n\n1. Different ways of using modules:\n   * Direct imports through facades\n   * Event dispatcher https://www.digitalocean.com/community/tutorials/vuejs-global-event-bus\n   * Dom modifications\n1. Useful conventions:\n    * Absolute (@) intermodules and core imports\n    * Relative imports (./, ../, etc) inside module itself\n1. Diagnostic\n    * https://github.com/sverweij/dependency-cruiser\n    ```\n    yarn depcruise-modules\n    ```\n(and webpack workaround)\n1. Enforcement\n    * eslint\n    ```\n    yarn lint\n    ```\n    Checks for restriction:\n    ```\n    'no-restricted-imports': ['error', {\n      patterns: ['**/modules/*/*']\n    }]\n    ```\n    * dependency-cruiser\n    ```\n    depcruise-lint\n    ```\n\n## Project setup\n```\nyarn install\n```\n\n### Compiles and hot-reloads for development\n```\nyarn serve\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharentius%2Fvue2-ts-class-component-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharentius%2Fvue2-ts-class-component-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharentius%2Fvue2-ts-class-component-example/lists"}