Skip to content

Commit a20139f

Browse files
authored
Merge pull request #4 from Daniihh/workflow
Make master Package Ready
2 parents 78160d6 + 98f3f69 commit a20139f

File tree

7 files changed

+103
-25
lines changed

7 files changed

+103
-25
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
node_modules
2-
out/
1+
# Ignore generated files.
2+
node_modules/
3+
dist/

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore development files.
2+
test/
3+
gulpfile.js

gulpfile.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const [{src, dest}, fs, ts, rename, compress, merge] =
2-
["!gulp", "!fs", "typescript", "rename", "minify", "!merge-stream"]
1+
const [{src, dest}, fs, ts, rename, compress, merge, filter] =
2+
["!gulp", "!fs", "typescript", "rename", "minify", "!merge-stream", "filter"]
33
.map(i => i.startsWith("!") ? i.substr(1) : `gulp-${i}`).map(require);
44

5-
const requiredFolders = ["out"];
5+
const requiredFolders = ["dist"];
66

77
function ensureFolders() {
88
requiredFolders.forEach(dir => fs.existsSync(dir) ? null : fs.mkdirSync(dir));
@@ -13,14 +13,14 @@ module.exports = {
1313
ensureFolders();
1414

1515
const modSys = {"esmodule": "ESNext", "commonjs": "CommonJS"};
16+
const dTsFilter = filter(["**", "!**/*.d.ts"], {"restore": true});
1617
const get = (mod) => ts.createProject("tsconfig.json", {"module": modSys[mod]});
17-
const applyTs = (pipe, mod) => pipe.pipe(get(mod)()).pipe(rename(p => p.basename = mod + "-" + p.basename));
18+
const applyTs = (pipe, mod) => pipe.pipe(get(mod)()).pipe(dTsFilter).pipe(rename(p => p.basename = mod + "-" + p.basename));
1819
const applyCompress = (pipe, opts) => pipe.pipe(compress(opts));
1920

2021
let out = [src("./src/*.ts")];
2122
out = out.map(i => [applyTs(i, "esmodule"), applyTs(i, "commonjs")]).flat();
2223
out = out.map(i => [i, applyCompress(i, {"ext": {"min": "-min.js"}, "preserveComments": "some"})]).flat();
23-
return merge(...out).pipe(dest("./out/"));
24-
//return src("./src/*.ts").pipe(project()).pipe(dest("./out/"));
24+
return merge(...out, dTsFilter.restore).pipe(dest("./dist/"));
2525
}
2626
}

package-lock.json

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
{
2-
"name": "daniis-typescript-utils",
2+
"name": "daniis-tools",
33
"version": "1.0.0",
4-
"description": "Soon™ (Not a serious use of the TM emoji)",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "mocha",
8-
"start": "gulp compile"
9-
},
4+
"description": "A set of functions, types, better typings and extra methods to improve your coding experience.",
5+
"main": "dist/commonjs-tools.js",
6+
"types": "dist/tools.d.ts",
7+
"author": "Daniel Conley",
8+
"license": "GPL-3.0",
9+
"keywords": [
10+
"tools", "types", "prototype", "extension", "methods", "utility", "util"
11+
],
1012
"repository": {
1113
"type": "git",
12-
"url": "git+https://github.com/Daniihh/daniis-typescript-utils.git"
14+
"url": "https://github.com/Daniihh/daniis-typescript-utils.git"
1315
},
14-
"author": "Daniihh",
15-
"license": "ISC",
1616
"bugs": {
1717
"url": "https://github.com/Daniihh/daniis-typescript-utils/issues"
1818
},
1919
"homepage": "https://github.com/Daniihh/daniis-typescript-utils#readme",
20+
"scripts": {
21+
"test": "mocha",
22+
"compile": "gulp compile"
23+
},
2024
"dependencies": {},
2125
"devDependencies": {
2226
"@types/node": "^12.12.14",
2327
"gulp": "^4.0.2",
28+
"gulp-filter": "^6.0.0",
2429
"gulp-minify": "^3.1.0",
2530
"gulp-rename": "^2.0.0",
2631
"gulp-typescript": "^6.0.0-alpha.1",

src/tools.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ type PsuedoObject<T extends Primitive> =
6666

6767
/**
6868
* A union of all JavaScript primitives.
69-
*
70-
* Exclusion Reason: Exporting is not necessary at this point in time.
7169
*/
72-
type Primitive = string | number | bigint | boolean | symbol;
70+
export type Primitive = string | number | bigint | boolean | symbol;
7371

7472
/*
7573
Quick Definitions
@@ -347,7 +345,7 @@ declare global {
347345
* @param str String to interpolate with.
348346
* @param values The variables supplied.
349347
*/
350-
interpolate(values: Of<any>);
348+
interpolate(values: Of<any>): string;
351349
}
352350

353351
interface SymbolConstructor {

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
3+
"target": "ES6",
44
"lib": ["ESNext", "ES2017.Object", "ESNext.array", "ES2020.String"],
55
"esModuleInterop": true,
6-
"experimentalDecorators": true
6+
"experimentalDecorators": true,
7+
"declaration": true
78
}
89
}

0 commit comments

Comments
 (0)