Skip to content

Commit

Permalink
build: fix ci and configuration of buid (esm + cjs)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Oct 28, 2024
1 parent 14c47e3 commit 9279cc6
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: ci
on:
push:
branches:
- main
- v1
branches: ["main", "v1"]
pull_request:
branches:
- main
- v1
branches: ["main", "v1"]

jobs:
test_lint:
Expand Down Expand Up @@ -159,7 +155,7 @@ jobs:
env:
XDG_CACHE_HOME: "/home/runner/.cache/yarn"
- run: yarn build
- run: npx -y -p denoify@1.3.0 enable_short_npm_import_path
- run: npx -y -p denoify@1.6.13 enable_short_npm_import_path
env:
DRY_RUN: "0"
- uses: garronej/[email protected]
Expand Down
File renamed without changes.
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@inseefr/lunatic-dsfr",
"version": "2.4.1",
"version": "2.4.2-rc.0",
"description": "Couche graphique pour Lunatic reposant sur le Système de Design de l'État (DSFR)",
"repository": {
"type": "git",
"url": "git://github.com/inseefr/lunatic-dsfr.git"
},
"author": "INSEE (http://www.insee.fr)",
"license": "MIT",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/esm/index.js",
"scripts": {
"knip": "knip",
"build": "tsc -p tsconfig.build.json",
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig-esm.json",
"check": "tsc --noEmit",
"lint:check": "eslint ./src",
"lint": "npm run lint:check -- --fix",
Expand All @@ -29,11 +29,14 @@
"test": "vitest",
"test:e2e": "playwright test",
"test:e2e:visual": "playwright test --headed --debug e2e/pairwise.spec.ts",
"test:e2e:codegen": "playwright codegen http://localhost:6006/iframe.html?viewMode=story&id="
"test:e2e:codegen": "playwright codegen http://localhost:6006/iframe.html?viewMode=story&id=",
"link-in-app": "tsx scripts/link-in-app.ts"
},
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js"
".": {
"module": "./dist/esm/index.js",
"default": "./dist/index.js"
}
},
"lint-staged": {
"*.{ts,tsx}": [
Expand All @@ -50,7 +53,8 @@
},
"files": [
"src/",
"dist/"
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"keywords": [],
"homepage": "https://inseefr.github.io/Lunatic-DSFR",
Expand Down
8 changes: 8 additions & 0 deletions tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"module": "es2020",
"target": "ES2018",
"outDir": "./dist/esm"
}
}
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["src/stories/"]
"exclude": ["src/stories/", "**/*.test.ts"]
}
14 changes: 6 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
{
"compilerOptions": {
"module": "ESNext",
"module": "CommonJS",
"target": "ESNext",
"moduleResolution": "node",
"target": "es5",
"lib": ["ESNext", "DOM"],
"esModuleInterop": true,
"declaration": true,
// Do not change or the linking script will stop working
"outDir": "./dist",
"sourceMap": true,
"newLine": "LF",
"noUnusedLocals": true,
"noUnusedParameters": true,
"incremental": true,
"strict": true,
"downlevelIteration": true,
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"verbatimModuleSyntax": true,
"skipLibCheck": true
},
"include": ["src"]
"include": ["src", "src/tests/setup.ts"],
"exclude": ["src/stories/", "**/*.test.ts", "src/**/*.deno.ts", "src/**/*.deno.tsx"]
}

0 comments on commit 9279cc6

Please sign in to comment.