Skip to content

Commit 4f5da79

Browse files
authored
[add] Toolchain Configuration files for Engineering Automation (#2)
1 parent d0ad75b commit 4f5da79

File tree

15 files changed

+646
-16
lines changed

15 files changed

+646
-16
lines changed

.github/pr-badge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- icon: visualstudio
2+
label: 'GitHub.dev'
3+
message: 'PR-$prNumber'
4+
color: 'blue'
5+
url: 'https://github.dev/$owner/$repo/pull/$prNumber'
6+
7+
- icon: github
8+
label: 'GitHub codespaces'
9+
message: 'PR-$prNumber'
10+
color: 'black'
11+
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber'
12+
13+
- icon: git
14+
label: 'GitPod.io'
15+
message: 'PR-$prNumber'
16+
color: 'orange'
17+
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber'

.github/settings.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
allow_merge_commit: false
5+
6+
delete_branch_on_merge: true
7+
8+
enable_vulnerability_alerts: true
9+
10+
labels:
11+
- name: bug
12+
color: '#d73a4a'
13+
description: Something isn't working
14+
15+
- name: documentation
16+
color: '#0075ca'
17+
description: Improvements or additions to documentation
18+
19+
- name: duplicate
20+
color: '#cfd3d7'
21+
description: This issue or pull request already exists
22+
23+
- name: enhancement
24+
color: '#a2eeef'
25+
description: Some improvements
26+
27+
- name: feature
28+
color: '#16b33f'
29+
description: New feature or request
30+
31+
- name: good first issue
32+
color: '#7057ff'
33+
description: Good for newcomers
34+
35+
- name: help wanted
36+
color: '#008672'
37+
description: Extra attention is needed
38+
39+
- name: invalid
40+
color: '#e4e669'
41+
description: This doesn't seem right
42+
43+
- name: question
44+
color: '#d876e3'
45+
description: Further information is requested
46+
47+
- name: wontfix
48+
color: '#ffffff'
49+
description: This will not be worked on
50+
51+
branches:
52+
- name: main
53+
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
54+
protection:
55+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
56+
required_pull_request_reviews:
57+
# The number of approvals required. (1-6)
58+
required_approving_review_count: 1
59+
# Dismiss approved reviews automatically when a new commit is pushed.
60+
dismiss_stale_reviews: true
61+
# Blocks merge until code owners have reviewed.
62+
require_code_owner_reviews: true
63+
# Specify which users and teams can dismiss pull request reviews.
64+
# Pass an empty dismissal_restrictions object to disable.
65+
# User and team dismissal_restrictions are only available for organization-owned repositories.
66+
# Omit this parameter for personal repositories.
67+
dismissal_restrictions:
68+
# users: []
69+
# teams: []
70+
# Required. Require status checks to pass before merging. Set to null to disable
71+
required_status_checks:
72+
# Required. Require branches to be up to date before merging.
73+
strict: true
74+
# Required. The list of status checks to require in order to merge into this branch
75+
contexts: []
76+
# Required. Enforce all configured restrictions for administrators.
77+
# Set to true to enforce required status checks for repository administrators.
78+
# Set to null to disable.
79+
enforce_admins: true
80+
# Prevent merge commits from being pushed to matching branches
81+
required_linear_history: true
82+
# Required. Restrict who can push to this branch.
83+
# Team and user restrictions are only available for organization-owned repositories.
84+
# Set to null to disable.
85+
restrictions: null

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI & CD
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
Test-Build-Publish-Deploy:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
id-token: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: pnpm/action-setup@v4
16+
with:
17+
version: 10
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
registry-url: https://registry.npmjs.org
22+
cache: pnpm
23+
- name: Install Dependencies
24+
run: pnpm i --frozen-lockfile
25+
26+
- name: Build & Publish
27+
run: npm publish --access public --provenance
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
- name: Deploy document
32+
uses: peaceiris/actions-gh-pages@v4
33+
with:
34+
publish_dir: ./docs
35+
personal_token: ${{ secrets.GITHUB_TOKEN }}
36+
force_orphan: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,6 @@ yarn.lock
141141
# Vite logs files
142142
vite.config.js.timestamp-*
143143
vite.config.ts.timestamp-*
144+
145+
# Document generation
146+
docs/

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run build

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test/
2+
docs/
3+
.husky/
4+
.github/
5+
.vscode/

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug Jest",
6+
"type": "node",
7+
"request": "launch",
8+
"port": 9229,
9+
"runtimeArgs": [
10+
"--inspect-brk",
11+
"${workspaceRoot}/node_modules/jest/bin/jest.js",
12+
"--runInBand"
13+
],
14+
"console": "integratedTerminal",
15+
"internalConsoleOptions": "neverOpen"
16+
}
17+
]
18+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules\\typescript\\lib"
3+
}

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# MobX-RESTful-migrator
1+
# MobX RESTful migrator
22

33
Data Migration framework based on [MobX-RESTful][1]
44

5+
[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/MobX-RESTful-migrator.svg)][2]
6+
[![CI & CD](https://github.com/idea2app/MobX-RESTful-migrator/actions/workflows/main.yml/badge.svg)][3]
7+
8+
[![NPM](https://nodei.co/npm/mobx-restful-migrator.png?downloads=true&downloadRank=true&stars=true)][4]
9+
510
## Overview
611

712
MobX-RESTful-migrator is a TypeScript library that provides a flexible data migration framework built on top of MobX-RESTful's ListModel abstraction. It allows you to migrate data from various sources through MobX-RESTful models with customizable field mappings and relationships.
@@ -50,7 +55,7 @@ import { buildURLData } from 'web-utility';
5055

5156
export abstract class TableModel<
5257
D extends DataObject,
53-
F extends Filter<D> = Filter<D>
58+
F extends Filter<D> = Filter<D>,
5459
> extends ListModel<D, F> {
5560
client = new HTTPClient({ baseURI: 'http://localhost:8080', responseType: 'json' });
5661

@@ -65,7 +70,7 @@ export abstract class TableModel<
6570

6671
async loadPage(pageIndex: number, pageSize: number, filter: F) {
6772
const { body } = await this.client.get<{ list: D[]; count: number }>(
68-
`${this.baseURI}?${buildURLData({ ...filter, pageIndex, pageSize })}`
73+
`${this.baseURI}?${buildURLData({ ...filter, pageIndex, pageSize })}`,
6974
);
7075
return { pageData: body!.list, totalCount: body!.count };
7176
}
@@ -135,7 +140,6 @@ const loadSourceArticles = () => readCSV<SourceArticle>('article.csv');
135140

136141
// Complete migration configuration demonstrating all 4 mapping types
137142
const mapping: MigrationSchema<SourceArticle, Article> = {
138-
139143
// 1. Many-to-One mapping: Title + Subtitle → combined title
140144
title: ({ title, subtitle }) => ({
141145
title: { value: `${title}: ${subtitle}` },
@@ -198,7 +202,7 @@ const migratorWithCustomLogger = new RestMigrator(
198202
loadSourceArticles,
199203
ArticleModel,
200204
mapping,
201-
new CustomEventBus()
205+
new CustomEventBus(),
202206
);
203207
```
204208

@@ -332,3 +336,6 @@ const migrator = new RestMigrator(loadSourceArticles, ArticleModel, mapping, new
332336
```
333337

334338
[1]: https://github.com/idea2app/MobX-RESTful
339+
[2]: https://libraries.io/npm/mobx-restful-migrator
340+
[3]: https://github.com/idea2app/MobX-RESTful-migrator/actions/workflows/main.yml
341+
[4]: https://nodei.co/npm/mobx-restful-migrator/

0 commit comments

Comments
 (0)