Skip to content

Commit

Permalink
Modified build steps for kg-unsplash-selector package (#1167)
Browse files Browse the repository at this point in the history
no issue

- modified vite config to the package can be imported into other React applications.
- includes a couple version bumps that was used to fine tune the exported modules.
- documentation to follow.
  • Loading branch information
ronaldlangeveld authored Mar 12, 2024
1 parent b02fa0b commit 5c6267f
Show file tree
Hide file tree
Showing 24 changed files with 302 additions and 405 deletions.
25 changes: 7 additions & 18 deletions packages/kg-unsplash-selector/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
{
"name": "@tryghost/kg-unsplash-selector",
"version": "0.0.1",
"type": "module",
"version": "0.1.8",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TryGhost/Koenig/tree/master/packages/kg-unsplash-selector"
},
"types": "./types/index.d.ts",
"author": "Ghost Foundation",
"files": [
"LICENSE",
"README.md",
"dist/"
],
"main": "./dist/unsplash-selector.umd.js",
"module": "./dist/unsplash-selector.js",
"exports": {
".": {
"import": "./dist/unsplash-selector.js",
"require": "./dist/unsplash-selector.umd.js",
"types": "./types/index.d.ts"
},
"./styles/index.css": "./dist/index.css"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"type": "module",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
"scripts": {
"dev": "vite",
"build": "concurrently \"vite build\" \"tsc -p tsconfig.declaration.json\"",
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint src --ext .js,.ts,.jsx,.tsx --cache",
"test": "yarn test:unit && yarn test:acceptance",
Expand Down Expand Up @@ -63,6 +51,7 @@
"typescript": "5.2.2",
"vite": "5.1.4",
"vite-plugin-css-injected-by-js": "3.4.0",
"vite-plugin-dts": "^3.7.3",
"vite-plugin-svgr": "4.2.0",
"vitest": "1.3.1"
}
Expand Down
31 changes: 19 additions & 12 deletions packages/kg-unsplash-selector/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"skipLibCheck": true,
"types": ["vite/client", "vite-plugin-svgr/client"],
/* Bundler mode */
"moduleResolution": "bundler",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "./types",
"baseUrl": ".",
"paths": {
"kg-unsplash-selector": ["src/index.ts"],
},
"typeRoots": ["node_modules/@types", "types/index.d.ts"],
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
"references": [{ "path": "./tsconfig.node.json" }],
}
10 changes: 0 additions & 10 deletions packages/kg-unsplash-selector/types/UnsplashSearchModal.d.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/kg-unsplash-selector/types/UnsplashService.d.ts

This file was deleted.

75 changes: 0 additions & 75 deletions packages/kg-unsplash-selector/types/UnsplashTypes.d.ts

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions packages/kg-unsplash-selector/types/api/MasonryService.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/kg-unsplash-selector/types/api/PhotoUseCase.d.ts

This file was deleted.

23 changes: 0 additions & 23 deletions packages/kg-unsplash-selector/types/api/UnsplashProvider.d.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/kg-unsplash-selector/types/api/UnsplashService.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/kg-unsplash-selector/types/api/unsplashFixtures.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/kg-unsplash-selector/types/index.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/kg-unsplash-selector/types/masonry/MasonryService.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/kg-unsplash-selector/types/photo/PhotoUseCase.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/kg-unsplash-selector/types/portal.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/kg-unsplash-selector/types/ui/UnsplashButton.d.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/kg-unsplash-selector/types/ui/UnsplashGallery.d.ts

This file was deleted.

Loading

0 comments on commit 5c6267f

Please sign in to comment.