generated from graasp/graasp-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: build with vite * fix: add types to build output * fix: use specific build ts config * fix: use https for mock host
- Loading branch information
Showing
9 changed files
with
1,249 additions
and
1,220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
{ | ||
"name": "@graasp/sdk", | ||
"version": "3.5.0", | ||
"license": "AGPL-3.0-only", | ||
"repository": "[email protected]:graasp/graasp-sdk.git", | ||
"author": "Graasp", | ||
"contributors": [ | ||
"Kim Lan Phan Hoang", | ||
"Basile Spaenlehauer" | ||
], | ||
"license": "AGPL-3.0-only", | ||
"source": "src/index.ts", | ||
"main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"typescript": { | ||
"definition": "dist/index.d.ts" | ||
}, | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"type": "module", | ||
"sideEffects": false, | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
"date-fns": "3.3.1", | ||
"js-cookie": "3.0.5", | ||
"uuid": "9.0.1", | ||
"validator": "13.11.0" | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"scripts": { | ||
"pre-commit": "yarn prettier:check && yarn lint", | ||
"hooks:uninstall": "husky uninstall", | ||
"hooks:install": "husky install", | ||
"build": "tsc -p tsconfig.build.json && tsc-alias", | ||
"type-check": "tsc --noEmit", | ||
"build": "tsc --noEmit -p tsconfig.build.json && vite build", | ||
"test": "vitest", | ||
"type-check": "tsc --noEmit", | ||
"lint": "eslint {src,test}", | ||
"prettier:check": "prettier --check src/**/*.ts", | ||
"prettier:write": "prettier --write src/**/*.ts", | ||
"check": "yarn prettier:check && yarn lint && yarn type-check", | ||
"pre-commit": "yarn prettier:check && yarn lint", | ||
"prepack": "yarn build", | ||
"prepare": "yarn prepack && yarn hooks:install", | ||
"check": "yarn prettier:check && yarn lint && yarn type-check" | ||
"hooks:install": "husky install", | ||
"hooks:uninstall": "husky uninstall" | ||
}, | ||
"dependencies": { | ||
"js-cookie": "3.0.5", | ||
"validator": "13.11.0" | ||
}, | ||
"peerDependencies": { | ||
"date-fns": "^3", | ||
"uuid": "^9" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "18.5.0", | ||
|
@@ -50,18 +51,21 @@ | |
"@types/eslint": "8.56.2", | ||
"@types/js-cookie": "3.0.6", | ||
"@types/jsdom": "21.1.6", | ||
"@types/node": "20.11.6", | ||
"@types/uuid": "9.0.7", | ||
"@types/validator": "13.11.8", | ||
"@typescript-eslint/eslint-plugin": "6.19.1", | ||
"@typescript-eslint/parser": "6.19.1", | ||
"date-fns": "3.3.1", | ||
"eslint": "8.56.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"husky": "8.0.3", | ||
"jsdom": "24.0.0", | ||
"prettier": "3.2.4", | ||
"ts-node": "10.9.2", | ||
"tsc-alias": "1.8.8", | ||
"typescript": "5.3.3", | ||
"uuid": "9.0.1", | ||
"vite": "5.0.12", | ||
"vite-plugin-dts": "3.7.2", | ||
"vitest": "1.2.1" | ||
}, | ||
"packageManager": "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"test", | ||
"src/**/*.test.ts" | ||
] | ||
"exclude": ["src/**/*.test.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "node16", | ||
"outDir": "dist", | ||
"esModuleInterop": true, | ||
"lib": ["esnext"], | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "ES2021.String", "ESNext", "DOM", "DOM.Iterable"], | ||
"allowJs": false, | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
"declaration": true, | ||
"declarationDir": "dist", | ||
"moduleResolution": "node16", | ||
"strict": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
|
||
"types": ["vite/client"], | ||
"paths": { | ||
"@/*": ["./src/*"], | ||
}, | ||
|
||
"noImplicitThis": true, | ||
"noImplicitAny": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"strictPropertyInitialization": false, | ||
"strictNullChecks": true, | ||
"baseUrl": "./src", | ||
"paths": { | ||
"@/*": ["./*"] | ||
} | ||
}, | ||
"include": ["src/**/*"] | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"allowSyntheticDefaultImports": true, | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["vite.config.ts", "package.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
/// <reference types="vitest" /> | ||
import { resolve } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import { defineConfig } from 'vite'; | ||
import { UserConfigExport, defineConfig } from 'vite'; | ||
import dts from 'vite-plugin-dts'; | ||
|
||
export default defineConfig({ | ||
test: {}, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: '@', | ||
replacement: fileURLToPath(new URL('./src', import.meta.url)), | ||
}, | ||
export default (): UserConfigExport => { | ||
return defineConfig({ | ||
test: {}, | ||
plugins: [ | ||
dts({ | ||
tsconfigPath: './tsconfig.build.json', | ||
insertTypesEntry: true, | ||
}), | ||
], | ||
}, | ||
}); | ||
build: { | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: resolve(__dirname, 'src/index.ts'), | ||
name: 'graasp-sdk', | ||
formats: ['cjs', 'es'], | ||
// the proper extensions will be added | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
// make sure to externalize deps that shouldn't be bundled | ||
// into your library | ||
external: ['date-fns', 'uuid'], | ||
}, | ||
}, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: '@', | ||
replacement: fileURLToPath(new URL('./src', import.meta.url)), | ||
}, | ||
], | ||
}, | ||
}); | ||
}; |
Oops, something went wrong.