Compare commits

...

124 Commits

Author SHA1 Message Date
62d1fe0a35 2.0.32 2024-12-04 23:04:17 +01:00
915bd67b6a fix(core): Minor improvements and dependency updates 2024-12-04 23:04:16 +01:00
9e0765ce0b 2.0.31 2024-12-04 23:02:57 +01:00
abde25211a fix(Watcher): Add missing logger message in Watcher class for start method 2024-12-04 23:02:57 +01:00
e8ae4c8341 2.0.30 2024-12-04 22:58:47 +01:00
dc6bb93349 fix(cli): Fix incorrect watch mode and update npm test command. 2024-12-04 22:58:46 +01:00
e2b154f392 2.0.29 2024-12-04 22:49:24 +01:00
993997d5fa fix(core): No changes detected in the codebase. 2024-12-04 22:49:24 +01:00
52e85d61cd remove compilation from git 2024-12-04 22:44:43 +01:00
b991f62af7 2.0.28 2024-12-04 22:04:42 +01:00
8ad26eb358 fix(tswatch): Add logging to notify folder watcher creation and building processes 2024-12-04 22:04:41 +01:00
de4d7d3a2d 2.0.27 2024-12-04 21:59:28 +01:00
f1f3465917 fix(core): Refactor watch mode commands and exports 2024-12-04 21:59:28 +01:00
a6441a3e3e 2.0.26 2024-12-04 21:58:33 +01:00
7611268fb9 fix(core): Refactor watch modes and update dependencies 2024-12-04 21:58:32 +01:00
95c57d489d 2.0.25 2024-10-27 19:00:53 +01:00
8ab28f582b fix(typescript): Remove unnecessary reference types in TypeScript declaration files 2024-10-27 19:00:53 +01:00
8ad3a21ed8 2.0.24 2024-10-27 18:58:20 +01:00
e94af8a1d4 fix(core): Remove .gitlab-ci.yml and update dependencies in package.json 2024-10-27 18:58:19 +01:00
71269a1820 2.0.23 2024-01-28 18:23:32 +01:00
f76a58a3a4 fix(core): update 2024-01-28 18:23:32 +01:00
d79c4d2eaa 2.0.22 2024-01-28 18:23:07 +01:00
5ea12b77e7 fix(core): update 2024-01-28 18:23:06 +01:00
0fbb18690a 2.0.21 2024-01-09 11:40:39 +01:00
adbc255bcd fix(core): update 2024-01-09 11:40:38 +01:00
16676d52da 2.0.20 2024-01-09 11:27:53 +01:00
89251ad3e7 fix(core): update 2024-01-09 11:27:52 +01:00
7e2a4725a5 2.0.19 2024-01-08 16:48:44 +01:00
f2c5cecbd3 fix(core): update 2024-01-08 16:48:43 +01:00
8139cb93b2 2.0.18 2024-01-08 16:40:58 +01:00
f107a157af fix(core): update 2024-01-08 16:40:57 +01:00
e0c2f8671d 2.0.17 2024-01-08 15:36:05 +01:00
c644337bf0 fix(core): update 2024-01-08 15:36:05 +01:00
405cad9002 2.0.16 2024-01-08 15:35:41 +01:00
a2af8cef07 fix(core): update 2024-01-08 15:35:41 +01:00
b1532fe23f 2.0.15 2024-01-08 14:44:50 +01:00
91cf04385d fix(core): update 2024-01-08 14:44:49 +01:00
1d5a37d0c0 2.0.14 2024-01-08 14:26:46 +01:00
9b383006c2 fix(core): update 2024-01-08 14:26:46 +01:00
7c918287f7 2.0.13 2023-09-21 00:49:15 +02:00
4a1443d2f4 fix(core): update 2023-09-21 00:49:14 +02:00
1d76d50bc3 2.0.12 2023-09-12 10:28:34 +02:00
4415d889b4 fix(core): update 2023-09-12 10:28:34 +02:00
404bdc9aac 2.0.11 2023-08-26 15:27:46 +02:00
f09289717a fix(core): update 2023-08-26 15:27:45 +02:00
ed3d76cf86 2.0.10 2023-08-26 15:11:20 +02:00
83e904bb3c fix(core): update 2023-08-26 15:11:19 +02:00
93b27f8e6a 2.0.9 2023-08-26 14:56:10 +02:00
c0bbe6ef68 fix(core): update 2023-08-26 14:56:09 +02:00
b11104bd74 2.0.8 2023-08-26 14:52:13 +02:00
f96024380a fix(core): update 2023-08-26 14:52:12 +02:00
cd5d50369e 2.0.7 2023-03-31 17:15:58 +02:00
d03ead86fd fix(core): update 2023-03-31 17:15:58 +02:00
66b1dc0a3f 2.0.6 2023-03-31 13:10:30 +02:00
5b8d6ee471 fix(core): update 2023-03-31 13:10:29 +02:00
eb993c20f2 2.0.5 2022-08-04 12:31:35 +02:00
6dc8009a32 fix(core): update 2022-08-04 12:31:35 +02:00
b0aeb19b5d 2.0.4 2022-08-04 12:18:43 +02:00
c0f85dd931 fix(core): update 2022-08-04 12:18:42 +02:00
4b08d321bc 2.0.3 2022-08-03 20:03:15 +02:00
a53b9f9aa6 fix(core): update 2022-08-03 20:03:15 +02:00
64a31e9812 2.0.2 2022-08-02 15:38:04 +02:00
776f993f6f fix(core): update 2022-08-02 15:38:04 +02:00
7481784a64 2.0.1 2022-05-04 18:41:07 +02:00
aa6649483a fix(core): update 2022-05-04 18:41:07 +02:00
65f778c40f 2.0.0 2022-05-04 17:26:37 +02:00
4204a61db9 BREAKING CHANGE(core): switch to gitzone v2 generation tools 2022-05-04 17:26:36 +02:00
181369ad3f 1.0.81 2022-04-22 09:25:57 +02:00
d5816b0ed8 fix(core): update 2022-04-22 09:25:57 +02:00
889643e233 1.0.80 2022-04-22 01:36:11 +02:00
1d3a2dcb64 fix(core): update 2022-04-22 01:36:11 +02:00
9688e3323d 1.0.79 2022-04-22 00:31:21 +02:00
6fa56e9be6 fix(core): update 2022-04-22 00:31:20 +02:00
15e9df5f4f 1.0.78 2022-04-21 23:41:45 +02:00
e0f8503b2b fix(core): update 2022-04-21 23:41:45 +02:00
1337a6ec25 1.0.77 2022-04-21 23:36:16 +02:00
bd36e3edf3 fix(core): update 2022-04-21 23:36:15 +02:00
89fae2edc9 1.0.76 2022-03-31 12:29:59 +02:00
82b09ad253 fix(core): update 2022-03-31 12:29:58 +02:00
57ce71cda3 1.0.75 2022-03-25 19:58:11 +01:00
b171a14c0a fix(core): update 2022-03-25 19:58:11 +01:00
63e0d7fe9e 1.0.74 2022-03-22 23:13:23 +01:00
e2bc505c41 1.0.73 2022-03-18 20:54:12 +01:00
af82480644 fix(core): update 2022-03-18 20:54:12 +01:00
27a08f11b7 1.0.72 2022-03-18 20:32:27 +01:00
073f978626 fix(core): update 2022-03-18 20:32:26 +01:00
8d7ab769e1 1.0.71 2022-03-18 20:32:00 +01:00
8ebc438e2d fix(core): update 2022-03-18 20:31:59 +01:00
d0d158ee87 1.0.70 2022-03-18 20:20:07 +01:00
3ada286495 fix(core): update 2022-03-18 20:20:07 +01:00
0514a74a07 1.0.69 2022-03-18 20:16:58 +01:00
587d08239a fix(core): update 2022-03-18 20:16:58 +01:00
7ee934eb46 1.0.68 2022-03-18 16:45:55 +01:00
ebcd8d4b51 1.0.67 2022-03-18 16:42:53 +01:00
27477253ee fix(core): update 2022-03-18 16:42:53 +01:00
9ed461e1e4 1.0.66 2022-03-18 16:36:13 +01:00
b854a161f3 fix(core): update 2022-03-18 16:36:13 +01:00
0598357010 1.0.65 2022-03-18 14:17:06 +01:00
9dae6dcda1 fix(core): update 2022-03-18 14:17:05 +01:00
4cf71d2edc 1.0.64 2022-03-18 13:18:15 +01:00
0eec0c04e8 fix(core): update 2022-03-18 13:18:15 +01:00
ef5d4d2a9c 1.0.63 2022-03-18 07:13:20 +01:00
f05481a267 fix(core): update 2022-03-18 07:13:20 +01:00
d66a88538a 1.0.62 2022-03-14 22:16:23 +01:00
1c1a110ca3 1.0.61 2022-03-14 22:04:11 +01:00
3f7790e8c8 fix(core): update 2022-03-14 22:04:11 +01:00
2018b27a4b 1.0.60 2022-03-14 21:17:36 +01:00
3b8ac18a6c fix(core): update 2022-03-14 21:17:36 +01:00
e36af800a3 1.0.59 2022-03-10 16:32:37 +01:00
76b810663f fix(core): update 2022-03-10 16:32:37 +01:00
9950661a36 1.0.58 2022-03-10 15:58:18 +01:00
6fa461aff5 fix(core): update 2022-03-10 15:58:17 +01:00
4ca73a77f9 1.0.57 2022-03-10 15:39:33 +01:00
2d4d243454 fix(core): update 2022-03-10 15:39:33 +01:00
f77f36312f 1.0.56 2021-08-18 18:55:44 +02:00
c508c85473 fix(core): update 2021-08-18 18:55:43 +02:00
50a0cadd11 1.0.55 2021-08-17 17:55:54 +02:00
d5cb794ea6 fix(core): update 2021-08-17 17:55:54 +02:00
3bb65bedf6 1.0.54 2021-07-26 21:44:35 +02:00
53147a8812 fix(core): update 2021-07-26 21:44:35 +02:00
c63a5f88d5 1.0.53 2021-07-26 21:42:52 +02:00
f039ace7bc fix(core): update 2021-07-26 21:42:51 +02:00
bbc34ad98b 1.0.52 2021-03-08 00:28:16 +00:00
c699954d08 fix(core): update 2021-03-08 00:28:15 +00:00
46 changed files with 9949 additions and 11826 deletions

View File

@@ -1,127 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- lossless
- docker
- notpriv
audit:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
tags:
- lossless
- docker
- notpriv
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

24
.vscode/launch.json vendored
View File

@@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

View File

@@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

119
changelog.md Normal file
View File

@@ -0,0 +1,119 @@
# Changelog
## 2024-12-04 - 2.0.32 - fix(core)
Minor improvements and dependency updates
- Updated dependencies for improved performance
- Refined TypeScript project watching logic
## 2024-12-04 - 2.0.31 - fix(Watcher)
Add missing logger message in Watcher class for start method
- Added a log message when starting a watcher to track file path being watched
## 2024-12-04 - 2.0.30 - fix(cli)
Fix incorrect watch mode and update npm test command.
- Updated the npm test command in .vscode/launch.json for streamlined launching.
- Corrected the watch mode from 'echoSomething' to 'echo' in test/test.ts.
## 2024-12-04 - 2.0.29 - fix(core)
No changes detected in the codebase.
## 2024-12-04 - 2.0.28 - fix(tswatch)
Add logging to notify folder watcher creation and building processes
- Logging added to notify the creation of folder watchers.
- Logging added to indicate the start of the building process for folders.
## 2024-12-04 - 2.0.27 - fix(core)
Refactor watch mode commands and exports
- Updated watch mode names in CLI and type definitions for consistency.
- Added export for smartfile plugin.
- Ensured updated command logic is applied during CLI operations.
## 2024-12-04 - 2.0.26 - fix(core)
Refactor watch modes and update dependencies
- Updated dependencies in package.json
- Refactored watch mode names in interfaces and classes
- Refactored CLI commands to use new watch mode names
- Added import for smartfile in tswatch.plugins.ts
## 2024-10-27 - 2.0.25 - fix(typescript)
Remove unnecessary reference types in TypeScript declaration files
- Removed unnecessary comment line from TypeScript declaration files.
## 2024-10-27 - 2.0.24 - fix(core)
Remove .gitlab-ci.yml and update dependencies in package.json
- Deleted .gitlab-ci.yml which contained CI/CD configuration settings.
- Updated various dependencies and devDependencies in package.json to newer versions.
## 2024-01-28 to 2024-01-09 - 2.0.14 to 2.0.23 - Core
Several updates to the core functionality.
- Updated core functionality for efficiency and stability.
## 2023-09-21 to 2023-01-28 - 2.0.8 to 2.0.13 - Core
Core system updates and fixes.
- Continuous updates to core functionality for improved performance.
## 2023-03-31 to 2022-08-04 - 2.0.0 to 2.0.7 - Core
Enhanced core operations.
- Regular core updates to address performance and reliability.
## 2022-05-04 - 1.0.81 - Core
Introduction of a breaking change in the core system.
- Switched to gitzone v2 generation tools.
## 2022-04-21 to 2022-03-18 - 1.0.62 to 1.0.80 - Core
Routine updates to core operations.
- Various core fixes enhancing stability and function.
## 2022-03-14 to 2022-03-18 - 1.0.61 to 1.0.75 - Core
Further adjustments to core functionality.
- Fixes across multiple modules in core.
## 2021-08-17 to 2020-07-07 - 1.0.46 to 1.0.60 - Core
Core component updates.
- Consistent core updates to refine performance.
## 2020-07-04 to 2020-05-22 - 1.0.39 to 1.0.45 - Core
Incremental updates to core systems.
- Enhanced features within the core for better integration.
## 2020-03-13 to 2020-03-05 - 1.0.30 to 1.0.38 - Core
Stabilizing and refining core functions.
- Series of core fixes improving overall system durability.
## 2019-10-14 to 2019-10-12 - 1.0.21 to 1.0.29 - Core
Tweaks and enhancements to the core mechanics.
- Continued improvements in core system support services.
## 2019-05-28 to 2019-05-06 - 1.0.10 to 1.0.20 - Core
Core module enhancements and fixes.
- Several iterations to the core functionality for increased resilience.
## 2019-05-06 to 2019-05-08 - 1.0.5 to 1.0.9 - Core
Regular updates ensuring core integrity.
- Stability improvements within the core services.
## 2018-10-28 - 1.0.1 to 1.0.3 - Core
Initial setup and fixes to the core.
- Foundational updates to core functionality.

4
cli.child.ts Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
process.env.CLI_CALL = 'true';
import * as cliTool from './ts/index.js';
cliTool.runCli();

2
cli.js
View File

@@ -1,4 +1,4 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL = 'true'; process.env.CLI_CALL = 'true';
const cliTool = require('./dist_ts/index'); const cliTool = await import('./dist_ts/index.js');
cliTool.runCli(); cliTool.runCli();

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL = 'true'; process.env.CLI_CALL = 'true';
require('@gitzone/tsrun');
const cliTool = require('./ts/index'); import * as tsrun from '@git.zone/tsrun';
cliTool.runCli(); tsrun.runPath('./cli.child.js', import.meta.url);

2
dist_ts/index.d.ts vendored
View File

@@ -1,2 +0,0 @@
export * from './tswatch.classes.tswatch';
export * from './tswatch.cli';

View File

@@ -1,30 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
const early = __importStar(require("@pushrocks/early"));
early.start('tswatch');
__exportStar(require("./tswatch.classes.tswatch"), exports);
__exportStar(require("./tswatch.cli"), exports);
early.stop();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSx3REFBMEM7QUFDMUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUN2Qiw0REFBMEM7QUFDMUMsZ0RBQThCO0FBQzlCLEtBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyJ9

View File

@@ -1 +0,0 @@
export * from './interfaces.watchmodes';

View File

@@ -1,14 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./interfaces.watchmodes"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLDBEQUF3QyJ9

View File

@@ -1 +0,0 @@
export declare type TWatchModes = 'test' | 'gitzone_npm' | 'gitzone_service' | 'gitzone_element' | 'gitzone_website' | 'echoSomething';

View File

@@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy53YXRjaG1vZGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvaW50ZXJmYWNlcy9pbnRlcmZhY2VzLndhdGNobW9kZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

View File

@@ -1,3 +0,0 @@
export declare class Parcel {
start(): Promise<void>;
}

View File

@@ -1,44 +0,0 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = __importStar(require("./tswatch.plugins"));
const paths = __importStar(require("./tswatch.paths"));
class Parcel {
async start() {
const entryFiles = plugins.path.join(paths.cwd, './html/index.html');
// Bundler options
const options = {
outDir: './dist_watch',
outFile: 'index.html',
publicUrl: '/',
watch: true,
cache: true,
cacheDir: '.nogit/.parcelcache',
contentHash: false,
global: 'moduleName',
minify: false,
scopeHoist: false,
target: 'browser',
bundleNodeModules: true,
https: null,
logLevel: 3,
hmr: true,
hmrPort: 3003,
sourceMaps: true,
hmrHostname: '',
detailedReport: false // Prints a detailed report of the bundles, assets, filesizes and times, defaults to false, reports are only printed if watch is disabled
};
const bundler = new plugins.parcel(entryFiles, options);
// Run the bundler, this returns the main bundle
// Use the events if you're using watch mode as this promise will only trigger once and not for every rebuild
const bundle = await bundler.serve(3002);
}
}
exports.Parcel = Parcel;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLnBhcmNlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rzd2F0Y2guY2xhc3Nlcy5wYXJjZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsMkR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@@ -1,17 +0,0 @@
import * as plugins from './tswatch.plugins';
import * as interfaces from './interfaces';
import { Watcher } from './tswatch.classes.watcher';
export declare class TsWatch {
watchmode: interfaces.TWatchModes;
watcherMap: plugins.lik.ObjectMap<Watcher>;
smartserve: plugins.smartserve.SmartServe;
constructor(watchmodeArg: interfaces.TWatchModes);
/**
* starts the TsWatch instance
*/
start(): Promise<void>;
/**
* stops the execution of any active Watchers
*/
stop(): Promise<void>;
}

View File

@@ -1,104 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TsWatch = void 0;
const plugins = __importStar(require("./tswatch.plugins"));
const paths = __importStar(require("./tswatch.paths"));
const tswatch_classes_watcher_1 = require("./tswatch.classes.watcher");
class TsWatch {
constructor(watchmodeArg) {
this.watcherMap = new plugins.lik.ObjectMap();
this.watchmode = watchmodeArg;
}
/**
* starts the TsWatch instance
*/
async start() {
switch (this.watchmode) {
case 'test':
this.watcherMap.add(new tswatch_classes_watcher_1.Watcher({
filePathToWatch: paths.cwd,
commandToExecute: 'npm run test2',
timeout: null,
}));
break;
case 'gitzone_npm':
this.watcherMap.add(new tswatch_classes_watcher_1.Watcher({
filePathToWatch: paths.cwd,
commandToExecute: 'npm run test',
timeout: null,
}));
break;
case 'gitzone_element':
// lets create a standard server
console.log('bundling TypeScript files to "dist_watch" Note: This is for development only!');
const parcel = new plugins.smartparcel.Parcel(plugins.path.join(process.cwd(), './html/index.html'), plugins.path.join(process.cwd(), './dist_watch'), 'index.html');
await parcel.start();
break;
case 'gitzone_website':
this.watcherMap.add(new tswatch_classes_watcher_1.Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
commandToExecute: 'npm run startTs',
timeout: null,
}));
// client directory
const parcelWebsite = new plugins.smartparcel.Parcel(plugins.path.join(process.cwd(), './ts_web/index.ts'), plugins.path.join(process.cwd(), './dist_serve'), 'bundle.js');
await parcelWebsite.start();
break;
case 'gitzone_service':
this.watcherMap.add(new tswatch_classes_watcher_1.Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
commandToExecute: 'npm run startTs',
timeout: null,
}));
break;
case 'echoSomething':
const tsWatchInstanceEchoSomething = new tswatch_classes_watcher_1.Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts'),
commandToExecute: 'npm -v',
timeout: null,
});
this.watcherMap.add(tsWatchInstanceEchoSomething);
break;
default:
break;
}
this.watcherMap.forEach(async (watcher) => {
await watcher.start();
});
if (this.smartserve) {
await this.smartserve.start();
}
}
/**
* stops the execution of any active Watchers
*/
async stop() {
if (this.smartserve) {
await this.smartserve.stop();
}
this.watcherMap.forEach(async (watcher) => {
await watcher.stop();
});
}
}
exports.TsWatch = TsWatch;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLnRzd2F0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c3dhdGNoLmNsYXNzZXMudHN3YXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkRBQTZDO0FBQzdDLHVEQUF5QztBQUd6Qyx1RUFBb0Q7QUFFcEQsTUFBYSxPQUFPO0lBS2xC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0,0 @@
export declare type TCommandFunction = () => Promise<void>;
export interface IWatcherConstructorOptions {
filePathToWatch: string;
commandToExecute: string | TCommandFunction;
timeout?: number;
}
/**
* A watcher keeps track of one child execution
*/
export declare class Watcher {
/**
* used to execute shell commands
*/
private smartshellInstance;
private currentExecution;
private smartchokWatcher;
private options;
constructor(optionsArg: IWatcherConstructorOptions);
/**
* start the file
*/
start(): Promise<void>;
/**
* updates the current execution
*/
private updateCurrentExecution;
/**
* this method sets up a clean exit strategy
*/
private setupCleanup;
/**
* stops the watcher
*/
stop(): Promise<void>;
}

View File

@@ -1,112 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Watcher = void 0;
const plugins = __importStar(require("./tswatch.plugins"));
const tswatch_logging_1 = require("./tswatch.logging");
/**
* A watcher keeps track of one child execution
*/
class Watcher {
constructor(optionsArg) {
/**
* used to execute shell commands
*/
this.smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
});
this.smartchokWatcher = new plugins.smartchok.Smartchok([], {});
this.options = optionsArg;
}
/**
* start the file
*/
async start() {
await this.setupCleanup();
console.log(`Looking at ${this.options.filePathToWatch} for changes`);
this.smartchokWatcher.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file
await this.smartchokWatcher.start();
const changeObservable = await this.smartchokWatcher.getObservableFor('change');
changeObservable.subscribe(() => {
this.updateCurrentExecution();
});
await this.updateCurrentExecution();
}
/**
* updates the current execution
*/
async updateCurrentExecution() {
if (typeof this.options.commandToExecute === 'string') {
if (this.currentExecution) {
tswatch_logging_1.logger.log('ok', `reexecuting ${this.options.commandToExecute}`);
this.currentExecution.kill();
}
else {
tswatch_logging_1.logger.log('ok', `executing ${this.options.commandToExecute} for the first time`);
}
this.currentExecution = await this.smartshellInstance.execStreaming(this.options.commandToExecute);
}
else {
console.log('cannot run execution task');
}
}
/**
* this method sets up a clean exit strategy
*/
async setupCleanup() {
const cleanup = () => {
if (this.currentExecution) {
process.kill(-this.currentExecution.childProcess.pid);
}
};
process.on('exit', () => {
console.log('');
console.log('now exiting!');
cleanup();
process.exit(0);
});
process.on('SIGINT', () => {
console.log('');
console.log('ok! got SIGINT We are exiting! Just cleaning up to exit neatly :)');
cleanup();
process.exit(0);
});
// handle timeout
if (this.options.timeout) {
plugins.smartdelay.delayFor(this.options.timeout).then(() => {
console.log(`timed out afer ${this.options.timeout} milliseconds! exiting!`);
cleanup();
process.exit(0);
});
}
}
/**
* stops the watcher
*/
async stop() {
await this.smartchokWatcher.stop();
if (this.currentExecution && !this.currentExecution.childProcess.killed) {
process.kill(-this.currentExecution.childProcess.pid);
}
}
}
exports.Watcher = Watcher;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLndhdGNoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c3dhdGNoLmNsYXNzZXMud2F0Y2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkRBQTZDO0FBQzdDLHVEQUEyQztBQVUzQzs7R0FFRztBQUNILE1BQWEsT0FBTztJQVlsQixZQUFZLFVBQXNDO1FBWGxEOztXQUVHO1FBQ0ssd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TSxFQUFFO1lBQ3ZFLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsWUFBWSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQ3ZEO0lBQ0gsQ0FBQztDQUNGO0FBM0ZELDBCQTJGQyJ9

View File

@@ -1 +0,0 @@
export declare const runCli: () => Promise<void>;

View File

@@ -1,56 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCli = void 0;
const plugins = __importStar(require("./tswatch.plugins"));
const tswatch_logging_1 = require("./tswatch.logging");
const tswatch_classes_tswatch_1 = require("./tswatch.classes.tswatch");
const tswatchCli = new plugins.smartcli.Smartcli();
// standard behaviour will assume gitzone setup
tswatchCli.addCommand('element').subscribe(async (argvArg) => {
tswatch_logging_1.logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new tswatch_classes_tswatch_1.TsWatch('gitzone_element');
await tsWatch.start();
});
tswatchCli.addCommand('npm').subscribe(async (argvArg) => {
tswatch_logging_1.logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new tswatch_classes_tswatch_1.TsWatch('gitzone_npm');
await tsWatch.start();
});
tswatchCli.addCommand('service').subscribe(async (argvArg) => {
tswatch_logging_1.logger.log('info', `running test task`);
const tsWatch = new tswatch_classes_tswatch_1.TsWatch('gitzone_service');
await tsWatch.start();
});
tswatchCli.addCommand('test').subscribe(async (argvArg) => {
tswatch_logging_1.logger.log('info', `running test task`);
const tsWatch = new tswatch_classes_tswatch_1.TsWatch('test');
await tsWatch.start();
});
tswatchCli.addCommand('website').subscribe(async (argvArg) => {
tswatch_logging_1.logger.log('info', `running watch task for a gitzone website project`);
const tsWatch = new tswatch_classes_tswatch_1.TsWatch('gitzone_website');
await tsWatch.start();
});
exports.runCli = async () => {
tswatchCli.startParse();
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c3dhdGNoLmNsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkRBQTZDO0FBRTdDLHVEQUEyQztBQUUzQyx1RUFBb0Q7QUFFcEQsTUFBTSxVQUFVLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO0FBRW5ELCtDQUErQztBQUUvQyxVQUFVLENBQUMsVUFBVSxDQUFDLFNBQVMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLEVBQUU7SUFDM0Qsd0JBQU0sQ0FBQyxHQUFHLENBQUMsTUFBTSxFQUFFLGtEQUFrRCxDQUFDLENBQUM7SUFDdkUsTUFBTSxPQUFPLEdBQUcsSUFBSSxpQ0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7SUFDL0MsTUFBTSxPQUFPLENBQUMsS0FBSyxFQUFFLENBQUM7QUFDeEIsQ0FBQyxDQUFDLENBQUM7QUFFSCxVQUFVLENBQUMsVUFBVSxDQUFDLEtBQUssQ0FBQyxDQUFDLFNBQVMsQ0FBQyxLQUFLLEVBQUUsT0F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tELENBQUMsQ0FBQztJQUN2RSxNQUFNLE9BQU8sR0FBRyxJQUFJLGlDQUFPLENBQUMsaUJBQWlCLENBQUMsQ0FBQztJQUMvQyxNQUFNLE9BQU8sQ0FBQyxLQUFLLEVBQUUsQ0FBQztBQUN4QixDQUFDLENBQUMsQ0FBQztBQUVVLFFBQUEsTUFBTSxHQUFHLEtBQUssSUFBSSxFQUFFO0lBQy9CLFVBQVUsQ0FBQyxVQUFVLEVBQUUsQ0FBQztBQUMxQixDQUFDLENBQUMifQ==

View File

@@ -1,2 +0,0 @@
import * as plugins from './tswatch.plugins';
export declare const logger: plugins.smartlog.Smartlog;

View File

@@ -1,36 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.logger = void 0;
const plugins = __importStar(require("./tswatch.plugins"));
exports.logger = new plugins.smartlog.Smartlog({
logContext: {
company: 'Some Company',
companyunit: 'Some CompanyUnit',
containerName: 'Some Containername',
environment: 'local',
runtime: 'node',
zone: 'gitzone',
},
minimumLogLevel: 'silly',
});
exports.logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5sb2dnaW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHN3YXRjaC5sb2dnaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyREFBNkM7QUFFaEMsUUFBQSxNQUFNLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFFBQVEsQ0FBQztJQUNsRCxVQUFVLEVBQUU7UUFDVixPQUFPLEVBQUUsY0FBYztRQUN2QixXQUFXLEVBQUUsa0JBQWtCO1FBQy9CLGFBQWEsRUFBRSxvQkFBb0I7UUFDbkMsV0FBVyxFQUFFLE9BQU87UUFDcEIsT0FBTyxFQUFFLE1BQU07UUFDZixJQUFJLEVBQUUsU0FBUztLQUNoQjtJQUNELGVBQWUsRUFBRSxPQUFPO0NBQ3pCLENBQUMsQ0FBQztBQUVILGNBQU0sQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLE9BQU8sQ0FBQyx3QkFBd0IsQ0FBQyxnQkFBZ0IsRUFBRSxDQUFDLENBQUMifQ==

View File

@@ -1 +0,0 @@
export declare const cwd: string;

View File

@@ -1,5 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cwd = void 0;
exports.cwd = process.cwd();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rzd2F0Y2gucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRWEsUUFBQSxHQUFHLEdBQUcsT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDIn0=

View File

@@ -1,13 +0,0 @@
import * as path from 'path';
export { path };
import * as lik from '@pushrocks/lik';
import * as smartchok from '@pushrocks/smartchok';
import * as smartcli from '@pushrocks/smartcli';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartlog from '@pushrocks/smartlog';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
import * as smartparcel from '@pushrocks/smartparcel';
import * as smartserve from '@pushrocks/smartserve';
import * as smartshell from '@pushrocks/smartshell';
import * as taskbuffer from '@pushrocks/taskbuffer';
export { lik, smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartparcel, smartserve, smartshell, taskbuffer, };

View File

@@ -1,46 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.taskbuffer = exports.smartshell = exports.smartserve = exports.smartparcel = exports.smartlogDestinationLocal = exports.smartlog = exports.smartdelay = exports.smartcli = exports.smartchok = exports.lik = exports.path = void 0;
const path = __importStar(require("path"));
exports.path = path;
// @pushrocks scope
const lik = __importStar(require("@pushrocks/lik"));
exports.lik = lik;
const smartchok = __importStar(require("@pushrocks/smartchok"));
exports.smartchok = smartchok;
const smartcli = __importStar(require("@pushrocks/smartcli"));
exports.smartcli = smartcli;
const smartdelay = __importStar(require("@pushrocks/smartdelay"));
exports.smartdelay = smartdelay;
const smartlog = __importStar(require("@pushrocks/smartlog"));
exports.smartlog = smartlog;
const smartlogDestinationLocal = __importStar(require("@pushrocks/smartlog-destination-local"));
exports.smartlogDestinationLocal = smartlogDestinationLocal;
const smartparcel = __importStar(require("@pushrocks/smartparcel"));
exports.smartparcel = smartparcel;
const smartserve = __importStar(require("@pushrocks/smartserve"));
exports.smartserve = smartserve;
const smartshell = __importStar(require("@pushrocks/smartshell"));
exports.smartshell = smartshell;
const taskbuffer = __importStar(require("@pushrocks/taskbuffer"));
exports.taskbuffer = taskbuffer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHN3YXRjaC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBNkI7QUFDcEIsb0JBQUk7QUFFYixtQkFBbUI7QUFDbkIsb0RBQXNDO0FBWXBDLGtCQUFHO0FBWEwsZ0VBQWtEO0FBWWhELDhCQUFTO0FBWFgsOERBQWdEO0FBWTlDLDRCQUFRO0FBWFYsa0VBQW9EO0FBWWxELGdDQUFVO0FBWFosOERBQWdEO0FBWTlDLDRCQUFRO0FBWFYsZ0dBQWtGO0FBWWhGLDREQUF3QjtBQVgxQixvRUFBc0Q7QUFZcEQsa0NBQVc7QUFYYixrRUFBb0Q7QUFZbEQsZ0NBQVU7QUFYWixrRUFBb0Q7QUFZbEQsZ0NBQVU7QUFYWixrRUFBb0Q7QUFZbEQsZ0NBQVUifQ==

View File

@@ -10,7 +10,7 @@
"gitscope": "gitzone", "gitscope": "gitzone",
"gitrepo": "tswatch", "gitrepo": "tswatch",
"shortDescription": "watch typescript projects during development", "shortDescription": "watch typescript projects during development",
"npmPackagename": "@gitzone/tswatch", "npmPackagename": "@git.zone/tswatch",
"license": "MIT" "license": "MIT"
} }
} }

11012
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,11 @@
{ {
"name": "@gitzone/tswatch", "name": "@git.zone/tswatch",
"version": "1.0.51", "version": "2.0.32",
"private": false, "private": false,
"description": "watch typescript projects during development", "description": "watch typescript projects during development",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -12,29 +13,28 @@
}, },
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@git.zone/tsbuild": "^2.2.0",
"@gitzone/tstest": "^1.0.33", "@git.zone/tstest": "^1.0.90",
"@pushrocks/tapbundle": "^3.2.1", "@push.rocks/tapbundle": "^5.5.3",
"@types/node": "^14.0.19", "@types/node": "^22.10.1"
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@gitzone/tsrun": "^1.2.12", "@api.global/typedserver": "^3.0.51",
"@pushrocks/early": "^3.0.3", "@git.zone/tsbundle": "^2.1.0",
"@pushrocks/lik": "^4.0.13", "@git.zone/tsrun": "^1.3.3",
"@pushrocks/smartchok": "^1.0.23", "@push.rocks/early": "^4.0.4",
"@pushrocks/smartcli": "^3.0.12", "@push.rocks/lik": "^6.1.0",
"@pushrocks/smartdelay": "^2.0.9", "@push.rocks/smartchok": "^1.0.34",
"@pushrocks/smartlog": "^2.0.35", "@push.rocks/smartcli": "^4.0.11",
"@pushrocks/smartlog-destination-local": "^8.0.8", "@push.rocks/smartdelay": "^3.0.5",
"@pushrocks/smartparcel": "^1.0.9", "@push.rocks/smartfile": "^11.0.21",
"@pushrocks/smartserve": "^1.1.41", "@push.rocks/smartlog": "^3.0.7",
"@pushrocks/smartshell": "^2.0.26", "@push.rocks/smartlog-destination-local": "^9.0.2",
"@pushrocks/taskbuffer": "^2.1.1" "@push.rocks/smartshell": "^3.0.6",
"@push.rocks/taskbuffer": "^3.1.7"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@@ -47,5 +47,8 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"browserslist": [
"last 1 chrome versions"
] ]
} }

9561
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

0
readme.hints.md Normal file
View File

View File

@@ -1,8 +1,8 @@
# @gitzone/tswatch # @git.zone/tswatch
watch typescript projects during development watch typescript projects during development
## Availabililty and Links ## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tswatch) * [npmjs.org (npm package)](https://www.npmjs.com/package/@git.zone/tswatch)
* [gitlab.com (source)](https://gitlab.com/gitzone/tswatch) * [gitlab.com (source)](https://gitlab.com/gitzone/tswatch)
* [github.com (source mirror)](https://github.com/gitzone/tswatch) * [github.com (source mirror)](https://github.com/gitzone/tswatch)
* [docs (typedoc)](https://gitzone.gitlab.io/tswatch/) * [docs (typedoc)](https://gitzone.gitlab.io/tswatch/)
@@ -13,14 +13,14 @@ Status Category | Status Badge
-- | -- -- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/gitzone/tswatch/badges/master/pipeline.svg)](https://lossless.cloud) GitLab Pipelines | [![pipeline status](https://gitlab.com/gitzone/tswatch/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/gitzone/tswatch/badges/master/coverage.svg)](https://lossless.cloud) GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/gitzone/tswatch/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@gitzone/tswatch)](https://lossless.cloud) npm | [![npm downloads per month](https://badgen.net/npm/dy/@git.zone/tswatch)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/gitzone/tswatch)](https://lossless.cloud) Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/gitzone/tswatch)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@gitzone/tswatch)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@git.zone/tswatch)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@gitzone/tswatch)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@git.zone/tswatch)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@gitzone/tswatch)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@git.zone/tswatch)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage

View File

@@ -1,11 +1,11 @@
// tslint:disable-next-line: no-implicit-dependencies // tslint:disable-next-line: no-implicit-dependencies
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as tswatch from '../ts/index'; import * as tswatch from '../ts/index.js';
let testTsWatchInstance: tswatch.TsWatch; let testTsWatchInstance: tswatch.TsWatch;
tap.test('should create a valid TsWatch instance', async () => { tap.test('should create a valid TsWatch instance', async () => {
testTsWatchInstance = new tswatch.TsWatch('echoSomething'); testTsWatchInstance = new tswatch.TsWatch('echo');
}); });
tap.test('should start the tswatch instance', async () => { tap.test('should start the tswatch instance', async () => {

8
ts/00_commitinfo_data.ts Normal file
View File

@@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@git.zone/tswatch',
version: '2.0.32',
description: 'watch typescript projects during development'
}

View File

@@ -1,5 +1,5 @@
import * as early from '@pushrocks/early'; import * as early from '@push.rocks/early';
early.start('tswatch'); early.start('tswatch');
export * from './tswatch.classes.tswatch'; export * from './tswatch.classes.tswatch.js';
export * from './tswatch.cli'; export * from './tswatch.cli.js';
early.stop(); early.stop();

View File

@@ -1 +1 @@
export * from './interfaces.watchmodes'; export * from './interfaces.watchmodes.js';

View File

@@ -1,7 +1,7 @@
export type TWatchModes = export type TWatchModes =
| 'test' | 'test'
| 'gitzone_npm' | 'node'
| 'gitzone_service' | 'service'
| 'gitzone_element' | 'element'
| 'gitzone_website' | 'website'
| 'echoSomething'; | 'echo';

View File

@@ -1,13 +1,14 @@
import * as plugins from './tswatch.plugins'; import * as plugins from './tswatch.plugins.js';
import * as paths from './tswatch.paths'; import * as paths from './tswatch.paths.js';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces/index.js';
import { Watcher } from './tswatch.classes.watcher'; import { Watcher } from './tswatch.classes.watcher.js';
import { logger } from './tswatch.logging.js';
export class TsWatch { export class TsWatch {
public watchmode: interfaces.TWatchModes; public watchmode: interfaces.TWatchModes;
public watcherMap = new plugins.lik.ObjectMap<Watcher>(); public watcherMap = new plugins.lik.ObjectMap<Watcher>();
public smartserve: plugins.smartserve.SmartServe; public typedserver: plugins.typedserver.TypedServer;
constructor(watchmodeArg: interfaces.TWatchModes) { constructor(watchmodeArg: interfaces.TWatchModes) {
this.watchmode = watchmodeArg; this.watchmode = watchmodeArg;
@@ -17,8 +18,13 @@ export class TsWatch {
* starts the TsWatch instance * starts the TsWatch instance
*/ */
public async start() { public async start() {
const tsbundle = new plugins.tsbundle.TsBundle();
const htmlHandler = new plugins.tsbundle.HtmlHandler();
switch (this.watchmode) { switch (this.watchmode) {
case 'test': case 'test':
/**
* this strategy runs test whenever there is a change in the ts directory
*/
this.watcherMap.add( this.watcherMap.add(
new Watcher({ new Watcher({
filePathToWatch: paths.cwd, filePathToWatch: paths.cwd,
@@ -27,7 +33,7 @@ export class TsWatch {
}) })
); );
break; break;
case 'gitzone_npm': case 'node':
this.watcherMap.add( this.watcherMap.add(
new Watcher({ new Watcher({
filePathToWatch: paths.cwd, filePathToWatch: paths.cwd,
@@ -36,36 +42,128 @@ export class TsWatch {
}) })
); );
break; break;
case 'gitzone_element': case 'element':
(async () => {
/**
* this strategy runs a standard server and bundles the ts files to a dist_watch directory
*/
// lets create a standard server // lets create a standard server
console.log( console.log(
'bundling TypeScript files to "dist_watch" Note: This is for development only!' 'bundling TypeScript files to "dist_watch" Note: This is for development only!'
); );
const parcel = new plugins.smartparcel.Parcel( this.typedserver = new plugins.typedserver.TypedServer({
plugins.path.join(process.cwd(), './html/index.html'), cors: true,
plugins.path.join(process.cwd(), './dist_watch'), injectReload: true,
'index.html' serveDir: plugins.path.join(paths.cwd, './dist_watch/'),
); port: 3002,
await parcel.start(); enableCompression: true,
break; preferredCompressionMethod: 'gzip',
case 'gitzone_website': });
const bundleAndReloadElement = async () => {
await tsbundle.build(paths.cwd, './html/index.ts', './dist_watch/bundle.js', {
bundler: 'esbuild',
});
await this.typedserver.reload();
};
this.watcherMap.add( this.watcherMap.add(
new Watcher({ new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts/'), filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
commandToExecute: 'npm run startTs', functionToCall: async () => {
await bundleAndReloadElement();
},
timeout: null, timeout: null,
}) })
); );
// client directory // lets get the other ts folders
const parcelWebsite = new plugins.smartparcel.Parcel( let tsfolders = await plugins.smartfile.fs.listFolders(paths.cwd);
plugins.path.join(process.cwd(), './ts_web/index.ts'), tsfolders = tsfolders.filter(
plugins.path.join(process.cwd(), './dist_serve'), (itemArg) => itemArg.startsWith('ts') && itemArg !== 'ts_web'
'bundle.js'
); );
await parcelWebsite.start(); const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
});
for (const tsfolder of tsfolders) {
logger.log('info', `creating watcher for folder ${tsfolder}`);
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, `./${tsfolder}/`),
functionToCall: async () => {
logger.log('info', `building ${tsfolder}`);
await smartshellInstance.exec(`(cd ${paths.cwd} && npm run build)`);
await this.typedserver.reload();
},
timeout: null,
})
);
}
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './html/'),
functionToCall: async () => {
await htmlHandler.processHtml({
from: plugins.path.join(paths.cwd, './html/index.html'),
to: plugins.path.join(paths.cwd, './dist_watch/index.html'),
minify: false,
});
await bundleAndReloadElement();
},
timeout: null,
})
);
})();
break; break;
case 'gitzone_service': case 'website':
(async () => {
const bundleAndReloadWebsite = async () => {
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', {
bundler: 'esbuild',
});
};
let tsfolders = await plugins.smartfile.fs.listFolders(paths.cwd);
tsfolders = tsfolders.filter(
(itemArg) => itemArg.startsWith('ts') && itemArg !== 'ts_web'
);
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
});
for (const tsfolder of tsfolders) {
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, `./${tsfolder}/`),
commandToExecute: `npm run startTs`,
timeout: null,
})
);
}
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
functionToCall: async () => {
await bundleAndReloadWebsite();
},
timeout: null,
})
);
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './html/'),
functionToCall: async () => {
await htmlHandler.processHtml({
from: plugins.path.join(paths.cwd, './html/index.html'),
to: plugins.path.join(paths.cwd, './dist_serve/index.html'),
minify: false,
});
await bundleAndReloadWebsite();
},
timeout: null,
})
);
})();
break;
case 'service':
this.watcherMap.add( this.watcherMap.add(
new Watcher({ new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts/'), filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
@@ -74,7 +172,7 @@ export class TsWatch {
}) })
); );
break; break;
case 'echoSomething': case 'echo':
const tsWatchInstanceEchoSomething = new Watcher({ const tsWatchInstanceEchoSomething = new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts'), filePathToWatch: plugins.path.join(paths.cwd, './ts'),
commandToExecute: 'npm -v', commandToExecute: 'npm -v',
@@ -88,8 +186,8 @@ export class TsWatch {
this.watcherMap.forEach(async (watcher) => { this.watcherMap.forEach(async (watcher) => {
await watcher.start(); await watcher.start();
}); });
if (this.smartserve) { if (this.typedserver) {
await this.smartserve.start(); await this.typedserver.start();
} }
} }
@@ -97,8 +195,8 @@ export class TsWatch {
* stops the execution of any active Watchers * stops the execution of any active Watchers
*/ */
public async stop() { public async stop() {
if (this.smartserve) { if (this.typedserver) {
await this.smartserve.stop(); await this.typedserver.stop();
} }
this.watcherMap.forEach(async (watcher) => { this.watcherMap.forEach(async (watcher) => {
await watcher.stop(); await watcher.stop();

View File

@@ -1,11 +1,10 @@
import * as plugins from './tswatch.plugins'; import * as plugins from './tswatch.plugins.js';
import { logger } from './tswatch.logging'; import { logger } from './tswatch.logging.js';
export type TCommandFunction = () => Promise<void>;
export interface IWatcherConstructorOptions { export interface IWatcherConstructorOptions {
filePathToWatch: string; filePathToWatch: string;
commandToExecute: string | TCommandFunction; commandToExecute?: string;
functionToCall?: () => Promise<any>;
timeout?: number; timeout?: number;
} }
@@ -21,7 +20,7 @@ export class Watcher {
}); });
private currentExecution: plugins.smartshell.IExecResultStreaming; private currentExecution: plugins.smartshell.IExecResultStreaming;
private smartchokWatcher = new plugins.smartchok.Smartchok([], {}); private smartchokWatcher = new plugins.smartchok.Smartchok([]);
private options: IWatcherConstructorOptions; private options: IWatcherConstructorOptions;
constructor(optionsArg: IWatcherConstructorOptions) { constructor(optionsArg: IWatcherConstructorOptions) {
@@ -32,6 +31,7 @@ export class Watcher {
* start the file * start the file
*/ */
public async start() { public async start() {
logger.log('info', `trying to start watcher for ${this.options.filePathToWatch}`);
await this.setupCleanup(); await this.setupCleanup();
console.log(`Looking at ${this.options.filePathToWatch} for changes`); console.log(`Looking at ${this.options.filePathToWatch} for changes`);
this.smartchokWatcher.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file this.smartchokWatcher.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file
@@ -41,13 +41,14 @@ export class Watcher {
this.updateCurrentExecution(); this.updateCurrentExecution();
}); });
await this.updateCurrentExecution(); await this.updateCurrentExecution();
logger.log('info', `watcher started for ${this.options.filePathToWatch}`);
} }
/** /**
* updates the current execution * updates the current execution
*/ */
private async updateCurrentExecution() { private async updateCurrentExecution() {
if (typeof this.options.commandToExecute === 'string') { if (this.options.commandToExecute) {
if (this.currentExecution) { if (this.currentExecution) {
logger.log('ok', `reexecuting ${this.options.commandToExecute}`); logger.log('ok', `reexecuting ${this.options.commandToExecute}`);
this.currentExecution.kill(); this.currentExecution.kill();
@@ -58,7 +59,12 @@ export class Watcher {
this.options.commandToExecute this.options.commandToExecute
); );
} else { } else {
console.log('cannot run execution task'); console.log('no executionCommand set');
}
if (this.options.functionToCall) {
this.options.functionToCall();
} else {
console.log('no functionToCall set.')
} }
} }
@@ -66,21 +72,16 @@ export class Watcher {
* this method sets up a clean exit strategy * this method sets up a clean exit strategy
*/ */
private async setupCleanup() { private async setupCleanup() {
const cleanup = () => {
if (this.currentExecution) {
process.kill(-this.currentExecution.childProcess.pid);
}
};
process.on('exit', () => { process.on('exit', () => {
console.log(''); console.log('');
console.log('now exiting!'); console.log('now exiting!');
cleanup(); this.stop();
process.exit(0); process.exit(0);
}); });
process.on('SIGINT', () => { process.on('SIGINT', () => {
console.log(''); console.log('');
console.log('ok! got SIGINT We are exiting! Just cleaning up to exit neatly :)'); console.log('ok! got SIGINT We are exiting! Just cleaning up to exit neatly :)');
cleanup(); this.stop();
process.exit(0); process.exit(0);
}); });
@@ -88,7 +89,7 @@ export class Watcher {
if (this.options.timeout) { if (this.options.timeout) {
plugins.smartdelay.delayFor(this.options.timeout).then(() => { plugins.smartdelay.delayFor(this.options.timeout).then(() => {
console.log(`timed out afer ${this.options.timeout} milliseconds! exiting!`); console.log(`timed out afer ${this.options.timeout} milliseconds! exiting!`);
cleanup(); this.stop();
process.exit(0); process.exit(0);
}); });
} }
@@ -100,7 +101,7 @@ export class Watcher {
public async stop() { public async stop() {
await this.smartchokWatcher.stop(); await this.smartchokWatcher.stop();
if (this.currentExecution && !this.currentExecution.childProcess.killed) { if (this.currentExecution && !this.currentExecution.childProcess.killed) {
process.kill(-this.currentExecution.childProcess.pid); this.currentExecution.kill();
} }
} }
} }

View File

@@ -1,28 +1,31 @@
import * as plugins from './tswatch.plugins'; import * as plugins from './tswatch.plugins.js';
import * as paths from './tswatch.paths'; import * as paths from './tswatch.paths.js';
import { logger } from './tswatch.logging'; import { logger } from './tswatch.logging.js';
import { TsWatch } from './tswatch.classes.tswatch'; import { TsWatch } from './tswatch.classes.tswatch.js';
const tswatchCli = new plugins.smartcli.Smartcli(); const tswatchCli = new plugins.smartcli.Smartcli();
// standard behaviour will assume gitzone setup // standard behaviour will assume gitzone setup
tswatchCli.standardCommand().subscribe((argvArg => {
tswatchCli.triggerCommand('npm', {});
}))
tswatchCli.addCommand('element').subscribe(async (argvArg) => { tswatchCli.addCommand('element').subscribe(async (argvArg) => {
logger.log('info', `running watch task for a gitzone element project`); logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new TsWatch('gitzone_element'); const tsWatch = new TsWatch('element');
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.addCommand('npm').subscribe(async (argvArg) => { tswatchCli.addCommand('npm').subscribe(async (argvArg) => {
logger.log('info', `running watch task for a gitzone element project`); logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new TsWatch('gitzone_npm'); const tsWatch = new TsWatch('node');
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.addCommand('service').subscribe(async (argvArg) => { tswatchCli.addCommand('service').subscribe(async (argvArg) => {
logger.log('info', `running test task`); logger.log('info', `running test task`);
const tsWatch = new TsWatch('gitzone_service'); const tsWatch = new TsWatch('service');
await tsWatch.start(); await tsWatch.start();
}); });
@@ -34,7 +37,7 @@ tswatchCli.addCommand('test').subscribe(async (argvArg) => {
tswatchCli.addCommand('website').subscribe(async (argvArg) => { tswatchCli.addCommand('website').subscribe(async (argvArg) => {
logger.log('info', `running watch task for a gitzone website project`); logger.log('info', `running watch task for a gitzone website project`);
const tsWatch = new TsWatch('gitzone_website'); const tsWatch = new TsWatch('website');
await tsWatch.start(); await tsWatch.start();
}); });

View File

@@ -1,4 +1,4 @@
import * as plugins from './tswatch.plugins'; import * as plugins from './tswatch.plugins.js';
export const logger = new plugins.smartlog.Smartlog({ export const logger = new plugins.smartlog.Smartlog({
logContext: { logContext: {

View File

@@ -1,3 +1,3 @@
import * as plugins from './tswatch.plugins'; import * as plugins from './tswatch.plugins.js';
export const cwd = process.cwd(); export const cwd = process.cwd();

View File

@@ -1,27 +1,39 @@
// node native scope
import * as path from 'path'; import * as path from 'path';
export { path }; export { path };
// @gitzone scope
import * as tsbundle from '@git.zone/tsbundle';
export {
tsbundle
}
// @apiglobal scope
import * as typedserver from '@api.global/typedserver';
export {
typedserver,
}
// @pushrocks scope // @pushrocks scope
import * as lik from '@pushrocks/lik'; import * as lik from '@push.rocks/lik';
import * as smartchok from '@pushrocks/smartchok'; import * as smartchok from '@push.rocks/smartchok';
import * as smartcli from '@pushrocks/smartcli'; import * as smartcli from '@push.rocks/smartcli';
import * as smartdelay from '@pushrocks/smartdelay'; import * as smartdelay from '@push.rocks/smartdelay';
import * as smartlog from '@pushrocks/smartlog'; import * as smartfile from '@push.rocks/smartfile';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local'; import * as smartlog from '@push.rocks/smartlog';
import * as smartparcel from '@pushrocks/smartparcel'; import * as smartlogDestinationLocal from '@push.rocks/smartlog-destination-local';
import * as smartserve from '@pushrocks/smartserve'; import * as smartshell from '@push.rocks/smartshell';
import * as smartshell from '@pushrocks/smartshell'; import * as taskbuffer from '@push.rocks/taskbuffer';
import * as taskbuffer from '@pushrocks/taskbuffer';
export { export {
lik, lik,
smartchok, smartchok,
smartcli, smartcli,
smartdelay, smartdelay,
smartfile,
smartlog, smartlog,
smartlogDestinationLocal, smartlogDestinationLocal,
smartparcel,
smartserve,
smartshell, smartshell,
taskbuffer, taskbuffer,
}; };

14
tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

View File

@@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}