-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
By updating the gobstones-scripts dependency and ejecting the rollup configuration, along with changes in the package.json, now a separated cli module is exported. Thi is the module to export only from cli baed applications, and only in the cli part of it. fix #22
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@gobstones/gobstones-core", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"description": "A set of utility types, interfaces and classes that are used through all the Gobstones Platform repositories.", | ||
"repository": "https://github.com/gobstones/gobstones-core", | ||
"homepage": "https://gobstones.github.io/gobstones-core", | ||
|
@@ -11,8 +11,32 @@ | |
"module": "./dist/esm/index.mjs", | ||
"typings": "./dist/esm/typings/index.d.ts", | ||
"exports": { | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs" | ||
".": { | ||
"import": { | ||
"types": "./dist/esm/typings/index.d.ts", | ||
"default": "./dist/esm/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/cjs/typings/index.d.ts", | ||
"default": "./dist/cjs/index.cjs" | ||
} | ||
}, | ||
"./cli": { | ||
"import": { | ||
"types": "./dist/esm/cli/typings/cli.d.ts", | ||
"default": "./dist/esm/cli/cli.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/cjs/cli/typings/cli.d.ts", | ||
"default": "./dist/cjs/cli/cli.cjs" | ||
} | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"cli": ["./dist/esm/typings/cli.d.ts"], | ||
".": ["./dist/esm/typings/index.d.ts"] | ||
} | ||
}, | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
|
@@ -37,7 +61,7 @@ | |
"commander": "^11.1.0" | ||
}, | ||
"devDependencies": { | ||
"@gobstones/gobstones-scripts": "^0.5.3", | ||
"@gobstones/gobstones-scripts": "^0.5.4", | ||
"husky": "^8.0.2" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const fs = require('fs'); | ||
|
||
const commonjs = require('@rollup/plugin-commonjs'); | ||
const typescript = require('@rollup/plugin-typescript'); | ||
|
||
const { config } = require('@gobstones/gobstones-scripts'); | ||
|
||
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString()); | ||
|
||
export default [ | ||
{ | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
sourcemap: true, | ||
file: packageJson.exports['.'].import.default, | ||
format: 'esm' | ||
}, | ||
{ | ||
sourcemap: true, | ||
file: packageJson.exports['.'].require.default, | ||
format: 'cjs' | ||
} | ||
], | ||
preserveSymlinks: true, | ||
plugins: [ | ||
typescript({ | ||
tsconfig: config.configurationFiles[config.loadedOptions.type].tsConfigFile, | ||
declarationDir: './typings' | ||
}), | ||
commonjs() | ||
], | ||
external: [/@gobstones\/.*/] | ||
}, | ||
{ | ||
input: 'src/cli.ts', | ||
output: [ | ||
{ | ||
sourcemap: true, | ||
file: packageJson.exports['./cli'].import.default, | ||
format: 'esm' | ||
}, | ||
{ | ||
sourcemap: true, | ||
file: packageJson.exports['./cli'].require.default, | ||
format: 'cjs' | ||
} | ||
], | ||
preserveSymlinks: true, | ||
plugins: [ | ||
typescript({ | ||
tsconfig: config.configurationFiles[config.loadedOptions.type].tsConfigFile, | ||
declarationDir: './typings' | ||
}), | ||
commonjs() | ||
], | ||
external: [/@gobstones\/.*/, 'commander', 'fs'] | ||
} | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* A type modifier that allows to construct a generic type that | ||
* requires only one property of a given type. | ||
* | ||
* @example | ||
* Conider that we have a type | ||
* ``` | ||
* type User = { | ||
* id: string | ||
* name?: string | ||
* email?: string | ||
* } | ||
* ``` | ||
* | ||
* Then we can create a type like so: | ||
* ``` | ||
* type UserWithName = WithRequired<User, 'name'> | ||
* ``` | ||
* | ||
* @param T The base type. | ||
* @param K the name of the property to require in the new type. | ||
*/ | ||
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }; |