@24i/bigscreen-sdk 0.9.9-alpha.2147 → 0.9.9-alpha.2149
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 +3 -4
- package/packages/developer-tools/src/DeveloperConsole/utils/formatTime.ts +13 -0
- package/packages/developer-tools/src/DeveloperConsole/utils/index.ts +3 -0
- package/packages/developer-tools/src/DeveloperConsole/utils/stringify.ts +10 -0
- package/packages/developer-tools/src/DeveloperConsole/utils/styles.ts +24 -0
- package/packages/developer-tools/src/EnvironmentSelection/utils/format.ts +4 -0
- package/packages/developer-tools/src/TechnicalInfo/utils/eme01bSupport.ts +58 -0
- package/packages/developer-tools/src/TechnicalInfo/utils/emeSupport.ts +80 -0
- package/packages/developer-tools/src/TechnicalInfo/utils/formatTimezone.ts +15 -0
- package/packages/developer-tools/src/TechnicalInfo/utils/mseSupport.ts +14 -0
- package/packages/developer-tools/src/utils/reload.ts +6 -0
- package/packages/keyboard/src/utils/caret.ts +48 -0
- package/packages/keyboard/src/utils/generateFocusMatrixFromStringMatrix.ts +12 -0
- package/packages/keyboard/src/utils/input.ts +40 -0
- package/packages/list/utils/index.ts +1 -0
- package/packages/logger/src/utils/deviceInfo.ts +25 -0
- package/packages/logger/src/utils/index.ts +1 -0
- package/packages/utils/README.md +336 -0
- package/packages/utils/src/addClass.ts +9 -0
- package/packages/utils/src/counter.ts +47 -0
- package/packages/utils/src/debounce.ts +54 -0
- package/packages/utils/src/displayToggler.scss +3 -0
- package/packages/utils/src/displayToggler.ts +38 -0
- package/packages/utils/src/elementUtils.ts +58 -0
- package/packages/utils/src/generateUuid.ts +19 -0
- package/packages/utils/src/index.ts +35 -0
- package/packages/utils/src/memoryInfo.ts +21 -0
- package/packages/utils/src/nTimes.ts +9 -0
- package/packages/utils/src/noop.ts +1 -0
- package/packages/utils/src/offsetPosition.ts +56 -0
- package/packages/utils/src/removeClass.ts +9 -0
- package/packages/utils/src/scaledImage.ts +21 -0
- package/packages/utils/src/stopEvent.ts +10 -0
- package/packages/utils/src/timeConstants.ts +11 -0
- package/packages/utils/src/timers/createInterval.ts +19 -0
- package/packages/utils/src/timers/createTimeout.ts +22 -0
- package/packages/utils/src/timers/index.ts +4 -0
- package/packages/utils/src/timers/runAsync.ts +3 -0
- package/packages/utils/src/timers/types.ts +9 -0
- package/packages/utils/src/wait.ts +1 -0
- package/packages/utils/src/xhr/index.ts +11 -0
- package/packages/utils/src/xhr/xhrSend.ts +139 -0
- package/packages/utils/src/xhr/xhrSendRetry.ts +77 -0
- package/utils/create-export-maps/index.ts +3 -0
- package/utils/create-export-maps/src/__tests__/createExportMaps.spec.ts +50 -0
- package/utils/create-export-maps/src/createExportMaps.ts +61 -0
- package/utils/create-package/README.md +40 -0
- package/utils/create-package/src/createPackage.ts +72 -0
- package/utils/create-package/src/index.ts +3 -0
- package/utils/create-package/src/questionnaire/questions.ts +19 -0
- package/utils/create-package/src/settings/Settings.ts +5 -0
- package/utils/create-package/src/types.ts +4 -0
- package/utils/create-package/templates/typescript/README.md +9 -0
- package/utils/create-package/templates/typescript/exports.json +6 -0
- package/utils/create-package/templates/typescript/src/index.ts +0 -0
- package/utils/run-scripts/index.ts +3 -0
- package/utils/run-scripts/src/__tests__/runScripts.spec.ts +45 -0
- package/utils/run-scripts/src/runScripts.ts +20 -0
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { runScripts } from '../runScripts';
|
|
3
|
+
|
|
4
|
+
jest.mock('../../../../package.json', () => ({
|
|
5
|
+
scripts: {
|
|
6
|
+
'scripts:prepare:create-export-maps': 'ts-node ./utils/create-export-maps/index.ts',
|
|
7
|
+
'scripts:run:test2': 'ts-node ./utils/test2.ts',
|
|
8
|
+
'scripts:run:test1': 'ts-node ./utils/test1.ts',
|
|
9
|
+
},
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
jest.mock('child_process', () => ({
|
|
13
|
+
execSync: jest.fn(),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
describe('runScripts', () => {
|
|
17
|
+
const argvBackup = process.argv;
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
jest.clearAllMocks();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterAll(() => {
|
|
24
|
+
process.argv = argvBackup;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should not run anything if no script found', () => {
|
|
28
|
+
process.argv = ['node', 'run-scripts/index.ts', 'build:.+'];
|
|
29
|
+
runScripts();
|
|
30
|
+
expect(execSync).not.toHaveBeenCalled();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should run found script', () => {
|
|
34
|
+
process.argv = ['node', 'run-scripts/index.ts', 'prepare:.+'];
|
|
35
|
+
runScripts();
|
|
36
|
+
expect(execSync).toHaveBeenCalledWith('npm run scripts:prepare:create-export-maps');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should run found scripts in order they are in package.json', () => {
|
|
40
|
+
process.argv = ['node', 'run-scripts/index.ts', 'run:.+'];
|
|
41
|
+
runScripts();
|
|
42
|
+
expect(execSync).toHaveBeenNthCalledWith(1, 'npm run scripts:run:test2');
|
|
43
|
+
expect(execSync).toHaveBeenNthCalledWith(2, 'npm run scripts:run:test1');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { scripts } from '../../../package.json';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Runs all npm scripts from package.json that match given regexp.
|
|
6
|
+
* RegExp is passed as the 1st param.
|
|
7
|
+
*/
|
|
8
|
+
export const runScripts = () => {
|
|
9
|
+
const matcher = new RegExp(process.argv[2] ?? '');
|
|
10
|
+
const scriptsToRun = Object.keys(scripts).filter((script) => script.match(matcher));
|
|
11
|
+
scriptsToRun.forEach((script) => {
|
|
12
|
+
console.log(`Running npm run ${script}`);
|
|
13
|
+
try {
|
|
14
|
+
execSync(`npm run ${script}`);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.error((e as Error).message);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|