Skip to content

Commit

Permalink
types generation commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmachuca committed Oct 21, 2024
1 parent bd896f8 commit 3399838
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 18 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
"module": "build/index.mjs",
"browser": "browser/index.js",
"type": "commonjs",
"types": "src/**/*.d.ts",
"types": "build/index.d.ts",
"exports": {
".": {
"require": "./build/index.cjs",
"import": "./build/index.mjs",
"types": "./src/types.d.ts"
"types": "./build/index.d.ts"
},
"./package.json": "./package.json"
},
"license": "LGPL-3.0",
"scripts": {
"build": "npm run build:ts && npm run build:browser",
"build": "npm run build:ts-types && npm run build:ts && npm run build:browser",
"build:ts": "npm test && npx tsc",
"build:ts-types": "npx tsc --project tsconfig.d.json",
"build:browser": "npx -y [email protected] build/*.js --bundle --outdir=browser --keep-names --minify --global-name=global --sourcemap --splitting --chunk-names=chunks/[name]-[hash] --format=esm --target=es2021",
"start": "qcobjects-shell",
"test": "(npm run lint && (npx jasmine))",
Expand Down
19 changes: 8 additions & 11 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Type definitions for QCObjects 2.4
// Project: https://qcobjects.dev
// Definitions by: Jean Machuca <https://github.com/jeanmachuca>
// Definitions: https://qcobjects.dev

/**
*/

import QCObjects from "qcobjects";

export = QCObjects;
declare module "QCObjects" {
const _exports: {};
export = _exports;
}
declare module "index" {
import QCObjects from "QCObjects";
export default QCObjects;
}
4 changes: 2 additions & 2 deletions tsconfig.d.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
"outFile": "src/types.d.ts",
"outFile": "src/index.d.ts",
"typeRoots": ["types", "node_modules/@types", "@typescript-eslint"],
"allowSyntheticDefaultImports":true,
"esModuleInterop": true
},
"include": ["src/**/*.ts", "src/static/js/packages/components/*.d.ts"],
"include": ["src/**/*.ts", "src/static/js/packages/components/*.d.ts", "types/*.d.ts"],
"exclude": ["src/**/*.spec.js", "src/*.js", "src/*.d.ts", "src/**/*.d.ts"]
}
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
"outDir": "build", /* Specify an output folder for all emitted files. */
"allowSyntheticDefaultImports":true,
"esModuleInterop": true
"esModuleInterop": true,
"baseUrl": ".",
"typeRoots": ["types", "node_modules/@types", "@typescript-eslint"]
},
"include": ["src/**/*.ts", "src/**/*.mts", "src/**/*.cts"],
"exclude": ["src/**/*.spec.js", "src/*.js"]
"exclude": ["src/**/*.spec.js", "src/*.js","src/*.d.ts", "src/**/*.d.ts"]
}
Loading

0 comments on commit 3399838

Please sign in to comment.