Skip to content

Commit 5d7bf58

Browse files
author
Jérôme GAVIGNET
committed
feat: Init open3Cl preprocesor library
0 parents  commit 5d7bf58

24 files changed

+16787
-0
lines changed

.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"jest": true,
6+
"node": true
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": "latest",
10+
"sourceType": "module"
11+
},
12+
"ignorePatterns": ["duplicate", "test"],
13+
"extends": ["eslint:recommended", "prettier"],
14+
"rules": {
15+
"no-prototype-builtins": "off",
16+
"no-irregular-whitespace": "off"
17+
}
18+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Data used to reproduce the behavior. For example, ADEME file identifier.
14+
15+
**Expected behavior**
16+
A clear and concise description of what you expected to happen.
17+
18+
**Additional context**
19+
20+
- NodeJS version: [e.g. 18.16.0]
21+
Add any other context about the problem here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
id-token: write
13+
14+
jobs:
15+
build:
16+
name: Build
17+
runs-on: ubuntu-24.04
18+
env:
19+
NODE_OPTIONS: '--max-old-space-size=4096'
20+
steps:
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
25+
- name: Git checkout for source code analysis
26+
uses: actions/checkout@v4
27+
28+
- name: Install Dependencies
29+
run: npm ci
30+
31+
- name: Cache Node.js modules
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.npm
35+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
36+
37+
- name: Generate assets
38+
run: npm run assets:sync
39+
40+
- name: Run unit tests
41+
run: npm run test
42+
43+
- name: Run qa
44+
run: |
45+
npm run qa:lint
46+
npm run qa:duplication
47+
48+
- name: Release
49+
if: github.ref == 'refs/heads/main'
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
run: |
54+
cp package.json src/
55+
cp README.md src/
56+
npm run release -- --r git@github.com:Open3CL/preprocessor.git

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.idea/
2+
/node_modules/
3+
/duplicate/
4+
/coverage/
5+
junit-report.xml
6+
.npmrc
7+
*.iml

.gitlab-ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
include:
2+
- project: 'renovate-bot/renovate-runner'
3+
file: '/templates/renovate.gitlab-ci.yml'
4+
stages:
5+
- prepare
6+
- qa
7+
- deploy
8+
9+
default:
10+
image: node:20.12.0
11+
12+
workflow:
13+
rules:
14+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
15+
when: never
16+
- when: always
17+
18+
.if-code-change:
19+
rules:
20+
- if: '$CI_PIPELINE_SOURCE == "schedule"'
21+
when: never
22+
- changes:
23+
- package-lock.json
24+
- package.json
25+
- .gitlab-ci.yml
26+
- 'src/**/*'
27+
- 'tests/**/*'
28+
29+
install:
30+
stage: prepare
31+
extends:
32+
- .if-code-change
33+
script:
34+
- npm ci --cache .npm --prefer-offline
35+
cache:
36+
key:
37+
files:
38+
- package-lock.json
39+
paths:
40+
- .npm/
41+
- node_modules/
42+
policy: push
43+
44+
analysis:
45+
stage: qa
46+
extends:
47+
- .if-code-change
48+
cache:
49+
key:
50+
files:
51+
- package-lock.json
52+
paths:
53+
- .npm/
54+
- node_modules/
55+
policy: pull
56+
script:
57+
- npm run qa:prettier:check
58+
- npm run qa:lint
59+
- npm run qa:duplication
60+
61+
test:
62+
stage: qa
63+
extends:
64+
- .if-code-change
65+
artifacts:
66+
when: always
67+
paths:
68+
- junit-report.xml
69+
reports:
70+
junit: junit-report.xml
71+
cache:
72+
key:
73+
files:
74+
- package-lock.json
75+
paths:
76+
- .npm/
77+
- node_modules/
78+
policy: pull
79+
script:
80+
- npm run test:ci
81+
coverage: '/Coverage: (\d{1,3}\.?\d{0,})%/'
82+
83+
publish_library:
84+
stage: deploy
85+
only:
86+
- main
87+
except:
88+
- schedules
89+
needs:
90+
- test
91+
dependencies:
92+
- test
93+
cache:
94+
key:
95+
files:
96+
- package-lock.json
97+
paths:
98+
- .npm/
99+
- node_modules/
100+
policy: pull
101+
before_script:
102+
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${NPM_TOKEN}" > .npmrc
103+
- echo "@${CI_PROJECT_NAMESPACE}:registry=${PACKAGE_REGISTRY_URL}" >> .npmrc
104+
script:
105+
- npm publish --registry "${PACKAGE_REGISTRY_URL}"
106+
variables:
107+
PACKAGE_REGISTRY_URL: '$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/npm/'
108+
NPM_TOKEN: $CI_JOB_TOKEN

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install commitlint --config commitlint.config.cjs --edit $1

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install pretty-quick --staged

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
package-lock.json

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100
6+
}

0 commit comments

Comments
 (0)