{"id":18940297,"url":"https://github.com/donejs/generator-donejs","last_synced_at":"2025-04-15T19:31:10.771Z","repository":{"id":57150915,"uuid":"39406254","full_name":"donejs/generator-donejs","owner":"donejs","description":"A Yeoman generator for your DoneJS application","archived":false,"fork":false,"pushed_at":"2020-01-06T16:48:06.000Z","size":363,"stargazers_count":9,"open_issues_count":31,"forks_count":7,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-12T13:07:38.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/donejs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-20T20:15:21.000Z","updated_at":"2020-01-06T16:48:09.000Z","dependencies_parsed_at":"2022-08-27T05:52:15.184Z","dependency_job_id":null,"html_url":"https://github.com/donejs/generator-donejs","commit_stats":null,"previous_names":[],"tags_count":138,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fgenerator-donejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fgenerator-donejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fgenerator-donejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fgenerator-donejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donejs","download_url":"https://codeload.github.com/donejs/generator-donejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249138707,"owners_count":21218928,"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":[],"created_at":"2024-11-08T12:21:50.102Z","updated_at":"2025-04-15T19:31:10.521Z","avatar_url":"https://github.com/donejs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generator-donejs\n\n[![Build Status](https://travis-ci.org/donejs/generator-donejs.svg?branch=master)](https://travis-ci.org/donejs/generator-donejs)\n[![npm version](https://badge.fury.io/js/generator-donejs.svg)](http://badge.fury.io/js/generator-donejs)\n[![Coverage Status](https://coveralls.io/repos/github/donejs/generator-donejs/badge.svg?branch=master)](https://coveralls.io/github/donejs/generator-donejs?branch=master)\n\nA Yeoman generator for your DoneJS application. Available generators are:\n\n- `app` to create a new DoneJS application\n- `plugin` to create a new DoneJS plugin\n- `generator` to create a new DoneJS generator project\n\n- `component` to create a CanJS component\n- `supermodel` to create a can-connect connection\n- `module` to generate a general purpose modlet\n\n## Using generators\n\n__Important:__ While this repository is a Yeoman generator it should only be used directly with the DoneJS cli instead of the `yo` command line.\n\nWith the CLI installed via\n\n```shell\nnpm install donejs -g\n```\n\nThe following commands are available. To initialize a new DoneJS related project:\n\n- `donejs add app [projectname]` create a new DoneJS application\n- `donejs add plugin [projectname]` create a new DoneJS plugin\n- `donejs add generator [projectname]` create a new generator project\n\nWithin a DoneJS application or plugin:\n\n- `donejs add component` to create a CanJS component\n- `donejs add supermodel` to create a can-connect connection\n- `donejs add module` to generate a general purpose modlet\n\n## donejs add app\n\nCreates a new DoneJS application. Running this command will install dependencies and initial configuration.\n\n```shell\ndonejs add app \u003cfolder\u003e\n```\n\n![donejs add app](https://cloud.githubusercontent.com/assets/361671/24613935/c3e8b98c-1857-11e7-8d44-c0615bebe4ce.png)\n\n## Configuration\n\nMost questions are to fill in values into the package.json and the defaults can be accepted. The following questions have special meaning:\n\n### Project main folder\n\nThis specifies the folder where your application's source code is contained. By default the value is **src** creating a file structure like:\n\n```shell\n- my-awesome-app/\n  |\n  ├ src/\n    ├ index.stache\n```\n\n## Generated folder\n\nUsing `donejs add app` will generate a folder that contains several files used for development. The following files are noteworthy:\n\n### development.html\n\nAn HTML file used to view the application in development mode without requiring server-side rendering. You can use this file [instead of done-serve](https://github.com/donejs/done-serve) if your application doesn't require server-side rendering.\n\n**development.html** uses hash based routing so that it can be used with any HTTP server.\n\n![app using development.hml](https://cloud.githubusercontent.com/assets/361671/24617111/10b53962-1861-11e7-88dd-53cfa7ab4294.png)\n\n### production.html\n\nAn HTML file that will load the application in production mode. This is useful to test the application's build without server-side rendering, or in cases where you do not need server-side rendering, to serve the application to the end users.\n\n\u003e *Note*: Opening this page before running `donejs build` will result in errors. Running that command should clear up the errors.\n\n### build.js\n\nThis is the build script for generating bundles for deploying the application to production. It uses [steal-tools](https://github.com/stealjs/steal-tools) to create optimized bundles with progressive loading included by default.\n\n\u003e *Note*: This file is modified by some generators such as [donejs-cordova](https://github.com/donejs/donejs-cordova) but can be edited by you as well.\n\n### src/index.stache\n\nThis is the root template for your application. Here you can:\n\n* Add `\u003clink\u003e`, `\u003cmeta\u003e` and `\u003ctitle\u003e` elements in the head.\n* Use [`\u003ccan-import/\u003e`](https://github.com/canjs/can-view-import) to import styles, define the Application ViewModel, import components, etc.\n\n### src/app.js\n\nThis module defines and exports the Application ViewModel. The Application ViewModel is the root ViewModel for the application, containing any state that is global. Since apps created using `donejs add app` are automatically bound to [can-route](https://github.com/canjs/can-route), all properties on the Application ViewModel are bound to the URL by default.\n\nThis module is also where you will define your routes like so:\n\n```js\nimport route from \"can-route\";\n\n// Other stuff here...\n\nroute(\"{page}\", { page: \"home\" });\n```\n\n## donejs add component\n\nGenerators a new [can-component](https://github.com/canjs/can-component) that can be used as a custom element in your application.\n\n![donejs add component](https://cloud.githubusercontent.com/assets/361671/24618995/af601d52-1866-11e7-9586-506c102bed87.png)\n\nThere are two forms to using this command:\n\n* `donejs add component \u003cname\u003e.component` will generate `src/name.component`. This is a single-file component using [done-component](https://github.com/donejs/done-component).\n* `donejs add component \u003cname\u003e` will generator a folder `src/name/` with the files:\n  * **name.js**: The JavaScript module.\n  * **name.less**: A [less](http://lesscss.org/) file for the component's styles.\n  * **name.stache**: A [stache](https://github.com/canjs/can-stache) template.\n  * **name.html**: A demo page, used for developing this component in isolation.\n  * **name-test.js**: A JavaScript module that contains unit tests (by default using [QUnit](https://qunitjs.com/)).\n  * **test.html**: A page which runs the tests in **name-test.js**.\n  * **name.md**: A markdown file, used to document the component.\n\n## donejs add supermodel\n\nGenerates a [can-connect](https://github.com/canjs/can-connect) model. This model is an observable type, used to connect to a service layer.\n\n![donejs add supermodel](https://cloud.githubusercontent.com/assets/361671/24619404/d7716f70-1867-11e7-96df-e3f46a1376f5.png)\n\n## donejs add module\n\nCreates a generic modlet. This modlet can be used for any purpose and contains:\n\n* **foo.js**: The JavaScript module.\n* **foo-test.js**: A JavaScript module for writing unit tests.\n* **test.html**: A test page for running the tests in foo-test.js.\n* **foo.md**: A markdown file, for documenting the modlet.\n\n## donejs add plugin\n\nGenerates a new plugin project. This is useful for creating DoneJS plugins or any open-source project that uses StealJS and the modlet pattern.\n\nLike `donejs add app`, the plugin generator scaffolds a project and puts the source code in a `src/` folder (you can specify a different folder when running the generator).\n\n```shell\ndonejs add plugin awesome-plugin\n```\n\n## donejs add generator\n\nGenerators a new generator project. Learn more about writing a generator in [the generator guide](http://donejs.com/generator.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonejs%2Fgenerator-donejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonejs%2Fgenerator-donejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonejs%2Fgenerator-donejs/lists"}