{"id":20503842,"url":"https://github.com/phcode-dev/extensionservice","last_synced_at":"2025-10-08T06:57:09.349Z","repository":{"id":92927857,"uuid":"602115346","full_name":"phcode-dev/extensionService","owner":"phcode-dev","description":"Extensions authoring service","archived":false,"fork":false,"pushed_at":"2025-10-08T03:12:04.000Z","size":1039,"stargazers_count":3,"open_issues_count":12,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-08T05:34:01.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phcode-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-15T14:28:28.000Z","updated_at":"2025-04-22T02:15:45.000Z","dependencies_parsed_at":"2023-11-17T23:56:09.863Z","dependency_job_id":"853b9934-095a-4f8d-a0f6-50c7fd7bac68","html_url":"https://github.com/phcode-dev/extensionService","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"aicore/template-nodejs-server","purl":"pkg:github/phcode-dev/extensionService","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2FextensionService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2FextensionService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2FextensionService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2FextensionService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phcode-dev","download_url":"https://codeload.github.com/phcode-dev/extensionService/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2FextensionService/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278903038,"owners_count":26065786,"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-10-08T02:00:06.501Z","response_time":56,"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":[],"created_at":"2024-11-15T19:34:34.234Z","updated_at":"2025-10-08T06:57:09.317Z","avatar_url":"https://github.com/phcode-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extension Service\nHandles Phoenix/Brackets extensions and themes management including publishing, popularity tracking, CI integrations(Eg. from GitHub actions etc..). \n\n```shell\n# do this to start server\ncp ./src/a.json ./src/app.json\nexport APP_CONFIG=./src/app.json\nnpm install\nnpm run serve \n\n# To hit end point\ncurl -X GET 'http://127.0.0.1:5000/hello?name=rambo'  -H 'authorization: Basic 123' -H 'Content-Type: application/json' -v \n\n```\n\n```shell\n# use this for continuous reload while development \nnpm run serve:dev\n```\n\n## Code Guardian\n\n[![\u003capp\u003e build verification](https://github.com/phcode-dev/extensionService/actions/workflows/build_verify.yml/badge.svg)](https://github.com/phcode-dev/extensionService/actions/workflows/build_verify.yml)\n\n\u003ca href=\"https://sonarcloud.io/summary/new_code?id=phcode-dev_extensionService2\"\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=alert_status\" alt=\"Sonar code quality check\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=security_rating\" alt=\"Security rating\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=vulnerabilities\" alt=\"vulnerabilities\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=coverage\" alt=\"Code Coverage\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=bugs\" alt=\"Code Bugs\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=reliability_rating\" alt=\"Reliability Rating\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=sqale_rating\" alt=\"Maintainability Rating\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=ncloc\" alt=\"Lines of Code\" /\u003e\n  \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=phcode-dev_extensionService2\u0026metric=sqale_index\" alt=\"Technical debt\" /\u003e\n\u003c/a\u003e\n\n# Commands available\n\n## Building\n\nSince this is a pure JS template project, build command just runs test with coverage.\n\n```shell\n\u003e npm install   // do this only once.\n\u003e npm run build\n```\n\n## Linting\n\nTo lint the files in the project, run the following command:\n\n```shell\n\u003e npm run lint\n```\n\nTo Automatically fix lint errors:\n\n```shell\n\u003e npm run lint:fix\n```\n\n## Testing\n\n### Run unit tests\n```shell\n\u003e npm run test:unit\n```\n\n### Running integration tests locally\n\n```shell\n\u003e npm run test:integ\n```\nYou can edit `src/testConfig.json` to change app config for tests after running the above command.\n\n### Running integration tests in GitHub actions\nYou have to set a repository secret `APP_CONFIG_FOR_INTEG_TESTS` with\ncontent of the text config.\n* Goto your repository settings https://github.com/\u003cyour org\u003e/\u003cyour repo\u003e/settings/secrets/actions\n* Create a new `Repository secret` with name `APP_CONFIG_FOR_INTEG_TESTS` and the secret as the config file contents.\n* The build verify action should now be able to use the secret.\n* Note that pull requests cannot read repository secrets and subsequently cannot run integration tests.\n\n### To run all tests:\n\nTo run all tests:\n\n```shell\n\u003e npm run test\n  Hello world Tests\n    ✔ should return Hello World\n    #indexOf()\n      ✔ should return -1 when the value is not present\n```\n\n## Coverage Reports\n\nTo run all tests with coverage:\n\n```shell\n\u003e npm run cover\n  Hello world Tests\n    ✔ should return Hello World\n    #indexOf()\n      ✔ should return -1 when the value is not present\n\n\n  2 passing (6ms)\n\n----------|---------|----------|---------|---------|-------------------\nFile      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s \n----------|---------|----------|---------|---------|-------------------\nAll files |     100 |      100 |     100 |     100 |                   \n index.js |     100 |      100 |     100 |     100 |                   \n----------|---------|----------|---------|---------|-------------------\n\n=============================== Coverage summary ===============================\nStatements   : 100% ( 5/5 )\nBranches     : 100% ( 2/2 )\nFunctions    : 100% ( 1/1 )\nLines        : 100% ( 5/5 )\n================================================================================\nDetailed unit test coverage report: file:///template-nodejs/coverage-unit/index.html\nDetailed integration test coverage report: file:///template-nodejs/coverage-integration/index.html\n```\n\nAfter running coverage, detailed reports can be found in the coverage folder listed in the output of coverage command.\nOpen the file in browser to view detailed reports.\n\nTo run unit/integration tests only with coverage\n\n```shell\n\u003e npm run cover:unit\n\u003e npm run cover:integ\n```\n\nSample coverage report:\n![image](https://user-images.githubusercontent.com/5336369/148687351-6d6c12a2-a232-433d-ab62-2cf5d39c96bd.png)\n\n### Unit and Integration coverage configs\n\nUnit and integration test coverage settings can be updated by configs `.nycrc.unit.json` and `.nycrc.integration.json`.\n\nSee https://github.com/istanbuljs/nyc for config options.\n\n# Publishing packages to NPM\n\n## Preparing for release\n\nPlease run `npm run release` on the `main` branch and push the changes to main. The release command will bump the npm\nversion.\n\n!NB: NPM publish will faill if there is another release with the same version.\n\n## Publishing\n\nTo publish a package to npm, push contents to `npm` branch in\nthis repository.\n\n## Publishing `@aicore/package*`\n\nIf you are looking to publish to package owned by core.ai, you will need access to the GitHub Organization\nsecret `NPM_TOKEN`.\n\nFor repos managed by [aicore](https://github.com/aicore) org in GitHub, Please contact your Admin to get access to\ncore.ai's NPM tokens.\n\n## Publishing to your own npm account\n\nAlternatively, if you want to publish the package to your own npm account, please follow these docs:\n\n1. Create an automation access token by following\n   this [link](https://docs.npmjs.com/creating-and-viewing-access-tokens).\n2. Add NPM_TOKEN to your repository secret by following\n   this [link](https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow)\n\nTo edit the publishing workflow, please see file: `.github/workflows/npm-publish.yml`\n\n# Dependency updates\n\nWe use Rennovate for dependency updates: https://blog.logrocket.com/renovate-dependency-updates-on-steroids/\n\n* By default, dep updates happen on sunday every week.\n* The status of dependency updates can be viewed here if you have this repo permissions in\n  github: https://app.renovatebot.com/dashboard#github/aicore/template-nodejs\n* To edit rennovate options, edit the rennovate.json file in root,\n  see https://docs.renovatebot.com/configuration-options/\n  Refer\n\n# Code Guardian\n\nSeveral automated workflows that check code integrity are integrated into this template.\nThese include:\n\n1. GitHub actions that runs build/test/coverage flows when a contributor raises a pull request\n2. [Sonar cloud](https://sonarcloud.io/) integration using `.sonarcloud.properties`\n    1. In sonar cloud, enable Automatic analysis from `Administration\n       Analysis Method` for the first\n       time ![image](https://user-images.githubusercontent.com/5336369/148695840-65585d04-5e59-450b-8794-54ca3c62b9fe.png)\n\n## IDE setup\n\nSonarLint is currently available as a free plugin for jetbrains, eclipse, vscode and visual studio IDEs.\nUse sonarLint plugin for webstorm or any of the available\nIDEs from this link before raising a pull request: https://www.sonarlint.org/ .\n\nSonarLint static code analysis checker is not yet available as a Brackets\nextension.\n\n## Internals\n\n### Testing framework: Mocha , assertion style: chai\n\nSee https://mochajs.org/#getting-started on how to write tests\nUse chai for BDD style assertions (expect, should etc..). See move here: https://www.chaijs.com/guide/styles/#expect\n\n### Mocks and spies:\n\nSince it is not that straight forward to mock es6 module imports, use the follow pull request as reference to mock\nimported libs:\n\n* sample pull request: https://github.com/aicore/libcache/pull/6/files\n* [setting up mocks](https://github.com/aicore/libcache/blob/485b1b6244f7022eb0a83d9f72d897fe712badbe/test/unit/setup-mocks.js)\n* [using the mocks](https://github.com/aicore/libcache/pull/6/files#diff-8ea7ccf28b28a0ae7b43e468abd3e9a8bb411bb329ad5cb45eb9a93709ed8dc5R2)\n  ensure to import `setup-mocks.js` as the first import of all files in tests.\n\n#### using sinon lib if the above method doesn't fit your case\n\nif you want to mock/spy on fn() for unit tests, use sinon. refer docs: https://sinonjs.org/\n\n### Note on coverage suite used here:\n\nwe use c8 for coverage https://github.com/bcoe/c8. Its reporting is based on nyc, so detailed docs can be found\nhere: https://github.com/istanbuljs/nyc ; We didn't use nyc as it do not yet have ES module support\nsee: https://github.com/digitalbazaar/bedrock-test/issues/16 . c8 is drop replacement for nyc coverage reporting tool\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphcode-dev%2Fextensionservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphcode-dev%2Fextensionservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphcode-dev%2Fextensionservice/lists"}