Skip to content

Commit 6887ff0

Browse files
committed
feat: o3r pipeline
1 parent ea4fecd commit 6887ff0

33 files changed

+885
-4
lines changed

.renovaterc.json5

+8-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"enabled": false
116116
}
117117
],
118-
customManagers: [
118+
"customManagers": [
119119
{
120120
"customType": "regex",
121121
"datasourceTemplate": "maven",
@@ -127,5 +127,11 @@
127127
"\"openApiSupportedVersion\": \"~(?<currentValue>[^\"]+)\""
128128
]
129129
}
130-
]
130+
],
131+
"github-actions": {
132+
"fileMatch": [
133+
"(^|/)(__dot__github|workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
134+
"(^|/)action\\.ya?ml$"
135+
]
136+
}
131137
}

packages/@o3r/design/.compodocrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/compodoc/compodoc/develop/src/config/schema.json",
3-
"name": "Styling",
4-
"output": "../../../generated-doc/styling",
3+
"name": "Design",
4+
"output": "../../../generated-doc/design",
55
"tsconfig": "./tsconfig.doc.json",
66
"assetsFolder": "../../../.attachments",
77
"disableSourceCode": true,
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/compodoc/compodoc/develop/src/config/schema.json",
3+
"name": "Pipeline",
4+
"output": "../../../generated-doc/pipeline",
5+
"tsconfig": "./tsconfig.doc.json",
6+
"assetsFolder": "../../../.attachments",
7+
"disableSourceCode": true,
8+
"disableDomTree": true,
9+
"disableTemplateTab": true,
10+
"disableStyleTab": true,
11+
"disableGraph": true,
12+
"disableCoverage": true,
13+
"disablePrivate": true,
14+
"disableProtected": true,
15+
"disableInternal": true,
16+
"disableLifeCycleHooks": true,
17+
"disableRoutesGraph": true,
18+
"disableSearch": false,
19+
"hideGenerator": true,
20+
"customFavicon": "../../../assets/logo/flavors/otter-128x128.png",
21+
"templates": "../../../compodoc-templates/package"
22+
}

packages/@o3r/pipeline/.eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
/* eslint-disable quote-props */
3+
4+
module.exports = {
5+
'root': true,
6+
'parserOptions': {
7+
'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true,
8+
'tsconfigRootDir': __dirname,
9+
'project': [
10+
'tsconfig.build.json',
11+
'tsconfig.builders.json',
12+
'tsconfig.spec.json',
13+
'tsconfig.eslint.json'
14+
],
15+
'sourceType': 'module'
16+
},
17+
'extends': [
18+
'../../../.eslintrc.js'
19+
]
20+
};

packages/@o3r/pipeline/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist*

packages/@o3r/pipeline/.npmignore

Whitespace-only changes.

packages/@o3r/pipeline/README.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<h1 align="center">Otter Pipeline</h1>
2+
<p align="center">
3+
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
4+
</p>
5+
6+
This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
7+
<br />
8+
<br />
9+
10+
## Description
11+
12+
[![Stable Version](https://img.shields.io/npm/v/@o3r/pipeline?style=for-the-badge)](https://www.npmjs.com/package/@o3r/pipeline)
13+
[![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/pipeline?color=green&style=for-the-badge)](https://www.npmjs.com/package/@o3r/pipeline)
14+
15+
This module contains tooling around DevOps toolchains.
16+
17+
## How to install
18+
19+
```shell
20+
ng add @o3r/pipeline
21+
```
22+
23+
## Description
24+
25+
The `ng add` schematic for Otter Pipeline helps you set up a DevOps pipeline for your frontend project. This schematic configures the necessary CI runner and npm registry settings to streamline your development workflow.
26+
27+
### Properties
28+
29+
- `toolchain`: The DevOps toolchain to create. For now, only `GitHub` is supported.
30+
- `runner`: The CI runner. Default is `ubuntu-latest`.
31+
- `npmRegistry`: A private npm registry. By default, the public one will be used.
32+
33+
### Usage
34+
35+
Here is an example of how to use the `ng add` schematics with parameters:
36+
37+
```shell
38+
ng add @o3r/pipeline --runner=windows-latest --npmRegistry=https://custom-registry.example.com
39+
```
40+
41+
### Private NPM Registry
42+
43+
When a custom NPM Registry is provided, the schematic will automatically create a `.npmrc` (or a `.yarnrc`) file with the specified registry.
44+
Additionally, it will set the necessary environment variables for the install task.
45+
46+
```yaml
47+
- name: Install
48+
env:
49+
COREPACK_NPM_REGISTRY: https://custom-registry.example.com
50+
COREPACK_INTEGRITY_KEYS: ""
51+
shell: bash
52+
run: npm ci
53+
```
54+
55+
If you choose to run the schematic without specifying an `npmRegistry`, you may need to manually apply these changes afterwards.
56+
57+
### GitHub workflow
58+
59+
The generated pipeline ensures that your code is built, tested and linted on every push or pull request to the main and release branches.
60+
It also automates the versioning thanks to the [Otter - New Version GitHub Action](https://github.com/AmadeusITGroup/otter/tree/main/tools/github-actions/new-version#readme) and release process by creating a new release on GitHub and generating release notes.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
3+
"schematics": {
4+
"ng-add": {
5+
"description": "Add Otter Pipeline to the project.",
6+
"factory": "./schematics/ng-add/index#ngAdd",
7+
"schema": "./schematics/ng-add/schema.json",
8+
"aliases": [
9+
"install",
10+
"i"
11+
]
12+
}
13+
}
14+
}

packages/@o3r/pipeline/jest.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConfig;
2+
3+
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
4+
module.exports = {
5+
...getJestGlobalConfig(),
6+
projects: [
7+
'<rootDir>/testing/jest.config.ut.builders.js'
8+
]
9+
};

packages/@o3r/pipeline/migration.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
3+
"schematics": {
4+
}
5+
}

packages/@o3r/pipeline/package.json

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"name": "@o3r/pipeline",
3+
"version": "0.0.0-placeholder",
4+
"publishConfig": {
5+
"access": "public"
6+
},
7+
"typings": "./dist/src/public_api.d.ts",
8+
"main": "dist/src/public_api.js",
9+
"description": "A package that provides toolchain related helpers.",
10+
"keywords": [
11+
"toolchain",
12+
"pipeline",
13+
"otter",
14+
"otter-module"
15+
],
16+
"scripts": {
17+
"nx": "nx",
18+
"ng": "yarn nx",
19+
"test": "yarn nx test pipeline",
20+
"copy:templates": "yarn cpy 'schematics/**/templates{-*,}/**/*' dist/schematics",
21+
"prepare:build:builders": "yarn cpy '{collection,migration}.json' dist && yarn cpy 'schematics/**/schema.json' dist/schematics && yarn copy:templates",
22+
"prepare:publish": "prepare-publish ./dist",
23+
"build:source": "tsc -b tsconfig.build.json && yarn cpy package.json dist/",
24+
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn copy:templates && generate-cjs-manifest",
25+
"build": "yarn nx build pipeline",
26+
"postbuild": "patch-package-json-main"
27+
},
28+
"exports": {
29+
"./package.json": {
30+
"default": "./package.json"
31+
},
32+
".": {
33+
"default": "./dist/src/public_api.js",
34+
"typings": "./dist/src/public_api.d.ts"
35+
}
36+
},
37+
"dependencies": {
38+
"js-yaml": "^4.1.0",
39+
"tslib": "^2.6.2"
40+
},
41+
"peerDependencies": {
42+
"@o3r/schematics": "workspace:^",
43+
"@o3r/telemetry": "workspace:^"
44+
},
45+
"peerDependenciesMeta": {
46+
"@o3r/schematics": {
47+
"optional": true
48+
},
49+
"@o3r/telemetry": {
50+
"optional": true
51+
}
52+
},
53+
"devDependencies": {
54+
"@angular-devkit/architect": "~0.1802.0",
55+
"@angular-devkit/core": "~18.2.0",
56+
"@angular-devkit/schematics": "~18.2.0",
57+
"@angular-eslint/eslint-plugin": "~18.3.0",
58+
"@compodoc/compodoc": "^1.1.19",
59+
"@nx/eslint-plugin": "~19.5.0",
60+
"@nx/jest": "~19.5.0",
61+
"@nx/js": "~19.5.0",
62+
"@o3r/build-helpers": "workspace:^",
63+
"@o3r/eslint-plugin": "workspace:^",
64+
"@o3r/schematics": "workspace:^",
65+
"@o3r/telemetry": "workspace:^",
66+
"@o3r/test-helpers": "workspace:^",
67+
"@schematics/angular": "~18.2.0",
68+
"@stylistic/eslint-plugin-ts": "~2.4.0",
69+
"@types/jest": "~29.5.2",
70+
"@types/js-yaml": "^4.0.5",
71+
"@types/node": "^20.0.0",
72+
"@typescript-eslint/eslint-plugin": "^7.14.1",
73+
"@typescript-eslint/parser": "^7.14.1",
74+
"@typescript-eslint/utils": "^7.14.1",
75+
"cpy-cli": "^5.0.0",
76+
"eslint": "^8.57.0",
77+
"eslint-import-resolver-node": "^0.3.9",
78+
"eslint-plugin-jest": "~28.8.0",
79+
"eslint-plugin-jsdoc": "~48.11.0",
80+
"eslint-plugin-prefer-arrow": "~1.2.3",
81+
"eslint-plugin-unicorn": "^54.0.0",
82+
"jest": "~29.7.0",
83+
"jest-junit": "~16.0.0",
84+
"jsonc-eslint-parser": "~2.4.0",
85+
"nx": "~19.5.0",
86+
"pid-from-port": "^1.1.3",
87+
"ts-jest": "~29.2.0",
88+
"ts-node": "~10.9.2",
89+
"typescript": "~5.5.4"
90+
},
91+
"engines": {
92+
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
93+
},
94+
"schematics": "./collection.json",
95+
"ng-update": {
96+
"migrations": "./migration.json"
97+
}
98+
}

packages/@o3r/pipeline/project.json

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"name": "pipeline",
3+
"$schema": "https://raw.githubusercontent.com/nrwl/nx/master/packages/nx/schemas/project-schema.json",
4+
"projectType": "library",
5+
"sourceRoot": "packages/@o3r/pipeline/src",
6+
"prefix": "o3r",
7+
"targets": {
8+
"build": {
9+
"executor": "nx:run-script",
10+
"outputs": [
11+
"{projectRoot}/dist/package.json"
12+
],
13+
"options": {
14+
"script": "postbuild"
15+
},
16+
"dependsOn": [
17+
"^build",
18+
"build-builders",
19+
"compile"
20+
]
21+
},
22+
"compile": {
23+
"executor": "nx:run-script",
24+
"options": {
25+
"script": "build:source"
26+
},
27+
"inputs": [
28+
"source",
29+
"^source"
30+
]
31+
},
32+
"prepare-build-builders": {
33+
"executor": "nx:run-script",
34+
"options": {
35+
"script": "prepare:build:builders"
36+
}
37+
},
38+
"build-builders": {
39+
"executor": "nx:run-script",
40+
"options": {
41+
"script": "build:builders"
42+
}
43+
},
44+
"lint": {
45+
"options": {
46+
"eslintConfig": "packages/@o3r/pipeline/.eslintrc.js",
47+
"lintFilePatterns": [
48+
"packages/@o3r/pipeline/src/**/*.ts",
49+
"packages/@o3r/pipeline/schematics/**/*.ts",
50+
"packages/@o3r/pipeline/package.json"
51+
]
52+
}
53+
},
54+
"test": {
55+
"executor": "@nx/jest:jest",
56+
"options": {
57+
"jestConfig": "packages/@o3r/pipeline/jest.config.js"
58+
}
59+
},
60+
"test-int": {
61+
"executor": "@nx/jest:jest",
62+
"options": {
63+
"jestConfig": "packages/@o3r/pipeline/testing/jest.config.it.js"
64+
}
65+
},
66+
"prepare-publish": {
67+
"executor": "nx:run-script",
68+
"options": {
69+
"script": "prepare:publish"
70+
}
71+
},
72+
"publish": {
73+
"executor": "nx:run-commands",
74+
"options": {
75+
"command": "npm publish packages/@o3r/pipeline/dist"
76+
}
77+
},
78+
"documentation": {
79+
"executor": "nx:run-script",
80+
"options": {
81+
"script": "compodoc"
82+
}
83+
}
84+
},
85+
"tags": []
86+
}

0 commit comments

Comments
 (0)