Skip to content

Commit

Permalink
feat: o3r pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
vscaiceanu-1a committed Oct 2, 2024
1 parent 00e64af commit acbc90d
Show file tree
Hide file tree
Showing 31 changed files with 826 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@o3r/design/.compodocrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/compodoc/compodoc/develop/src/config/schema.json",
"name": "Styling",
"output": "../../../generated-doc/styling",
"name": "Design",
"output": "../../../generated-doc/design",
"tsconfig": "./tsconfig.doc.json",
"assetsFolder": "../../../.attachments",
"disableSourceCode": true,
Expand Down
22 changes: 22 additions & 0 deletions packages/@o3r/pipeline/.compodocrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/compodoc/compodoc/develop/src/config/schema.json",
"name": "Pipeline",
"output": "../../../generated-doc/pipeline",
"tsconfig": "./tsconfig.doc.json",
"assetsFolder": "../../../.attachments",
"disableSourceCode": true,
"disableDomTree": true,
"disableTemplateTab": true,
"disableStyleTab": true,
"disableGraph": true,
"disableCoverage": true,
"disablePrivate": true,
"disableProtected": true,
"disableInternal": true,
"disableLifeCycleHooks": true,
"disableRoutesGraph": true,
"disableSearch": false,
"hideGenerator": true,
"customFavicon": "../../../assets/logo/flavors/otter-128x128.png",
"templates": "../../../compodoc-templates/package"
}
20 changes: 20 additions & 0 deletions packages/@o3r/pipeline/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable quote-props */

module.exports = {
'root': true,
'parserOptions': {
'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true,
'tsconfigRootDir': __dirname,
'project': [
'tsconfig.build.json',
'tsconfig.builders.json',
'tsconfig.spec.json',
'tsconfig.eslint.json'
],
'sourceType': 'module'
},
'extends': [
'../../../.eslintrc.js'
]
};
2 changes: 2 additions & 0 deletions packages/@o3r/pipeline/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/index.*
/dist*
Empty file.
47 changes: 47 additions & 0 deletions packages/@o3r/pipeline/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<h1 align="center">Otter Pipeline</h1>
<p align="center">
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
</p>

This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
<br />
<br />

## Description

[![Stable Version](https://img.shields.io/npm/v/@o3r/pipeline?style=for-the-badge)](https://www.npmjs.com/package/@o3r/pipeline)
[![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/pipeline?color=green&style=for-the-badge)](https://www.npmjs.com/package/@o3r/pipeline)

This module contains tooling around DevOps toolchains.

## How to install

```shell
ng add @o3r/pipeline
```

> [!WARNING]
> This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
## Description

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.

### Properties

- `toolchain`: The DevOps toolchain to create. For now, only `GitHub` is supported.
- `runner`: The CI runner. Default is `ubuntu-latest`.
- `npmRegistry`: A private npm registry. By default, the public one will be used.

### Usage

Here is an example of how to use the `ng add` schematics with parameters:

```shell
ng add @o3r/pipeline --runner=windows-latest --npmRegistry=https://custom-registry.example.com
```

### Github workflow

The generated pipeline ensures that your code is built, tested, audited, and linted on every push or pull request to the main and release branches.
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 changes: 14 additions & 0 deletions packages/@o3r/pipeline/collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
"schematics": {
"ng-add": {
"description": "Add Otter Pipeline to the project.",
"factory": "./schematics/ng-add/index#ngAdd",
"schema": "./schematics/ng-add/schema.json",
"aliases": [
"install",
"i"
]
}
}
}
9 changes: 9 additions & 0 deletions packages/@o3r/pipeline/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConfig;

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
...getJestGlobalConfig(),
projects: [
'<rootDir>/testing/jest.config.ut.js'
]
};
5 changes: 5 additions & 0 deletions packages/@o3r/pipeline/migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
"schematics": {
}
}
120 changes: 120 additions & 0 deletions packages/@o3r/pipeline/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"name": "@o3r/pipeline",
"version": "0.0.0-placeholder",
"publishConfig": {
"access": "public"
},
"typings": "./dist/src/public_api.d.ts",
"description": "A package that provides toolchain related helpers.",
"keywords": [
"toolchain",
"pipeline",
"otter",
"otter-module"
],
"scripts": {
"nx": "nx",
"ng": "yarn nx",
"test": "yarn nx test pipeline",
"copy:templates": "yarn cpy 'schematics/**/templates{-*,}/**/*' dist/schematics",
"prepare:build:builders": "yarn cpy '{collection,migration}.json' dist && yarn cpy 'schematics/**/schema.json' dist/schematics && yarn copy:templates",
"prepare:publish": "prepare-publish ./dist",
"build:source": "tsc -b tsconfig.build.json && yarn cpy package.json dist/",
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn copy:templates && generate-cjs-manifest",
"build": "yarn nx build pipeline",
"postbuild": "patch-package-json-main"
},
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"es2020": "./dist/src/public_api.js",
"default": "./dist/src/public_api.js",
"typings": "./dist/src/public_api.d.ts",
"node": "./dist/src/public_api.js",
"require": "./dist/src/public_api.js"
}
},
"dependencies": {
"js-yaml": "^4.1.0",
"minimist": "^1.2.6",
"tslib": "^2.6.2"
},
"peerDependencies": {
"@o3r/core": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/telemetry": "workspace:^"
},
"peerDependenciesMeta": {
"@o3r/core": {
"optional": true
},
"@o3r/schematics": {
"optional": true
}
},
"devDependencies": {
"@angular-devkit/architect": "~0.1802.0",
"@angular-devkit/build-angular": "~18.2.0",
"@angular-devkit/core": "~18.2.0",
"@angular-devkit/schematics": "~18.2.0",
"@angular-eslint/eslint-plugin": "~18.3.0",
"@angular/cli": "~18.2.0",
"@angular/common": "~18.2.0",
"@angular/compiler": "~18.2.0",
"@angular/compiler-cli": "~18.2.0",
"@angular/core": "~18.2.0",
"@babel/core": "~7.25.0",
"@babel/preset-typescript": "~7.24.0",
"@compodoc/compodoc": "^1.1.19",
"@nx/eslint": "~19.5.0",
"@nx/eslint-plugin": "~19.5.0",
"@nx/jest": "~19.5.0",
"@nx/js": "~19.5.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/telemetry": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@schematics/angular": "~18.2.0",
"@stylistic/eslint-plugin-ts": "~2.4.0",
"@types/jest": "~29.5.2",
"@types/js-yaml": "^4.0.5",
"@types/minimist": "^1.2.2",
"@types/node": "^20.0.0",
"@types/semver": "^7.3.13",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@typescript-eslint/utils": "^7.14.1",
"cpy-cli": "^5.0.0",
"eslint": "^8.57.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-jest": "~28.8.0",
"eslint-plugin-jsdoc": "~48.11.0",
"eslint-plugin-prefer-arrow": "~1.2.3",
"eslint-plugin-unicorn": "^54.0.0",
"globby": "^11.1.0",
"jest": "~29.7.0",
"jest-junit": "~16.0.0",
"jsonc-eslint-parser": "~2.4.0",
"jsonschema": "~1.4.1",
"nx": "~19.5.0",
"pid-from-port": "^1.1.3",
"rxjs": "^7.8.1",
"semver": "^7.5.2",
"ts-jest": "~29.2.0",
"ts-node": "~10.9.2",
"type-fest": "^4.10.2",
"typescript": "~5.5.4",
"zone.js": "~0.14.2"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"schematics": "./collection.json",
"ng-update": {
"migrations": "./migration.json"
}
}
86 changes: 86 additions & 0 deletions packages/@o3r/pipeline/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "pipeline",
"$schema": "https://raw.githubusercontent.com/nrwl/nx/master/packages/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "packages/@o3r/pipeline/src",
"prefix": "o3r",
"targets": {
"build": {
"executor": "nx:run-script",
"outputs": [
"{projectRoot}/dist/package.json"
],
"options": {
"script": "postbuild"
},
"dependsOn": [
"^build",
"build-builders",
"compile"
]
},
"compile": {
"executor": "nx:run-script",
"options": {
"script": "build:source"
},
"inputs": [
"source",
"^source"
]
},
"prepare-build-builders": {
"executor": "nx:run-script",
"options": {
"script": "prepare:build:builders"
}
},
"build-builders": {
"executor": "nx:run-script",
"options": {
"script": "build:builders"
}
},
"lint": {
"options": {
"eslintConfig": "packages/@o3r/pipeline/.eslintrc.js",
"lintFilePatterns": [
"packages/@o3r/pipeline/src/**/*.ts",
"packages/@o3r/pipeline/schematics/**/*.ts",
"packages/@o3r/pipeline/package.json"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "packages/@o3r/pipeline/jest.config.js"
}
},
"test-int": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "packages/@o3r/pipeline/testing/jest.config.it.js"
}
},
"prepare-publish": {
"executor": "nx:run-script",
"options": {
"script": "prepare:publish"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "npm publish packages/@o3r/pipeline/dist"
}
},
"documentation": {
"executor": "nx:run-script",
"options": {
"script": "compodoc"
}
}
},
"tags": []
}
Loading

0 comments on commit acbc90d

Please sign in to comment.