How aisouler/gkd_subscription works
This project is a subscription rule generator for the GKD system. In essence, it collects and processes a huge variety of app-specific rules (each defined in separate TypeScript files under the src/apps directory) to build a JSON5 subscription file (and related versioning/changelog files) that clients of GKD can pull and use. The project also includes well-defined build and CI/CD automation (via scripts and GitHub workflows) along with configurations for code style (Prettier, ESLint) and version control.
Main Components
• Source Code Repository:
• Src directory, particularly the src/apps folder that contains hundreds of TypeScript files representing individual app rules.
• Other configuration files (e.g., tsconfig.json, commitlint.config.ts) and global files (e.g., selectors, subscription definitions) that support the functioning of these rules.
• Build Scripts & Tools:
• Scripts directory containing build.ts, check.ts, and updateReadMeMd.ts. These scripts coordinate the transformation of source files into distribution files.
• Configuration files for formatting and linting (.prettierrc.mjs, eslint.config.mjs) that ensure code quality.
• Distribution and Output:
• CI/CD Pipeline:
• .github/workflows directory where various workflow YAML files are stored (e.g., build_release.yml, pull_request_check.yml). Indicate that these automated workflows trigger on pushes, pull requests, or other repository events.
• External Integrations and Consumers:
• External clients of this subscription file — for example, the GKD client apps that download the JSON file via the npmmirror and GitHub raw URLs.
• A note about the APIs, documentation, and external contribution guidelines referenced in the README.
• Documentation & Community:
• A component for the documentation, including the detailed README, contribution guides (CONTRIBUTING.md), and the supplementary materials (Selectors.md and Template.md).
Relationships and Data Flow
• A flow from the individual rule files in src/apps being processed by the build scripts (in scripts/) to generate the subscription files in the dist folder.
• How the CI/CD workflows automatically run these build scripts when code is pushed or pull requests are created.
• Optionally, include a feedback loop to the GitHub Issues and Discussions components, where users report problems or request new rule adaptations.
Design Principles
• Modularity – each app rule contained in its own file, enabling easy additions or adjustments.
• Automated build pipeline that follows a continuous integration approach.
• Separation of concerns between rules (domain logic), build automation (scripts/CI), and distribution (dist).