BREAKING CHANGE(core): switch to esm

This commit is contained in:
Philipp Kunz 2022-10-19 19:27:42 +02:00
parent 7067826a4e
commit 451daec7b4
19 changed files with 4303 additions and 11517 deletions

View File

@ -12,40 +12,36 @@ stages:
- release
- metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
- npmci command pnpm audit --audit-level=high --prod
tags:
- lossless
- docker
allow_failure: true
auditDevDependencies:
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 --only=dev
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
@ -56,7 +52,6 @@ auditDevDependencies:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
@ -67,7 +62,6 @@ testStable:
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
@ -96,10 +90,9 @@ codequality:
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
@ -119,11 +112,9 @@ trigger:
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${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"
"type": "node-terminal"
}
]
}

View File

@ -5,7 +5,7 @@
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartdaemon",
"shortDescription": "start scripts as long running daemons and manage them",
"description": "start scripts as long running daemons and manage them",
"npmPackagename": "@pushrocks/smartdaemon",
"license": "MIT",
"projectDomain": "push.rocks"

11436
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,24 +9,24 @@
"license": "MIT",
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web)",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.10",
"@types/node": "^14.14.22",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.11.2"
},
"dependencies": {
"@pushrocks/lik": "^4.0.20",
"@pushrocks/smartfile": "^8.0.8",
"@pushrocks/lik": "^6.0.0",
"@pushrocks/smartfile": "^10.0.5",
"@pushrocks/smartfm": "^2.0.4",
"@pushrocks/smartlog": "^2.0.39",
"@pushrocks/smartlog": "^3.0.1",
"@pushrocks/smartlog-destination-local": "^8.0.8",
"@pushrocks/smartpath": "^5.0.5",
"@pushrocks/smartshell": "^2.0.26",
"@pushrocks/smartsystem": "^2.0.9"
"@pushrocks/smartsystem": "^3.0.1"
},
"files": [
"ts/**/*",
@ -42,5 +42,6 @@
],
"browserslist": [
"last 1 chrome versions"
]
],
"type": "module"
}

4216
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,9 @@ Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20W
## Usage
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
## Contribution

5
test/plugins.ts Normal file
View File

@ -0,0 +1,5 @@
import * as smartpath from '@pushrocks/smartpath';
export {
smartpath
};

View File

@ -1,11 +1,16 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdaemon from '../ts/index';
import * as plugins from './plugins.js';
import * as smartdaemon from '../ts/index.js';
let testSmartdaemon: smartdaemon.SmartDaemon;
tap.test('should create an instance of smartdaemon', async () => {
testSmartdaemon = new smartdaemon.SmartDaemon();
expect(testSmartdaemon).to.be.instanceOf(smartdaemon.SmartDaemon);
expect(testSmartdaemon).toBeInstanceOf(smartdaemon.SmartDaemon);
});
tap.test('should create a service', async () => {
@ -14,7 +19,7 @@ tap.test('should create a service', async () => {
version: 'x.x.x',
command: 'npm -v',
description: 'displays the npm version',
workingDir: __dirname,
workingDir: plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
});
});

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartdaemon',
version: '2.0.0',
description: 'start scripts as long running daemons and manage them'
}

View File

@ -1 +1 @@
export * from './smartdaemon.classes.smartdaemon';
export * from './smartdaemon.classes.smartdaemon.js';

View File

@ -1,6 +1,6 @@
import * as plugins from './smartdaemon.plugins';
import * as paths from './smartdaemon.paths';
import { SmartDaemon } from './smartdaemon.classes.smartdaemon';
import * as plugins from './smartdaemon.plugins.js';
import * as paths from './smartdaemon.paths.js';
import { SmartDaemon } from './smartdaemon.classes.smartdaemon.js';
export interface ISmartDaemonServiceConstructorOptions {
name: string;

View File

@ -1,10 +1,10 @@
import * as plugins from './smartdaemon.plugins';
import { SmartDaemonTemplateManager } from './smartdaemon.classes.templatemanager';
import * as plugins from './smartdaemon.plugins.js';
import { SmartDaemonTemplateManager } from './smartdaemon.classes.templatemanager.js';
import {
SmartDaemonService,
ISmartDaemonServiceConstructorOptions,
} from './smartdaemon.classes.service';
import { SmartDaemonSystemdManager } from './smartdaemon.classes.systemdmanager';
} from './smartdaemon.classes.service.js';
import { SmartDaemonSystemdManager } from './smartdaemon.classes.systemdmanager.js';
export class SmartDaemon {
public templateManager: SmartDaemonTemplateManager;

View File

@ -1,10 +1,10 @@
import * as plugins from './smartdaemon.plugins';
import * as paths from './smartdaemon.paths';
import { SmartDaemon } from './smartdaemon.classes.smartdaemon';
import * as plugins from './smartdaemon.plugins.js';
import * as paths from './smartdaemon.paths.js';
import { SmartDaemon } from './smartdaemon.classes.smartdaemon.js';
import {
ISmartDaemonServiceConstructorOptions,
SmartDaemonService,
} from './smartdaemon.classes.service';
} from './smartdaemon.classes.service.js';
export class SmartDaemonSystemdManager {
// STATIC

View File

@ -1,6 +1,6 @@
import * as plugins from './smartdaemon.plugins';
import { SmartDaemon } from './smartdaemon.classes.smartdaemon';
import { SmartDaemonService } from './smartdaemon.classes.service';
import * as plugins from './smartdaemon.plugins.js';
import { SmartDaemon } from './smartdaemon.classes.smartdaemon.js';
import { SmartDaemonService } from './smartdaemon.classes.service.js';
export class SmartDaemonTemplateManager {
public smartdaemonRef: SmartDaemon;

View File

@ -1,4 +1,4 @@
import * as plugins from './smartdaemon.plugins';
import * as plugins from './smartdaemon.plugins.js';
export const packageDir = plugins.path.join(__dirname, '../');
export const packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), '../');
export const systemdDir = plugins.path.join('/lib/systemd/system/');

View File

@ -9,9 +9,10 @@ import * as smartfile from '@pushrocks/smartfile';
import * as smartfm from '@pushrocks/smartfm';
import * as smartlog from '@pushrocks/smartlog';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
import * as smartpath from '@pushrocks/smartpath';
import * as smartshell from '@pushrocks/smartshell';
import * as smartsystem from '@pushrocks/smartsystem';
export { lik, smartfile, smartfm, smartlog, smartlogDestinationLocal, smartshell, smartsystem };
export { lik, smartfile, smartfm, smartlog, smartlogDestinationLocal, smartpath, smartshell, smartsystem };
// third party

View File

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

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}