@flashist/fconsole 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gulp/tasks/clean.js +9 -0
- package/gulp/tasks/compile.js +27 -0
- package/gulp/tasks/copy-to-dist.js +15 -0
- package/gulp/tasks/generate-definitions.js +86 -0
- package/gulpfile.js +11 -0
- package/package.json +5 -13
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var gulp = require("gulp");
|
|
2
|
+
var shell = require('gulp-shell');
|
|
3
|
+
|
|
4
|
+
gulp.task(
|
|
5
|
+
"compile",
|
|
6
|
+
function (cb) {
|
|
7
|
+
|
|
8
|
+
gulp.src(".", {read: false})
|
|
9
|
+
.pipe(
|
|
10
|
+
shell(
|
|
11
|
+
["tsc"]
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
).on(
|
|
15
|
+
"end",
|
|
16
|
+
function () {
|
|
17
|
+
cb();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
).on(
|
|
21
|
+
"error",
|
|
22
|
+
function () {
|
|
23
|
+
console.error("ERROR! compile.js");
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var gulp = require("gulp");
|
|
2
|
+
var fs = require("fs");
|
|
3
|
+
var path = require("path");
|
|
4
|
+
var glob = require("glob");
|
|
5
|
+
|
|
6
|
+
gulp.task(
|
|
7
|
+
"generate-definitions",
|
|
8
|
+
async () => {
|
|
9
|
+
|
|
10
|
+
await new Promise(
|
|
11
|
+
(resolve) => {
|
|
12
|
+
|
|
13
|
+
// console.log("START! generate-definitions.js");
|
|
14
|
+
|
|
15
|
+
var getSafeDirPath = function(dirPath) {
|
|
16
|
+
dirPath += dirPath.charAt(dirPath.length - 1) == "/" ? "" : "/";
|
|
17
|
+
return dirPath;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var argv = {};
|
|
21
|
+
|
|
22
|
+
var basePath = "./src/";
|
|
23
|
+
// console.log("BEFORE argv.src: " + argv.src);
|
|
24
|
+
argv.src = argv.src ? argv.src : basePath;
|
|
25
|
+
// Adding a closing slash to make correct folder path (if needed)
|
|
26
|
+
argv.src = getSafeDirPath(argv.src);
|
|
27
|
+
// console.log("AFTER argv.src: " + argv.src);
|
|
28
|
+
|
|
29
|
+
// console.log("BEFORE argv.outFile: " + argv.outFile);
|
|
30
|
+
argv.outFile = argv.outFile ? argv.outFile : "index";
|
|
31
|
+
// console.log("AFTER argv.outFile: " + argv.outFile);
|
|
32
|
+
|
|
33
|
+
// console.log("BEFORE argv.outDir: " + argv.outDir);
|
|
34
|
+
argv.outDir = argv.outDir ? argv.outDir : basePath;
|
|
35
|
+
argv.outDir = getSafeDirPath(argv.outDir);
|
|
36
|
+
// console.log("AFTER argv.outDir: " + argv.outDir);
|
|
37
|
+
|
|
38
|
+
var outFileName = argv.outFile + ".ts";
|
|
39
|
+
// console.log("outFileName: " + outFileName);
|
|
40
|
+
// Remove prev index file
|
|
41
|
+
if (fs.existsSync(basePath + outFileName)) {
|
|
42
|
+
fs.unlinkSync(basePath + outFileName);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var resultDeclarationText = "";
|
|
46
|
+
|
|
47
|
+
// console.log("Imported files:");
|
|
48
|
+
var tempSettings = `${argv.src}**/*.ts`;
|
|
49
|
+
|
|
50
|
+
glob(
|
|
51
|
+
tempSettings,
|
|
52
|
+
(error, files) => {
|
|
53
|
+
var filesCount = files.length;
|
|
54
|
+
for (var fileIndex = 0; fileIndex < filesCount; fileIndex++) {
|
|
55
|
+
var singleFile = files[fileIndex];
|
|
56
|
+
console.log("singleFile: ", singleFile);
|
|
57
|
+
|
|
58
|
+
let importPath = path.relative(basePath, singleFile);
|
|
59
|
+
if (importPath.indexOf(".d.ts") != -1) {
|
|
60
|
+
importPath = importPath.substr(0, importPath.lastIndexOf(".d.ts"));
|
|
61
|
+
} else if (importPath.indexOf(".ts") != -1) {
|
|
62
|
+
importPath = importPath.substr(0, importPath.lastIndexOf(".ts"));
|
|
63
|
+
}
|
|
64
|
+
// console.log("- " + importPath);
|
|
65
|
+
|
|
66
|
+
resultDeclarationText += "export * from '" + "./" + importPath + "'";
|
|
67
|
+
resultDeclarationText += "\n";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
console.log("Declarations: ");
|
|
71
|
+
console.log(resultDeclarationText);
|
|
72
|
+
|
|
73
|
+
fs.writeFile(
|
|
74
|
+
argv.outDir + outFileName,
|
|
75
|
+
resultDeclarationText,
|
|
76
|
+
() => {
|
|
77
|
+
console.log("WRITE COMPLETE!");
|
|
78
|
+
resolve();
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
);
|
package/gulpfile.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var gulp = require("gulp");
|
|
2
|
+
var fbuildscripts = require("@flashist/fbuildscripts");
|
|
3
|
+
|
|
4
|
+
// Importing all the build-scripts
|
|
5
|
+
var taskNames = Object.keys(fbuildscripts);
|
|
6
|
+
console.log("task names: ", taskNames);
|
|
7
|
+
var taskNamesCount = taskNames.length;
|
|
8
|
+
for (let taskNameIndex = 0; taskNameIndex < taskNamesCount; taskNameIndex++) {
|
|
9
|
+
var tempTaskName = taskNames[taskNameIndex];
|
|
10
|
+
gulp[tempTaskName] = tasks[tempTaskName];
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flashist/fconsole",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -25,21 +25,13 @@
|
|
|
25
25
|
],
|
|
26
26
|
"main": "index.js",
|
|
27
27
|
"typings": "index.d.ts",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "gulp",
|
|
30
|
-
"publish:patch": "npm version patch && npm run build && cd ./dist && npm publish",
|
|
31
|
-
"publish:minor": "npm version minor && npm run build && cd ./dist && npm publish",
|
|
32
|
-
"publish:major": "npm version major && npm run build && cd ./dist && npm publish"
|
|
33
|
-
},
|
|
28
|
+
"scripts": {},
|
|
34
29
|
"dependencies": {
|
|
35
|
-
"@flashist/flibs": "0.x"
|
|
30
|
+
"@flashist/flibs": "0.x",
|
|
31
|
+
"pixi.js": "6.x"
|
|
36
32
|
},
|
|
37
33
|
"devDependencies": {
|
|
38
|
-
"
|
|
39
|
-
"gulp-shell": "^0.8.0",
|
|
40
|
-
"pixi.js": "^5.3.3",
|
|
41
|
-
"require-dir": "^1.2.0",
|
|
42
|
-
"rimraf": "^3.0.2",
|
|
34
|
+
"@flashist/fbuildscripts": "0.x",
|
|
43
35
|
"typescript": "^4.0.2"
|
|
44
36
|
},
|
|
45
37
|
"bugs": {
|