{"id":20604866,"url":"https://github.com/allaboutapps/aaa-backend-stack","last_synced_at":"2025-04-15T02:27:33.661Z","repository":{"id":35139682,"uuid":"211080675","full_name":"allaboutapps/aaa-backend-stack","owner":"allaboutapps","description":"Deprecated / Legacy: The opinionated Node.js Backend Framework by allaboutapps","archived":false,"fork":false,"pushed_at":"2022-12-11T07:16:13.000Z","size":1208,"stargazers_count":11,"open_issues_count":23,"forks_count":2,"subscribers_count":3,"default_branch":"master-github","last_synced_at":"2025-04-02T22:07:14.715Z","etag":null,"topics":["id-allaboutapps-x-deprecated"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/allaboutapps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-26T12:12:52.000Z","updated_at":"2024-12-07T10:47:58.000Z","dependencies_parsed_at":"2023-01-15T14:45:23.796Z","dependency_job_id":null,"html_url":"https://github.com/allaboutapps/aaa-backend-stack","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2Faaa-backend-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2Faaa-backend-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2Faaa-backend-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2Faaa-backend-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allaboutapps","download_url":"https://codeload.github.com/allaboutapps/aaa-backend-stack/tar.gz/refs/heads/master-github","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248993254,"owners_count":21195158,"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":["id-allaboutapps-x-deprecated"],"created_at":"2024-11-16T09:25:19.056Z","updated_at":"2025-04-15T02:27:33.644Z","avatar_url":"https://github.com/allaboutapps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aaa-backend-stack\n\n\u003e Base packages to build a Node.js backend at all about apps\n\nThis monorepo is managed by [lerna](https://github.com/lerna/lerna) + [yarn](https://yarnpkg.com/lang/en/).\n\n### Quickstart\n\n```bash\n\n# 1. Install lerna in the correct version on your local system, yarn v1.1+\nlocal$ npm install -g lerna@v2.6.0\n\n# Optional: In case you have installed before, wipe modules to start fresh\nlocal$ yarn clean-modules\n\n# 2. Start the dev dm (we use 10.0.0.10 by default, make sure this is available)\nlocal$ vagrant up \u0026\u0026 vagrant ssh\n\n# 3. Install lerna on the VM in the same version (yarn is already installed)\nvagrant$ cd /vagrant \u0026\u0026 sudo npm install -g lerna@v2.6.0\n\n# 4. install all dependencies inside ./packages\n# (will copy ./defaults into @aaa-backend-stack/* scoped libs and bootstrap dependencies through lerna)\nvagrant$ yarn bootstrap\n\n# Have you never run this project before: you need to run...\nyarn tsc \u0026\u0026 yarn tsc-sync\n# ... once to compile the custom tslint ruleset\n\n# 5. Compile all packages (faster on local host)\nlocal$ yarn build\n\n# 6. Run all tests\nvagrant$ yarn test # execute test in all packages --\u003e lerna run test --stream\n\n# 7. LOCALLY: build + watch for changes in all packages (tsc compiler) - most performant (you may also trigger this from vscode)\nlocal$ yarn watch\n\n# Now start changing things...\n\n```\n\n### Publishing\n\n```bash\n#\n# 0.1 Update CHANGELOG.md!\n#\n\n# 0.2 Your git is clean and pushed to the origin\nlocal$ git status\n\n# 1. Consistance check!\n# * ensure no single yarn.lock exists directly in the packages\n# * add yarn resolutions,\n# * properly reformat package.jsons in all packages\n# * check if you properly pinned all dependencies, so an exact version is loaded\n# * and reshow git status\nlocal$ yarn check-package-validity \u0026\u0026 git status\n\n#\n# Coffee-Break!\n# Is your git still clean? Else go back to step 0.\n#\n\n# 1.1 Check scaffolded project compiles and lints correctly\n# This is necessary due to different (stricter) compiler and linter\n# settings in scaffolded projects\nlocal$ yarn create-aaa-backend scaffold -xly --debug\n\n# Start container\nlocal$ cd aaa-backend \u0026\u0026 yarn docker:up\n\n# Now check that scaffolded project in aaa-backend still compiles\ncontainer$ yarn \u0026\u0026 yarn build \u0026\u0026 yarn test\n\n# Fix compiler and linter erros until all is well.\n# Then copy the fixes to the template.\n\n# Then destroy the docker setup and go back to aaa-backend-stack\nlocal$ yarn docker:destroy \u0026\u0026 cd .. \u0026\u0026 rm -rf aaa-backend\n\n# 2. clean all node_modules in root and at the packages level\nlocal$ yarn clean-modules\n\n# 3. VM: reinstall all dependencies from your current yarn.lock file\nvagrant$ yarn bootstrap\n\n# 4. Rebuild all packages\n# (we are currently going to directly publish the compiled versions of our packages!)\nlocal$ yarn build\n\n# 5. VM: And run all integration tests...\n# (also ensure no ownership warnings are raised!)\nvagrant$ yarn test\n\n#\n# Coffee-Break!\n# Is your git still clean? Else go back to step 0.\n#\n\n# 7. All fine? Let publish!\n\n# 7.1. Make sure we are going to publish to the public npm registry\nlocal$ npmrc\n\n# 7.2. Check which packages will be updated\nlocal$ lerna updated\n\n# 7.3. Decide on major, minor or patch version in the interactive publish...\n# (make sure git is clean before running this + ensure you comply to semver!)\nlocal$ lerna publish\n\n# 8.1 Make sure you do NOT have a global create-aaa-backend installed\nlocal$ create-aaa-backend\n# Should return\n-bash: create-aaa-backend: command not found\n\n# 8.2 Finally: Publish to public github (so that the templat can be pulled) and then \n# test if create-aaa-backend scaffolding still works\nlocal$ npx create-aaa-backend scaffold -y --debug\n\n```\n\n### Pushing to public github\n```bash\n# 1. Merge into master-github branch\nlocal$ git checkout master-github\nlocal$ git merge --strategy-option theirs --allow-unrelated-histories --squash master\nlocal$ git commit -m \"merge latest\"\n\n# 2. Tag the version using same version number as on master without the v (e.g. v1.16.1 -\u003e 1.16.1)\nlocal$ git tag 1.16.1\n\n# 3. Push to github\nlocal$ git push origin-github\nlocal$ git push origin-github 1.16.1\n```\n\n### I want to add a dependency\n\n1. Add it to the respective `package.json` of the package and run `yarn bootstrap`. The dependency is now available in our package.\n2. Don't forget to properly pin the version and potenially add it to the `__OWNS__` array every package exposes.\n3. Allow others to use it. export it from the package (eventually through side-loading / dynamic import) in `UPPER_CASE`.\n\n### I want to create a new @aaa-backend-stack/package\n\n1. Copy packages/aaa-example-lib as a starting point and update the `package.json` and `README.md` file.\n2. Write some logic...\n3. Import the new dependency in another package by adding it to the `package.json`\n4. Finally run `yarn bootstrap`.\n\n### Thoughts on hoisting\n\nPay close attention to the `\"hoist\": true` and `\"useWorkspaces\": true` parameter inside `lerna.json`, it is absolutely mandadory!\nWe require a flattened node_modules structure as we operate in the global scope within our polyfills.\n\n* See https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/\n* See https://github.com/lerna/lerna/blob/c590d57fa0736950ae4820932176d71ceca61587/doc/hoist.md\n\n### Testing create-aaa-backend scaffold\n\nTypically the `create-aaa-backend` CLI tool clones the latest **tagged** release from the `master` branch, and loads the template from there.\nIf you like you can specify to load it from another branch's `HEAD` by using the `-b BRANCH_NAME` flag.\n\nHowever, typically you want to test and operate locally while playing within the monorepo, therefore use the following:\n\n```bash\n\n# Useful for testing *.cabgen execution (without docker setup):\nlocal$ yarn create-aaa-backend scaffold -xly --debug # skip docker, use local files, yes to all\n\n# Useful for CI:\nci$ yarn create-aaa-backend scaffold -y --debug # (attention: this still uses the remote published packages from @aaa/npm)\n\n```\n\n### Other useful commands\n\n```bash\n\n# open all managed packages in visual studio code\nlocal$ lerna exec code .\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallaboutapps%2Faaa-backend-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallaboutapps%2Faaa-backend-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallaboutapps%2Faaa-backend-stack/lists"}