{"id":16747599,"url":"https://github.com/differui/ko-component-compiler","last_synced_at":"2025-07-30T17:41:28.179Z","repository":{"id":81985763,"uuid":"54297948","full_name":"differui/ko-component-compiler","owner":"differui","description":"Compile Knockout Component","archived":false,"fork":false,"pushed_at":"2018-04-24T02:32:04.000Z","size":38,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T17:33:24.709Z","etag":null,"topics":["component","knockoutjs"],"latest_commit_sha":null,"homepage":null,"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/differui.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,"zenodo":null}},"created_at":"2016-03-20T03:06:31.000Z","updated_at":"2018-04-24T02:32:05.000Z","dependencies_parsed_at":"2023-11-01T07:30:54.047Z","dependency_job_id":null,"html_url":"https://github.com/differui/ko-component-compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/differui/ko-component-compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/differui%2Fko-component-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/differui%2Fko-component-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/differui%2Fko-component-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/differui%2Fko-component-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/differui","download_url":"https://codeload.github.com/differui/ko-component-compiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/differui%2Fko-component-compiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267912162,"owners_count":24164504,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["component","knockoutjs"],"created_at":"2024-10-13T02:10:29.288Z","updated_at":"2025-07-30T17:41:28.162Z","avatar_url":"https://github.com/differui.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Knockout Component Compiler\n=====\n\n## What is Knockout Component?\n\n+ Let you write component in single file just like vue component.\n+ Easy to write a component and no need to care about register.\n\n```\n\u003ctemplate\u003e\n    \u003cdiv class=\"btn\"\u003e\n        \u003cicon k-name=\"icon\" class=\"btn-icon\"\u003e\u003c/icon\u003e\n        \u003cspan data-bind=\"text: text\" class=\"btn-text\"\u003e\u003c/span\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cstyle scoped\u003e\n    .btn {\n        /* btn style goes here */\n    }\n\u003c/style\u003e\n\n\u003cscript\u003e\n    export default {\n        constructor: function (opts, info) {\n            this.text = ko.observable(opts.text);\n            this.icon = ko.observable(opts.icon);\n        },\n\n        defaults: {\n            text: 'Button'\n        },\n\n        mixins: [],\n\n        methods: {}\n    };\n\u003c/script\u003e\n```\n\n## API\n\n```js\nvar compiler = require('ko-component-compiler');\n\ncompiler.compile('code', function (err, result) {\n\n    // component style template and script wrapped as single file\n    console.log(result);\n});\n```\n\n## Rollup.js\n\nInstall packages:\n\n```bash\n# rollup plugins\n$ npm install rollup-plugin-ko\n$ npm install rollup-plugin-babel\n$ npm install rollup-plugin-commonjs\n$ npm install rollup-plugin-node-resolve\n\n# peer deps\n$ npm install inject-css\n$ npm install robust-mixin\n```\n\n```js\nvar fs = require('fs');\nvar rollup = require('rollup');\nvar ko = require('rollup-plugin-ko');\nvar babel = require('rollup-plugin-babel');\nvar commonjs = require('rollup-plugin-commonjs');\nvar nodeResolve = require('rollup-plugin-node-resolve');\n\nrollup.rollup({\n    entry: './src/main.js',\n    plugins: [\n        nodeResolve({ jsnext: true, main: true }),\n        commonjs(),\n        ko(),\n        babel({\n            presets: [\n                'es2015-rollup'\n            ]\n        })\n    ]\n})\n.then(function (bundle) {\n    var result = bundle.generate({\n        format: 'iife'\n    });\n\n    fs.writeFileSync( './dest/app.js', result.code );\n})\n.catch(function (err) {\n    console.log(err);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdifferui%2Fko-component-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdifferui%2Fko-component-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdifferui%2Fko-component-compiler/lists"}