@nsshunt/stsui 1.9.21 → 1.9.23

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/package.json CHANGED
@@ -1,9 +1,24 @@
1
1
  {
2
2
  "name": "@nsshunt/stsui",
3
- "version": "1.9.21",
3
+ "version": "1.9.23",
4
4
  "description": "",
5
- "main": "dist/index.js",
5
+ "main": "dist/stsui.umd.js",
6
+ "module": "./dist/stsui.mjs",
6
7
  "types": "./types/index.d.ts",
8
+ "type": "commonjs",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/stsui.mjs",
12
+ "require": "./dist/stsui.umd.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "types"
18
+ ],
19
+ "standard": {
20
+ "parser": "@babel/eslint-parser"
21
+ },
7
22
  "scripts": {
8
23
  "lint": "eslint . --ext js,jsx,ts,tsx",
9
24
  "lintex": "eslint . --ext js,jsx,ts,tsx --fix",
@@ -12,9 +27,6 @@
12
27
  "build": "tsc && vite build",
13
28
  "build2": "tsc"
14
29
  },
15
- "standard": {
16
- "parser": "@babel/eslint-parser"
17
- },
18
30
  "repository": {
19
31
  "type": "git",
20
32
  "url": "git+https://github.com/nsshunt/stsui.git"
package/.eslintrc.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "es2021": true,
5
- "node": true,
6
- "jest": true
7
- },
8
- "extends": [
9
- "eslint:recommended",
10
- "plugin:@typescript-eslint/recommended"
11
- ],
12
- "parser": "@typescript-eslint/parser",
13
- "parserOptions": {
14
- "ecmaVersion": "latest",
15
- "sourceType": "module"
16
- },
17
- "plugins": [
18
- "@typescript-eslint"
19
- ],
20
- "ignorePatterns": ["temp.js", "**/k6scripts/*.js", "**/public/*", "**/dist/*", "**/types/*"],
21
- "rules": {
22
- "indent": ["error", 4],
23
- "no-mixed-spaces-and-tabs": [2],
24
- "@typescript-eslint/no-var-requires": "warn"
25
- }
26
- }
@@ -1,11 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: "npm" # See documentation for possible values
9
- directory: "/" # Location of package manifests
10
- schedule:
11
- interval: "monthly"
@@ -1,56 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
- push:
10
- branches: [ main ]
11
- pull_request:
12
- branches: [ main ]
13
-
14
- jobs:
15
- build:
16
- runs-on: ubuntu-latest
17
- steps:
18
- - uses: actions/checkout@v3
19
- - uses: actions/setup-node@v3
20
- with:
21
- node-version: 19
22
- - run: npm ci
23
- - run: npm run lint
24
- - run: npm test
25
-
26
- publish-npm:
27
- needs: build
28
- runs-on: ubuntu-latest
29
- steps:
30
- - uses: actions/checkout@v3
31
- - uses: actions/setup-node@v3
32
- with:
33
- node-version: 19
34
- registry-url: https://registry.npmjs.org/
35
- - run: npm ci
36
- - run: npm run build
37
- - run: npm publish --access public
38
- env:
39
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
40
-
41
- # publish-gpr:
42
- # needs: build
43
- # runs-on: ubuntu-latest
44
- # permissions:
45
- # contents: read
46
- # packages: write
47
- # steps:
48
- # - uses: actions/checkout@v2
49
- # - uses: actions/setup-node@v2
50
- # with:
51
- # node-version: 17
52
- # registry-url: https://npm.pkg.github.com/
53
- # - run: npm ci
54
- # - run: npm publish
55
- # env:
56
- # NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/babel.config.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env", {"targets": {"node": "current"}}],
4
- "@babel/preset-typescript"
5
- ]
6
- }
package/build.sh DELETED
@@ -1,29 +0,0 @@
1
- #!/bin/sh
2
- rm -rf dist
3
- rm -rf types
4
- npm run build
5
- RESULT=$?
6
- if [ $RESULT -eq 0 ]; then
7
- echo success build
8
- npm run lint
9
- RESULT=$?
10
- if [ $RESULT -eq 0 ]; then
11
- echo success lint
12
- npm run test
13
- RESULT=$?
14
- if [ $RESULT -eq 0 ]; then
15
- echo success test
16
- git commit -a -m "changed"
17
- npm version patch
18
- npm i
19
- git commit -a -m "changed"
20
- git push
21
- else
22
- echo failed test
23
- fi
24
- else
25
- echo failed lint
26
- fi
27
- else
28
- echo failed build
29
- fi
@@ -1,4 +0,0 @@
1
- // Normally, this would be set for all test cases however, this module we actually test the
2
- // environment vars themselves. See each test code for details.
3
-
4
- //process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
package/jest.config.js DELETED
@@ -1,197 +0,0 @@
1
- /*
2
- * For a detailed explanation regarding each configuration property, visit:
3
- * https://jestjs.io/docs/configuration
4
- */
5
-
6
- module.exports = {
7
- setupFiles: ['./jest/setEnvVars.js'],
8
-
9
- // All imported modules in your tests should be mocked automatically
10
- // automock: false,
11
-
12
- // Stop running tests after `n` failures
13
- // bail: 0,
14
-
15
- // The directory where Jest should store its cached dependency information
16
- // cacheDirectory: "/tmp/jest_rs",
17
-
18
- // Automatically clear mock calls, instances and results before every test
19
- // clearMocks: false,
20
-
21
- // Indicates whether the coverage information should be collected while executing the test
22
- // collectCoverage: false,
23
-
24
- // An array of glob patterns indicating a set of files for which coverage information should be collected
25
- // collectCoverageFrom: undefined,
26
-
27
- // The directory where Jest should output its coverage files
28
- // coverageDirectory: undefined,
29
-
30
- // An array of regexp pattern strings used to skip coverage collection
31
- // coveragePathIgnorePatterns: [
32
- // "/node_modules/"
33
- // ],
34
-
35
- // Indicates which provider should be used to instrument code for coverage
36
- // coverageProvider: "v8",
37
-
38
- // A list of reporter names that Jest uses when writing coverage reports
39
- // coverageReporters: [
40
- // "json",
41
- // "text",
42
- // "lcov",
43
- // "clover"
44
- // ],
45
-
46
- // An object that configures minimum threshold enforcement for coverage results
47
- // coverageThreshold: undefined,
48
-
49
- // A path to a custom dependency extractor
50
- // dependencyExtractor: undefined,
51
-
52
- // Make calling deprecated APIs throw helpful error messages
53
- // errorOnDeprecated: false,
54
-
55
- // Force coverage collection from ignored files using an array of glob patterns
56
- // forceCoverageMatch: [],
57
-
58
- // A path to a module which exports an async function that is triggered once before all test suites
59
- // globalSetup: undefined,
60
-
61
- // A path to a module which exports an async function that is triggered once after all test suites
62
- // globalTeardown: undefined,
63
-
64
- // A set of global variables that need to be available in all test environments
65
- // globals: {},
66
-
67
- // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
68
- // maxWorkers: "50%",
69
-
70
- // An array of directory names to be searched recursively up from the requiring module's location
71
- // moduleDirectories: [
72
- // "node_modules"
73
- // ],
74
-
75
- // An array of file extensions your modules use
76
- // moduleFileExtensions: [
77
- // "js",
78
- // "jsx",
79
- // "ts",
80
- // "tsx",
81
- // "json",
82
- // "node"
83
- // ],
84
-
85
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
86
- // moduleNameMapper: {},
87
-
88
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
89
- // modulePathIgnorePatterns: [],
90
-
91
- // Activates notifications for test results
92
- // notify: false,
93
-
94
- // An enum that specifies notification mode. Requires { notify: true }
95
- // notifyMode: "failure-change",
96
-
97
- // A preset that is used as a base for Jest's configuration
98
- // preset: undefined,
99
-
100
- // Run tests from one or more projects
101
- // projects: undefined,
102
-
103
- // Use this configuration option to add custom reporters to Jest
104
- // reporters: undefined,
105
-
106
- // Automatically reset mock state before every test
107
- // resetMocks: false,
108
-
109
- // Reset the module registry before running each individual test
110
- // resetModules: false,
111
-
112
- // A path to a custom resolver
113
- // resolver: undefined,
114
-
115
- // Automatically restore mock state and implementation before every test
116
- // restoreMocks: false,
117
-
118
- // The root directory that Jest should scan for tests and modules within
119
- // rootDir: undefined,
120
-
121
- // A list of paths to directories that Jest should use to search for files in
122
- // roots: [
123
- // "<rootDir>"
124
- // ],
125
-
126
- // Allows you to use a custom runner instead of Jest's default test runner
127
- // runner: "jest-runner",
128
-
129
- // The paths to modules that run some code to configure or set up the testing environment before each test
130
- // setupFiles: [],
131
-
132
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
133
- // setupFilesAfterEnv: [],
134
-
135
- // The number of seconds after which a test is considered as slow and reported as such in the results.
136
- // slowTestThreshold: 5,
137
-
138
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
139
- // snapshotSerializers: [],
140
-
141
- // The test environment that will be used for testing
142
- // testEnvironment: "jest-environment-node",
143
-
144
- // Options that will be passed to the testEnvironment
145
- // testEnvironmentOptions: {},
146
-
147
- // Adds a location field to test results
148
- // testLocationInResults: false,
149
-
150
- // The glob patterns Jest uses to detect test files
151
- // testMatch: [
152
- // "**/__tests__/**/*.[jt]s?(x)",
153
- // "**/?(*.)+(spec|test).[tj]s?(x)"
154
- // ],
155
-
156
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
157
- testPathIgnorePatterns: [
158
- "/node_modules/",
159
- "/dist/"
160
- ],
161
-
162
- // The regexp pattern or array of patterns that Jest uses to detect test files
163
- // testRegex: [],
164
-
165
- // This option allows the use of a custom results processor
166
- // testResultsProcessor: undefined,
167
-
168
- // This option allows use of a custom test runner
169
- // testRunner: "jest-circus/runner",
170
-
171
- // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
172
- // testURL: "http://localhost",
173
-
174
- // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
175
- // timers: "real",
176
-
177
- // A map from regular expressions to paths to transformers
178
- // transform: undefined,
179
-
180
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
181
- // transformIgnorePatterns: [
182
- // "/node_modules/",
183
- // "\\.pnp\\.[^\\/]+$"
184
- // ],
185
-
186
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
187
- // unmockedModulePathPatterns: undefined,
188
-
189
- // Indicates whether each individual test should be reported during the run
190
- // verbose: undefined,
191
-
192
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
193
- // watchPathIgnorePatterns: [],
194
-
195
- // Whether to use watchman for file crawling
196
- // watchman: true,
197
- };
package/src/blessed.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module 'blessed';
package/src/index.ts DELETED
@@ -1,96 +0,0 @@
1
- // STS blessed type wrapper (MVP wrapper)
2
- export type callback = () => void
3
-
4
- export interface node {
5
- //get(prop: string): any; // string, panel or blessed element
6
- get<T>(prop: string): string | T | element; // string, panel or blessed element
7
- //set(prop: string, value: any): void; // prop = 'id'(a string uuid) | 'panel'(a sts panel type) | the widget name (widget being a blessed element)
8
- set<T>(prop: string, value: string | T | element): void; // prop = 'id'(a string uuid) | 'panel'(a sts panel type) | the widget name (widget being a blessed element)
9
- }
10
-
11
- export interface element extends node {
12
- top: number
13
- left: number
14
- width: number
15
- height: number
16
- //data: any // panel - same as node.get('panel')
17
- setIndex(index: number): void
18
- append(element: element): void
19
- show(): void
20
- hide(): void
21
- setContent(content: string): void
22
- //on(event: string, listener: (...args: any[]) => void): this
23
- on(event: string, listener: () => void): this
24
- position: {
25
- top: number
26
- left: number
27
- width: number
28
- height: number
29
- }
30
- }
31
-
32
- export interface screen extends node {
33
- width: number
34
- height: number
35
- title: string
36
- render(): void
37
- destroy(): void
38
- remove(elem: element): void
39
- key(keys: string[], cb: callback): void
40
- //on(event: string, listener: (...args: any[]) => void): this
41
- on(event: string, listener: () => void): this
42
- }
43
-
44
- export type box = element
45
-
46
- export interface listbar extends box {
47
- commands: {
48
- keys: string[],
49
- callback(): void
50
- }
51
- }
52
-
53
- export interface style {
54
- fg?: string
55
- bg?: string
56
- item?: {
57
- hover: {
58
- fg?: string
59
- bg?: string
60
- }
61
- }
62
- selected?: {
63
- fg?: string
64
- bg?: string
65
- }
66
- }
67
-
68
- export interface command {
69
- keys: string[],
70
- callback(): void
71
- }
72
-
73
- export interface elementOptions {
74
- top?: number
75
- bottom?: number
76
- left?: number
77
- right?: number,
78
- width?: string | number
79
- height?: string | number
80
- keys?: boolean,
81
- mouse?: boolean,
82
- scrollable?: boolean,
83
- scrollbar?: {
84
- style: style
85
- },
86
- tags?: boolean
87
- ch?: string,
88
- filled?: number
89
- parent?: screen,
90
- autoCommandKeys?: boolean,
91
- style?: style
92
- commands?: Record<string, command>
93
- }
94
-
95
- export * from './stsuiframe'
96
- export * from './menubar'
package/src/menubar.ts DELETED
@@ -1,70 +0,0 @@
1
- import blessed from 'blessed';
2
- import * as stsBlessed from './index'
3
-
4
- export interface menuitem {
5
- text: string,
6
- key: string,
7
- cb(): void
8
- }
9
-
10
- export interface MenuBarOptions {
11
- top: boolean
12
- menuitems: menuitem[]
13
- }
14
-
15
- export class MenuBar
16
- {
17
- private listb:stsBlessed.listbar | null = null;
18
-
19
- // options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }
20
- constructor(screen: stsBlessed.screen, options: MenuBarOptions) {
21
- const compoptions: stsBlessed.elementOptions = {
22
- parent: screen,
23
- left: 0,
24
- right: 0,
25
- height: 1,
26
- width: 'shrink',
27
- mouse: true,
28
- keys: true,
29
- autoCommandKeys: true,
30
- scrollable: true,
31
- style: {
32
- fg: 'yellow',
33
- bg: 'blue',
34
-
35
- item: {
36
- hover: {
37
- fg: 'white',
38
- bg: 'green',
39
- }
40
- },
41
- selected: {
42
- fg: 'black',
43
- bg: 'yellow',
44
- }
45
- }
46
- }
47
- if (options.top === true) {
48
- compoptions.top = 0;
49
- } else {
50
- compoptions.bottom = 0;
51
- }
52
-
53
- compoptions.commands = { };
54
- options.menuitems.forEach((menuItem) => {
55
- if (compoptions.commands) {
56
- compoptions.commands[menuItem.text] = {
57
- keys: [ menuItem.key ],
58
- callback: menuItem.cb
59
- }
60
- }
61
- })
62
-
63
- this.listb = blessed.listbar(compoptions);
64
- }
65
-
66
- get listbar()
67
- {
68
- return this.listb;
69
- }
70
- }
@@ -1,10 +0,0 @@
1
- describe("Test", () =>
2
- {
3
- test('Testing Module', async () =>
4
- {
5
- expect.assertions(1);
6
- expect(1).toEqual(1);
7
- });
8
- });
9
-
10
- export {}