Skip to content

Commit

Permalink
Merge pull request #4 from incubateur-ademe/maj-publicodes-pkg
Browse files Browse the repository at this point in the history
pkg: MAJ Publicodes
  • Loading branch information
Clemog committed Mar 27, 2024
2 parents 66cb5a1 + f4dcf90 commit ca82211
Show file tree
Hide file tree
Showing 25 changed files with 10,500 additions and 4,830 deletions.
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
target-branch: 'preprod'
schedule:
interval: 'daily'
groups:
publicodes-dependencies:
patterns:
- '@incubateur-ademe/*'
- '@publicodes/*'
- 'publicodes'
dev-dependencies:
patterns:
- 'prettier'
allow:
- dependency-name: publicodes-dependencies
ignore:
- dependency-name: dev-dependencies
labels:
- 'dependencies'
18 changes: 10 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Set-up bun
uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v3
with:
bun-version: latest
- name: Install dependencies and build
run: bun i --frozen-lockfile
- name: Build
run: bun run build
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: git log | head && git status
- id: build
name: Build
run: yarn run build
15 changes: 4 additions & 11 deletions .github/workflows/packaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set-up bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun i --frozen-lockfile && bun i --frozen-lockfile --cwd doc
- run: bun run doc:build
- name: Install dependencies and build
run: yarn install --immutable && yarn install --immutable --cwd doc
- run: yarn run doc:build
- name: Deploy
uses: crazy-max/ghaction-github-pages@v3
with:
Expand All @@ -91,17 +88,13 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Set-up bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build
run: bun i --frozen-lockfile && bun run build
run: yarn install --immutable && yarn build
- name: Publish to NPM
run: npm publish
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
publicodes-impact-livraison.model.json
index.d.ts
index.js
.DS_Store
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"bracketSpacing": true,
"semi": false,
"singleQuote": true,
"trailingComma": "none"
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ligne](https://incubateur-ademe.github.io/publicodes-impact-livraison/).
Ajouter le paquet à vos dépendances :

```
bun add @incubateur-ademe/publicodes-impact-livraison
yarn add @incubateur-ademe/publicodes-impact-livraison
```

Instancier un nouveau moteur Publicode :
Expand All @@ -44,7 +44,7 @@ Utiliser certaines règles dans un autre modèle publicodes :
```yaml
importer!:
depuis:
nom: "@incubateur-ademe/publicodes-impact-livraison"
nom: '@incubateur-ademe/publicodes-impact-livraison'
url: https://github.com/incubateur-ademe/publicodes-impact-livraison
dans: modèle livraison
les règles:
Expand All @@ -63,7 +63,7 @@ Pour installer les dépendances et compiler tous les fichiers `.publicodes` en
un seul fichier JSON, il suffit d'exécuter la commande suivante :

```
bun && bun run build
yarn && yarn run build
```

#### Lancer la documentation
Expand All @@ -75,9 +75,9 @@ Pour lancer l'app React en local permettant de parcourir la documentation du
modèle, il suffit d'exécuter la commande suivante :

```
bun i --cwd doc
yarn i --cwd doc
bun run doc:start
yarn run doc
```

#### Lancer l'API
Expand All @@ -89,10 +89,10 @@ Pour lancer le serveur Node permettant d'utiliser l'API REST, il faut utiliser l
suivantes :

```
bun run api
yarn run api
# En watch-mode
bun run api:watch
yarn run api:watch
```

## Publier une nouvelle version
Expand Down
8 changes: 4 additions & 4 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"index.js"
],
"scripts": {
"build": "bun run index.js"
"build": "node index.js"
},
"repository": "git@github.com:incubateur-ademe/publicodes-impact-livraison.git",
"homepage": "https://github.com/incubateur-ademe/publicodes-impact-livraison#readme",
Expand All @@ -19,15 +19,15 @@
"authors": [],
"license": "MIT",
"devDependencies": {
"@incubateur-ademe/publicodes-tools": "^0.2.1",
"@publicodes/api": "^1.0.0-beta.71",
"@publicodes/api": "^1.0.0-beta.77",
"@publicodes/tools": "^1.0.6",
"nodemon": "^3.0.1"
},
"dependencies": {
"@koa/cors": "^4.0.0",
"@koa/router": "^12.0.0",
"koa": "^2.14.2",
"publicodes": "^1.0.0-beta.71"
"publicodes": "^1.1.1"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { writeFileSync } from 'fs'
import { getModelFromSource } from '@incubateur-ademe/publicodes-tools/compilation'
import { disabledLogger } from '@incubateur-ademe/publicodes-tools'
import { getModelFromSource } from '@publicodes/tools/compilation'
import { disabledLogger } from '@publicodes/tools'
import Engine from 'publicodes'

const srcFiles = 'rules/**/*.publicodes'
Expand Down
Binary file removed bun.lockb
Binary file not shown.
Binary file removed doc/bun.lockb
Binary file not shown.

0 comments on commit ca82211

Please sign in to comment.