{"id":13341634,"url":"https://github.com/zenwork/pika-mocha","last_synced_at":"2025-03-11T22:31:18.485Z","repository":{"id":44215312,"uuid":"215130940","full_name":"zenwork/pika-mocha","owner":"zenwork","description":"seed project combining pika cli + typescript + web components + mocha testing","archived":false,"fork":false,"pushed_at":"2023-01-04T23:03:19.000Z","size":311,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-24T10:06:51.507Z","etag":null,"topics":["chai","es6-modules","lit-element","mocha","pika-pack","typescript","web-components"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/zenwork.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":"2019-10-14T19:41:32.000Z","updated_at":"2020-03-14T17:51:24.000Z","dependencies_parsed_at":"2023-02-02T23:16:26.620Z","dependency_job_id":null,"html_url":"https://github.com/zenwork/pika-mocha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenwork%2Fpika-mocha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenwork%2Fpika-mocha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenwork%2Fpika-mocha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenwork%2Fpika-mocha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenwork","download_url":"https://codeload.github.com/zenwork/pika-mocha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243125147,"owners_count":20240263,"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":["chai","es6-modules","lit-element","mocha","pika-pack","typescript","web-components"],"created_at":"2024-07-29T19:25:39.378Z","updated_at":"2025-03-11T22:31:18.201Z","avatar_url":"https://github.com/zenwork.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ES6 Module Web Component Seed Project\n\nI have built this in an attempt to keep things modern, simple, powerful, and agnostic.\n\n## Quick Start\n\n* On Mac OS X or on Linux run the following in a directory where you want to create a project.\n```\nwget -q -O /tmp/init.sh https://raw.githubusercontent.com/zenwork/pika-mocha/master/init.sh \u0026\u0026 sh /tmp/init.sh\n``` \n* Then go to the project directory\n* run `npm run serve`\n* run `npm run test:watch`\n* open \u003chttp://localhost:8888/assets\u003e\n* start developing \n\n## Goal\n\nThe goal of this seed project is to build a simple tool-chain for ES6 module-based web components.\n\n* Publish and/or serve ES6 module based JS\n* Publish Typescript typings(`*.d.ts` files) to make this project a TS-compatible dependency.\n* Run tests against the same transpiled code that will be published\n* Be able to debug Typescript in the browser\n* Works in modern browsers\n\n## Stack\n* **pika.dev cli** - A set of tools based on parcel that builds standard's compliant es6 module packages. Lightweight integration, tree-shakeable code, ready for http 2. Perfect for delivering shareable code: \u003chttps://www.pika.dev/docs/\u003e\n* **typescript** - Modern JS + support of a type-system: \u003chttps://www.typescriptlang.org/\u003e\n* **tslint** - for linting Typescript and JS\n* **lit-element** - support for building standard web components. Created by the Polymer team: \u003chttps://lit-element.polymer-project.org/\u003e (todo)\n* **mocha** + **chai** - in-browser testing runner and assertions: \u003chttps://mochajs.org/\u003e and \u003chttps://www.chaijs.com/\u003e\n* **mocha-headless-chrome** - headles browser testing\n* **es-dev-server** - es6-module-ready dev server that supports live-reloading. Created by the Open WC team: \u003chttp://open-wc.org\u003e\n\n### Seeded Artifacts\n* a simple example web componnent\n* simple tests\n* html pages to demo and test the various `pkg` artifacts\n\n## Usage\n\nInstall all dependencies.\n\n```shell script\nnpm install\n```\n\nTo serve the content of the `.serve` directory. \n```shell script\nnpm run serve\n``` \n\nBuild the `pkg` directory only.\n\n```shell script\nnpm run build\n```\n\nBuild the `pkg` and then the `.serve` directory .\n\n```shell script\nnpm run build:serve\n```\n\nRun `build:serve` on every source change.\n\n```shell script\nnpm run build:watch\n```\n\nLint the code.\n\n```shell script\nnpm run lint\n```\n\n### Testing\n\nRun Headless tests with chromium.\n```shell script\nnpm run test:headless\n```\n\nRun headless tests in watch mode.\n\n```shell script\nnpm run test:watch\n```\n## ES6 Module based tests\n\nAt the moment this setup only allows headless testing with chromium and on bundled code. ES6 Module based tests can be run in a regular browser.\n\n### How Live-Coding Works\nPika does not support a watch mode compatible with live-coding at the moment. So we have to jump through a few hoops.\n* serve content from `.serve` directory\n* run `pika build` which rebuilds everything into the `pkg` dir\n* rsync `pkg` to `.serve` so that only changed files are updated. This will then trigger `es-dev-server` to reload the page.\n\n\n## Todo\n* improve headless testing to run in a single watching process\n* compatible with IE 11 and Edge (pre-chromium integration)\n* sort out imports so using `.js` is not neccessary \n* maps not working in mocha test failures\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenwork%2Fpika-mocha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenwork%2Fpika-mocha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenwork%2Fpika-mocha/lists"}