@nsshunt/stsui 1.5.4 → 1.6.2

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/.eslintrc.json CHANGED
@@ -5,19 +5,26 @@
5
5
  "node": true,
6
6
  "jest": true
7
7
  },
8
- "extends": "eslint:recommended",
9
- "parser": "@babel/eslint-parser",
8
+ "extends": [
9
+ "eslint:recommended",
10
+ "plugin:@typescript-eslint/recommended"
11
+ ],
12
+ "parser": "@typescript-eslint/parser",
10
13
  "parserOptions": {
11
- "ecmaVersion": 12,
12
- "sourceType": "module",
13
- "babelOptions": {
14
- "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-private-methods"]
15
- }
14
+ "ecmaVersion": "latest",
15
+ "sourceType": "module"
16
16
  },
17
- "ignorePatterns": ["temp.js", "**/k6scripts/*.js", "**/public/*"],
17
+ "plugins": [
18
+ "@typescript-eslint"
19
+ ],
20
+ "ignorePatterns": ["temp.js", "**/k6scripts/*.js", "**/public/*", "**/dist/*"],
18
21
  "rules": {
19
22
  "indent": ["error", "tab"],
20
23
  //"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
21
- "no-mixed-spaces-and-tabs": 0 // disable rule
24
+ "no-mixed-spaces-and-tabs": 0, // disable rule
25
+ "@typescript-eslint/no-var-requires": "warn"
26
+ },
27
+ "globals": {
28
+ "$stsapp": true
22
29
  }
23
30
  }
@@ -33,6 +33,7 @@ jobs:
33
33
  node-version: 17
34
34
  registry-url: https://registry.npmjs.org/
35
35
  - run: npm ci
36
+ - run: npm run build
36
37
  - run: npm publish --access public
37
38
  env:
38
39
  NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -0,0 +1,6 @@
1
+ {
2
+ "presets": [
3
+ ["@babel/preset-env", {"targets": {"node": "current"}}],
4
+ "@babel/preset-typescript"
5
+ ]
6
+ }
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./stsuiframe"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
@@ -0,0 +1,4 @@
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
+ //process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
4
+ //# sourceMappingURL=setEnvVars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setEnvVars.js","sourceRoot":"","sources":["../../jest/setEnvVars.js"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,+DAA+D;AAE/D,0EAA0E"}
@@ -0,0 +1,143 @@
1
+ /*
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+ module.exports = {
6
+ setupFiles: ['./jest/setEnvVars.js'],
7
+ // All imported modules in your tests should be mocked automatically
8
+ // automock: false,
9
+ // Stop running tests after `n` failures
10
+ // bail: 0,
11
+ // The directory where Jest should store its cached dependency information
12
+ // cacheDirectory: "/tmp/jest_rs",
13
+ // Automatically clear mock calls, instances and results before every test
14
+ // clearMocks: false,
15
+ // Indicates whether the coverage information should be collected while executing the test
16
+ // collectCoverage: false,
17
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
18
+ // collectCoverageFrom: undefined,
19
+ // The directory where Jest should output its coverage files
20
+ // coverageDirectory: undefined,
21
+ // An array of regexp pattern strings used to skip coverage collection
22
+ // coveragePathIgnorePatterns: [
23
+ // "/node_modules/"
24
+ // ],
25
+ // Indicates which provider should be used to instrument code for coverage
26
+ // coverageProvider: "v8",
27
+ // A list of reporter names that Jest uses when writing coverage reports
28
+ // coverageReporters: [
29
+ // "json",
30
+ // "text",
31
+ // "lcov",
32
+ // "clover"
33
+ // ],
34
+ // An object that configures minimum threshold enforcement for coverage results
35
+ // coverageThreshold: undefined,
36
+ // A path to a custom dependency extractor
37
+ // dependencyExtractor: undefined,
38
+ // Make calling deprecated APIs throw helpful error messages
39
+ // errorOnDeprecated: false,
40
+ // Force coverage collection from ignored files using an array of glob patterns
41
+ // forceCoverageMatch: [],
42
+ // A path to a module which exports an async function that is triggered once before all test suites
43
+ // globalSetup: undefined,
44
+ // A path to a module which exports an async function that is triggered once after all test suites
45
+ // globalTeardown: undefined,
46
+ // A set of global variables that need to be available in all test environments
47
+ // globals: {},
48
+ // 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.
49
+ // maxWorkers: "50%",
50
+ // An array of directory names to be searched recursively up from the requiring module's location
51
+ // moduleDirectories: [
52
+ // "node_modules"
53
+ // ],
54
+ // An array of file extensions your modules use
55
+ // moduleFileExtensions: [
56
+ // "js",
57
+ // "jsx",
58
+ // "ts",
59
+ // "tsx",
60
+ // "json",
61
+ // "node"
62
+ // ],
63
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
64
+ // moduleNameMapper: {},
65
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
66
+ // modulePathIgnorePatterns: [],
67
+ // Activates notifications for test results
68
+ // notify: false,
69
+ // An enum that specifies notification mode. Requires { notify: true }
70
+ // notifyMode: "failure-change",
71
+ // A preset that is used as a base for Jest's configuration
72
+ // preset: undefined,
73
+ // Run tests from one or more projects
74
+ // projects: undefined,
75
+ // Use this configuration option to add custom reporters to Jest
76
+ // reporters: undefined,
77
+ // Automatically reset mock state before every test
78
+ // resetMocks: false,
79
+ // Reset the module registry before running each individual test
80
+ // resetModules: false,
81
+ // A path to a custom resolver
82
+ // resolver: undefined,
83
+ // Automatically restore mock state and implementation before every test
84
+ // restoreMocks: false,
85
+ // The root directory that Jest should scan for tests and modules within
86
+ // rootDir: undefined,
87
+ // A list of paths to directories that Jest should use to search for files in
88
+ // roots: [
89
+ // "<rootDir>"
90
+ // ],
91
+ // Allows you to use a custom runner instead of Jest's default test runner
92
+ // runner: "jest-runner",
93
+ // The paths to modules that run some code to configure or set up the testing environment before each test
94
+ // setupFiles: [],
95
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
96
+ // setupFilesAfterEnv: [],
97
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
98
+ // slowTestThreshold: 5,
99
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
100
+ // snapshotSerializers: [],
101
+ // The test environment that will be used for testing
102
+ // testEnvironment: "jest-environment-node",
103
+ // Options that will be passed to the testEnvironment
104
+ // testEnvironmentOptions: {},
105
+ // Adds a location field to test results
106
+ // testLocationInResults: false,
107
+ // The glob patterns Jest uses to detect test files
108
+ // testMatch: [
109
+ // "**/__tests__/**/*.[jt]s?(x)",
110
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
111
+ // ],
112
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
113
+ testPathIgnorePatterns: [
114
+ "/node_modules/",
115
+ "/dist/"
116
+ ],
117
+ // The regexp pattern or array of patterns that Jest uses to detect test files
118
+ // testRegex: [],
119
+ // This option allows the use of a custom results processor
120
+ // testResultsProcessor: undefined,
121
+ // This option allows use of a custom test runner
122
+ // testRunner: "jest-circus/runner",
123
+ // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
124
+ // testURL: "http://localhost",
125
+ // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
126
+ // timers: "real",
127
+ // A map from regular expressions to paths to transformers
128
+ // transform: undefined,
129
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
130
+ // transformIgnorePatterns: [
131
+ // "/node_modules/",
132
+ // "\\.pnp\\.[^\\/]+$"
133
+ // ],
134
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
135
+ // unmockedModulePathPatterns: undefined,
136
+ // Indicates whether each individual test should be reported during the run
137
+ // verbose: undefined,
138
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
139
+ // watchPathIgnorePatterns: [],
140
+ // Whether to use watchman for file crawling
141
+ // watchman: true,
142
+ };
143
+ //# sourceMappingURL=jest.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,OAAO,GAAG;IAChB,UAAU,EAAE,CAAC,sBAAsB,CAAC;IAEpC,oEAAoE;IACpE,mBAAmB;IAEnB,wCAAwC;IACxC,WAAW;IAEX,0EAA0E;IAC1E,kCAAkC;IAElC,0EAA0E;IAC1E,qBAAqB;IAErB,0FAA0F;IAC1F,0BAA0B;IAE1B,yGAAyG;IACzG,kCAAkC;IAElC,4DAA4D;IAC5D,gCAAgC;IAEhC,sEAAsE;IACtE,gCAAgC;IAChC,qBAAqB;IACrB,KAAK;IAEL,0EAA0E;IAC1E,2BAA2B;IAE3B,wEAAwE;IACxE,uBAAuB;IACvB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,KAAK;IAEL,+EAA+E;IAC/E,gCAAgC;IAEhC,0CAA0C;IAC1C,kCAAkC;IAElC,4DAA4D;IAC5D,4BAA4B;IAE5B,+EAA+E;IAC/E,0BAA0B;IAE1B,mGAAm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wBAAwB;IAExB,4HAA4H;IAC5H,6BAA6B;IAC7B,sBAAsB;IACtB,wBAAwB;IACxB,KAAK;IAEL,6IAA6I;IAC7I,yCAAyC;IAEzC,2EAA2E;IAC3E,sBAAsB;IAEtB,mHAAmH;IACnH,+BAA+B;IAE/B,4CAA4C;IAC5C,kBAAkB;CAClB,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MenuBar = void 0;
7
+ const blessed_1 = __importDefault(require("blessed"));
8
+ class MenuBar {
9
+ // options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }
10
+ constructor(screen, options) {
11
+ this.listb = null;
12
+ const compoptions = {
13
+ parent: screen,
14
+ left: 0,
15
+ right: 0,
16
+ height: 1,
17
+ width: 'shrink',
18
+ mouse: true,
19
+ keys: true,
20
+ autoCommandKeys: true,
21
+ scrollable: true,
22
+ style: {
23
+ fg: 'yellow',
24
+ bg: 'blue',
25
+ item: {
26
+ hover: {
27
+ fg: 'white',
28
+ bg: 'green',
29
+ }
30
+ },
31
+ selected: {
32
+ fg: 'black',
33
+ bg: 'yellow',
34
+ }
35
+ }
36
+ };
37
+ if (options.top === true) {
38
+ compoptions.top = 0;
39
+ }
40
+ else {
41
+ compoptions.bottom = 0;
42
+ }
43
+ for (const [, value] of Object.entries(options.menuitems)) {
44
+ compoptions.commands[value.text] =
45
+ {
46
+ keys: [value.key],
47
+ callback: value.cb
48
+ };
49
+ }
50
+ this.listb = blessed_1.default.listbar(compoptions);
51
+ }
52
+ get listbar() {
53
+ return this.listb;
54
+ }
55
+ }
56
+ exports.MenuBar = MenuBar;
57
+ //# sourceMappingURL=menubar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menubar.js","sourceRoot":"","sources":["../menubar.ts"],"names":[],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