Compare commits
3
Commits
develop
...
shared-base
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f2f3f0af1 | ||
|
|
e4b8c0f6aa | ||
|
|
68d5d46ec0 |
@@ -0,0 +1,25 @@
|
|||||||
|
# Contrôles de .github/workflows/ci.yml sur Gitea, par le workflow commun avalon-vanguard/ci.
|
||||||
|
# Ce dossier fait ignorer .github/workflows par Gitea ; GitHub continue d'exécuter les siens
|
||||||
|
# (CI, Pages, publication npm). Les contrôles post-build (points d'entrée, démo, types publiés,
|
||||||
|
# page de docs) sont regroupés dans le script « check ».
|
||||||
|
#
|
||||||
|
# node.yml lance « npm test », pas « test:coverage » : vitest.config.ts ne fixe aucun seuil de
|
||||||
|
# couverture et rien ne lit le rapport lcov, donc les mêmes tests décident du résultat.
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, develop]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
node: [20.x, 22.x, 24.x]
|
||||||
|
uses: avalon-vanguard/ci/.gitea/workflows/node.yml@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
secrets: inherit
|
||||||
@@ -34,12 +34,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
- name: Verify published entry points load
|
- name: Verify published entry points load
|
||||||
run: |
|
run: node scripts/check-entry-points.mjs
|
||||||
node --input-type=module -e "import * as m from './dist/esm/index.js'; if (typeof m.toInstance !== 'function') throw new Error('ESM entry point broken');"
|
|
||||||
node --input-type=commonjs -e "const m = require('./dist/cjs/index.js'); if (typeof m.toInstance !== 'function') throw new Error('CJS entry point broken');"
|
|
||||||
node --input-type=module -e "import { standardDecorators } from './dist/esm/vite.js'; if (standardDecorators().enforce !== 'pre') throw new Error('ESM cereale/vite broken');"
|
|
||||||
node --input-type=commonjs -e "const { standardDecorators } = require('./dist/cjs/vite.js'); if (standardDecorators().enforce !== 'pre') throw new Error('CJS cereale/vite broken');"
|
|
||||||
node --input-type=module -e "import * as m from './dist/cereale.min.js'; if (typeof m.toInstanceSync !== 'function') throw new Error('flat bundle broken');"
|
|
||||||
- name: Run Demo
|
- name: Run Demo
|
||||||
run: npm run demo
|
run: npm run demo
|
||||||
- name: Published types stand alone
|
- name: Published types stand alone
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
@avalon-vanguard:registry=https://git.avalonvanguard.com/api/packages/avalon-vanguard/npm/
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
import eslint from '@eslint/js';
|
import avalonBase from '@avalon-vanguard/config/eslint';
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
import globals from 'globals';
|
import globals from 'globals';
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@ export default tseslint.config(
|
|||||||
{
|
{
|
||||||
ignores: ['dist/**', 'node_modules/**', 'coverage/**', 'docs/**'],
|
ignores: ['dist/**', 'node_modules/**', 'coverage/**', 'docs/**'],
|
||||||
},
|
},
|
||||||
eslint.configs.recommended,
|
// @eslint/js recommended + typescript-eslint recommended, shared across avalon-vanguard
|
||||||
...tseslint.configs.recommended,
|
avalonBase,
|
||||||
{
|
{
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
|
|||||||
Generated
+33
@@ -9,6 +9,7 @@
|
|||||||
"version": "0.4.1",
|
"version": "0.4.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@avalon-vanguard/config": "^1.0.0",
|
||||||
"@babel/standalone": "^8.0.4",
|
"@babel/standalone": "^8.0.4",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@swc/core": "^1.15.47",
|
"@swc/core": "^1.15.47",
|
||||||
@@ -26,6 +27,38 @@
|
|||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@avalon-vanguard/config": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://git.avalonvanguard.com/api/packages/avalon-vanguard/npm/%40avalon-vanguard%2Fconfig/-/1.0.0/config-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ySojd0OONRb9N9KT4CJeyLf5GUrfRP8jxfPTMRv3HUk7gld4VuzZd16lW774SfLkMBMOUYVVf9SKBMO+JATTTA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@eslint/js": "^10.0.0",
|
||||||
|
"angular-eslint": "^22.0.0",
|
||||||
|
"eslint": "^10.0.0",
|
||||||
|
"prettier": "^3.0.0",
|
||||||
|
"typescript": "^6.0.0",
|
||||||
|
"typescript-eslint": "^8.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@eslint/js": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"angular-eslint": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"eslint": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"prettier": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"typescript-eslint": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/helper-string-parser": {
|
"node_modules/@babel/helper-string-parser": {
|
||||||
"version": "7.29.7",
|
"version": "7.29.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
"build:docs": "node scripts/build-docs.mjs",
|
"build:docs": "node scripts/build-docs.mjs",
|
||||||
"demo": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/example.ts",
|
"demo": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/example.ts",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
|
"typecheck": "npm run type-check",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"test:coverage": "vitest run --coverage",
|
"test:coverage": "vitest run --coverage",
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"verify": "npm run type-check && npm run lint && npm run test && npm run build && npm run check:types && npm run check:docs",
|
"verify": "npm run type-check && npm run lint && npm run test && npm run build && npm run check:types && npm run check:docs",
|
||||||
"prepublishOnly": "npm run verify",
|
"prepublishOnly": "npm run verify",
|
||||||
|
"check": "node scripts/check-entry-points.mjs && npm run demo && npm run check:types && npm run check:docs && npm run check:docs-sync",
|
||||||
"check:docs": "node scripts/check-docs.mjs",
|
"check:docs": "node scripts/check-docs.mjs",
|
||||||
"check:types": "node scripts/check-types.mjs",
|
"check:types": "node scripts/check-types.mjs",
|
||||||
"check:docs-sync": "npm run build:docs && node scripts/check-docs-sync.mjs"
|
"check:docs-sync": "npm run build:docs && node scripts/check-docs-sync.mjs"
|
||||||
@@ -79,6 +81,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://avalon-vanguard.github.io/cereale/",
|
"homepage": "https://avalon-vanguard.github.io/cereale/",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@avalon-vanguard/config": "^1.0.0",
|
||||||
"@babel/standalone": "^8.0.4",
|
"@babel/standalone": "^8.0.4",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@swc/core": "^1.15.47",
|
"@swc/core": "^1.15.47",
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": ["local>avalon-vanguard/renovate-config"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Fails if a published entry point does not load from dist/: `.` and `./vite`, each as ESM
|
||||||
|
* and as CommonJS, and the flat `./min` bundle. Run after `npm run build` (first step of
|
||||||
|
* `npm run check`). Moved here from inline `node -e` lines in .github/workflows/ci.yml so
|
||||||
|
* that the GitHub and Gitea workflows run the same check.
|
||||||
|
*/
|
||||||
|
import { createRequire } from 'node:module';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
const assert = (ok, what) => {
|
||||||
|
if (!ok) throw new Error(`${what} broken`);
|
||||||
|
};
|
||||||
|
|
||||||
|
assert(typeof (await import('../dist/esm/index.js')).toInstance === 'function', 'ESM entry point');
|
||||||
|
assert(typeof require('../dist/cjs/index.js').toInstance === 'function', 'CJS entry point');
|
||||||
|
assert((await import('../dist/esm/vite.js')).standardDecorators().enforce === 'pre', 'ESM cereale/vite');
|
||||||
|
assert(require('../dist/cjs/vite.js').standardDecorators().enforce === 'pre', 'CJS cereale/vite');
|
||||||
|
assert(typeof (await import('../dist/cereale.min.js')).toInstanceSync === 'function', 'flat bundle');
|
||||||
+4
-10
@@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
// Visit https://aka.ms/tsconfig to read more about this file
|
// Visit https://aka.ms/tsconfig to read more about this file
|
||||||
|
// Shared (@avalon-vanguard/config/tsconfig/library.json): sourceMap, declaration,
|
||||||
|
// declarationMap, noImplicitReturns, noImplicitOverride, noFallthroughCasesInSwitch,
|
||||||
|
// isolatedModules, skipLibCheck.
|
||||||
|
"extends": "@avalon-vanguard/config/tsconfig/library.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// File Layout
|
// File Layout
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
@@ -11,27 +15,17 @@
|
|||||||
"lib": ["ESNext", "ESNext.Decorators"],
|
"lib": ["ESNext", "ESNext.Decorators"],
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
|
|
||||||
// Other Outputs
|
|
||||||
"sourceMap": true,
|
|
||||||
"declaration": true,
|
|
||||||
"declarationMap": true,
|
|
||||||
|
|
||||||
// Stricter Typechecking Options
|
// Stricter Typechecking Options
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"exactOptionalPropertyTypes": true,
|
"exactOptionalPropertyTypes": true,
|
||||||
|
|
||||||
// Style Options
|
// Style Options
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noImplicitOverride": true,
|
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
|
|
||||||
// Recommended Options
|
// Recommended Options
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"strictPropertyInitialization": false,
|
"strictPropertyInitialization": false,
|
||||||
"isolatedModules": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
|
|
||||||
// NOTE: no `experimentalDecorators`. v2 uses TC39 standard decorators, which is what
|
// NOTE: no `experimentalDecorators`. v2 uses TC39 standard decorators, which is what
|
||||||
// gives ClassFieldDecoratorContext<This, Value> and therefore compile-time checking of
|
// gives ClassFieldDecoratorContext<This, Value> and therefore compile-time checking of
|
||||||
|
|||||||
Reference in New Issue
Block a user