crankscript 0.16.1 → 0.18.0-beta.0
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/CHANGELOG.md +16 -4
- package/assets/ImportMap/ImportMap.js +26 -65
- package/assets/ImportMap/ImportMap.js.map +1 -1
- package/assets/ImportMap/index.js +3 -6
- package/assets/ImportMap/index.js.map +1 -1
- package/assets/beforeEmit/getBeforeEmit.js +11 -16
- package/assets/beforeEmit/getBeforeEmit.js.map +1 -1
- package/assets/beforeEmit/index.js +3 -6
- package/assets/beforeEmit/index.js.map +1 -1
- package/assets/beforeEmit/withAutomaticImportWarning.js +4 -11
- package/assets/beforeEmit/withAutomaticImportWarning.js.map +1 -1
- package/assets/index.js +18 -28
- package/assets/index.js.map +1 -1
- package/assets/transformCallExpression/getTransformCallExpression.js +66 -18
- package/assets/transformCallExpression/getTransformCallExpression.js.map +1 -1
- package/assets/transformCallExpression/index.js +3 -6
- package/assets/transformCallExpression/index.js.map +1 -1
- package/assets/transformClassDeclaration/createClasCall.js +11 -24
- package/assets/transformClassDeclaration/createClasCall.js.map +1 -1
- package/assets/transformClassDeclaration/getExportedClassDeclarationStatements.js +14 -15
- package/assets/transformClassDeclaration/getExportedClassDeclarationStatements.js.map +1 -1
- package/assets/transformClassDeclaration/getTransformClassDeclaration.js +47 -43
- package/assets/transformClassDeclaration/getTransformClassDeclaration.js.map +1 -1
- package/assets/transformClassDeclaration/index.js +3 -6
- package/assets/transformClassDeclaration/index.js.map +1 -1
- package/assets/transformClassDeclaration/transformConstructor.js +44 -56
- package/assets/transformClassDeclaration/transformConstructor.js.map +1 -1
- package/assets/transformClassDeclaration/transformMethodDeclaration.js +12 -20
- package/assets/transformClassDeclaration/transformMethodDeclaration.js.map +1 -1
- package/assets/transformClassDeclaration/transformPropertyName.js +14 -19
- package/assets/transformClassDeclaration/transformPropertyName.js.map +1 -1
- package/assets/transformExportDeclaration/getTransformExportDeclaration.d.ts +6 -0
- package/assets/transformExportDeclaration/getTransformExportDeclaration.js +52 -0
- package/assets/transformExportDeclaration/getTransformExportDeclaration.js.map +1 -0
- package/assets/transformNewExpression/index.js +3 -6
- package/assets/transformNewExpression/index.js.map +1 -1
- package/assets/transformNewExpression/isBuiltinNewExpression.js +11 -15
- package/assets/transformNewExpression/isBuiltinNewExpression.js.map +1 -1
- package/assets/transformNewExpression/transformNewExpression.js +12 -23
- package/assets/transformNewExpression/transformNewExpression.js.map +1 -1
- package/assets/transformPropertyAccessExpression/a.js +24 -0
- package/assets/transformPropertyAccessExpression/a.js.map +1 -0
- package/assets/transformPropertyAccessExpression/getTransformPropertyAccessExpression.js +6 -13
- package/assets/transformPropertyAccessExpression/getTransformPropertyAccessExpression.js.map +1 -1
- package/assets/transformPropertyAccessExpression/index.js +3 -6
- package/assets/transformPropertyAccessExpression/index.js.map +1 -1
- package/assets/transformSuperExpression/index.js +3 -6
- package/assets/transformSuperExpression/index.js.map +1 -1
- package/assets/transformSuperExpression/transformSuperExpression.js +8 -16
- package/assets/transformSuperExpression/transformSuperExpression.js.map +1 -1
- package/assets/types.js +1 -4
- package/assets/types.js.map +1 -1
- package/package.json +8 -5
- package/src/commands/CompileCommand/CompileCommand.d.ts +1 -1
- package/src/commands/CompileCommand/CompileCommand.js +3 -10
- package/src/commands/CompileCommand/CompileCommand.js.map +1 -1
- package/src/commands/CompileCommand/components/Compile.d.ts +1 -1
- package/src/commands/CompileCommand/components/Compile.js +3 -7
- package/src/commands/CompileCommand/components/Compile.js.map +1 -1
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.d.ts +1 -1
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js +1 -2
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js.map +1 -1
- package/src/commands/CompileCommand/hooks/task/compile.d.ts +5 -2
- package/src/commands/CompileCommand/hooks/task/compile.js +10 -9
- package/src/commands/CompileCommand/hooks/task/compile.js.map +1 -1
- package/src/commands/CompileCommand/hooks/useCompileTasks.d.ts +5 -2
- package/src/commands/CompileCommand/hooks/useCompileTasks.js +33 -30
- package/src/commands/CompileCommand/hooks/useCompileTasks.js.map +1 -1
- package/src/commands/CompileCommand/index.js +0 -1
- package/src/commands/CompileCommand/index.js.map +1 -1
- package/src/commands/DoctorCommand.js +5 -12
- package/src/commands/DoctorCommand.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.d.ts +2 -2
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js +30 -30
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.d.ts +1 -1
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js +14 -15
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js +5 -10
- package/src/commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/index.js +0 -1
- package/src/commands/EnvironmentAwareCommand/index.js.map +1 -1
- package/src/commands/GenerateTypes/GenerateTypesCommand.js +14 -21
- package/src/commands/GenerateTypes/GenerateTypesCommand.js.map +1 -1
- package/src/commands/GenerateTypes/components/GenerateTypes.d.ts +1 -1
- package/src/commands/GenerateTypes/components/GenerateTypes.js +11 -15
- package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -1
- package/src/commands/GenerateTypes/constants.js +0 -1
- package/src/commands/GenerateTypes/constants.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getApiDefinitions.d.ts +1 -1
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js +12 -14
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.d.ts +1 -1
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js +38 -30
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js +5 -4
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.js +6 -9
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.js.map +1 -1
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +13 -10
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js +10 -12
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js +23 -29
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.d.ts +2 -2
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +44 -75
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.js +19 -19
- package/src/commands/GenerateTypes/hooks/useGetVersion.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.d.ts +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js +10 -12
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js.map +1 -1
- package/src/commands/GenerateTypes/index.js +0 -1
- package/src/commands/GenerateTypes/index.js.map +1 -1
- package/src/commands/GenerateTypes/types.d.ts +1 -1
- package/src/commands/GenerateTypes/types.js +1 -2
- package/src/commands/GenerateTypes/types.js.map +1 -1
- package/src/commands/GenerateTypes/utils/createTypeProvider.d.ts +2 -2
- package/src/commands/GenerateTypes/utils/createTypeProvider.js +63 -85
- package/src/commands/GenerateTypes/utils/createTypeProvider.js.map +1 -1
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.d.ts +1 -1
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.js +6 -7
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.js.map +1 -1
- package/src/commands/NewCommand/NewCommand.js +9 -17
- package/src/commands/NewCommand/NewCommand.js.map +1 -1
- package/src/commands/NewCommand/components/New.d.ts +1 -1
- package/src/commands/NewCommand/components/New.js +19 -25
- package/src/commands/NewCommand/components/New.js.map +1 -1
- package/src/commands/NewLibCommand/NewLibCommand.js +9 -17
- package/src/commands/NewLibCommand/NewLibCommand.js.map +1 -1
- package/src/commands/NewLibCommand/components/NewLib.d.ts +1 -1
- package/src/commands/NewLibCommand/components/NewLib.js +19 -25
- package/src/commands/NewLibCommand/components/NewLib.js.map +1 -1
- package/src/commands/NewLibCommand/index.js +0 -1
- package/src/commands/NewLibCommand/index.js.map +1 -1
- package/src/commands/RenderableCommand.d.ts +1 -1
- package/src/commands/RenderableCommand.js +5 -3
- package/src/commands/RenderableCommand.js.map +1 -1
- package/src/commands/SimulatorCommand/SimulatorCommand.d.ts +1 -1
- package/src/commands/SimulatorCommand/SimulatorCommand.js +23 -38
- package/src/commands/SimulatorCommand/SimulatorCommand.js.map +1 -1
- package/src/commands/SimulatorCommand/components/Simulator.d.ts +3 -2
- package/src/commands/SimulatorCommand/components/Simulator.js +19 -17
- package/src/commands/SimulatorCommand/components/Simulator.js.map +1 -1
- package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.d.ts +1 -1
- package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.js +15 -22
- package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.js.map +1 -1
- package/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.js +8 -6
- package/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.js.map +1 -1
- package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.d.ts +1 -1
- package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.js +1 -2
- package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.js.map +1 -1
- package/src/commands/SimulatorCommand/hooks/useFileWatcher.js +10 -10
- package/src/commands/SimulatorCommand/hooks/useFileWatcher.js.map +1 -1
- package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.d.ts +6 -2
- package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.js +52 -50
- package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.js.map +1 -1
- package/src/commands/SimulatorCommand/index.js +0 -1
- package/src/commands/SimulatorCommand/index.js.map +1 -1
- package/src/commands/TestCommand/TestCommand.d.ts +12 -0
- package/src/commands/TestCommand/TestCommand.js +32 -0
- package/src/commands/TestCommand/TestCommand.js.map +1 -0
- package/src/commands/TestCommand/components/Test.d.ts +9 -0
- package/src/commands/TestCommand/components/Test.js +73 -0
- package/src/commands/TestCommand/components/Test.js.map +1 -0
- package/src/commands/TestCommand/components/TestLine.d.ts +10 -0
- package/src/commands/TestCommand/components/TestLine.js +11 -0
- package/src/commands/TestCommand/components/TestLine.js.map +1 -0
- package/src/commands/TestCommand/components/TestResult.d.ts +8 -0
- package/src/commands/TestCommand/components/TestResult.js +21 -0
- package/src/commands/TestCommand/components/TestResult.js.map +1 -0
- package/src/commands/TestCommand/components/TestSuite.d.ts +8 -0
- package/src/commands/TestCommand/components/TestSuite.js +60 -0
- package/src/commands/TestCommand/components/TestSuite.js.map +1 -0
- package/src/commands/TestCommand/components/TestSummary.d.ts +7 -0
- package/src/commands/TestCommand/components/TestSummary.js +9 -0
- package/src/commands/TestCommand/components/TestSummary.js.map +1 -0
- package/src/commands/TestCommand/hooks/useTestFiles.d.ts +3 -0
- package/src/commands/TestCommand/hooks/useTestFiles.js +8 -0
- package/src/commands/TestCommand/hooks/useTestFiles.js.map +1 -0
- package/src/commands/TestCommand/hooks/useTestServer.d.ts +5 -0
- package/src/commands/TestCommand/hooks/useTestServer.js +26 -0
- package/src/commands/TestCommand/hooks/useTestServer.js.map +1 -0
- package/src/commands/TestCommand/hooks/useTestTasks.d.ts +14 -0
- package/src/commands/TestCommand/hooks/useTestTasks.js +61 -0
- package/src/commands/TestCommand/hooks/useTestTasks.js.map +1 -0
- package/src/commands/TestCommand/index.d.ts +1 -0
- package/src/commands/TestCommand/index.js +2 -0
- package/src/commands/TestCommand/index.js.map +1 -0
- package/src/commands/TestCommand/server/TestServer.d.ts +72 -0
- package/src/commands/TestCommand/server/TestServer.js +249 -0
- package/src/commands/TestCommand/server/TestServer.js.map +1 -0
- package/src/commands/TestCommand/types.d.ts +4 -0
- package/src/commands/TestCommand/types.js +6 -0
- package/src/commands/TestCommand/types.js.map +1 -0
- package/src/commands/TestCommand/utils/formatTestError.d.ts +1 -0
- package/src/commands/TestCommand/utils/formatTestError.js +7 -0
- package/src/commands/TestCommand/utils/formatTestError.js.map +1 -0
- package/src/commands/TranspileCommand/TranspileCommand.js +20 -28
- package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -1
- package/src/commands/TranspileCommand/components/Transpile.d.ts +2 -2
- package/src/commands/TranspileCommand/components/Transpile.js +3 -7
- package/src/commands/TranspileCommand/components/Transpile.js.map +1 -1
- package/src/commands/TranspileCommand/fn/getErrorMessage.d.ts +1 -1
- package/src/commands/TranspileCommand/fn/getErrorMessage.js +5 -6
- package/src/commands/TranspileCommand/fn/getErrorMessage.js.map +1 -1
- package/src/commands/TranspileCommand/fn/transpile.d.ts +2 -2
- package/src/commands/TranspileCommand/fn/transpile.js +15 -17
- package/src/commands/TranspileCommand/fn/transpile.js.map +1 -1
- package/src/commands/TranspileCommand/fn/validateEntryPoint.d.ts +1 -1
- package/src/commands/TranspileCommand/fn/validateEntryPoint.js +2 -3
- package/src/commands/TranspileCommand/fn/validateEntryPoint.js.map +1 -1
- package/src/commands/TranspileCommand/fn/validateExitPoint.d.ts +1 -1
- package/src/commands/TranspileCommand/fn/validateExitPoint.js +6 -6
- package/src/commands/TranspileCommand/fn/validateExitPoint.js.map +1 -1
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.d.ts +4 -4
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +34 -33
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js.map +1 -1
- package/src/commands/TranspileCommand/index.js +0 -1
- package/src/commands/TranspileCommand/index.js.map +1 -1
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js +1 -2
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js.map +1 -1
- package/src/commands/TranspileCommand/model/ValidatedExitPoint.js +1 -2
- package/src/commands/TranspileCommand/model/ValidatedExitPoint.js.map +1 -1
- package/src/commands/TranspileCommand/types.js +1 -2
- package/src/commands/TranspileCommand/types.js.map +1 -1
- package/src/components/CheckList/CheckList.d.ts +3 -2
- package/src/components/CheckList/CheckList.js +14 -21
- package/src/components/CheckList/CheckList.js.map +1 -1
- package/src/components/CheckList/Item.d.ts +3 -2
- package/src/components/CheckList/Item.js +47 -44
- package/src/components/CheckList/Item.js.map +1 -1
- package/src/components/CheckList/index.js +0 -1
- package/src/components/CheckList/index.js.map +1 -1
- package/src/components/ErrorBoundary.d.ts +14 -0
- package/src/components/ErrorBoundary.js +7 -13
- package/src/components/ErrorBoundary.js.map +1 -1
- package/src/components/Spinner.d.ts +1 -1
- package/src/components/Spinner.js +13 -18
- package/src/components/Spinner.js.map +1 -1
- package/src/constants.js +1 -6
- package/src/constants.js.map +1 -1
- package/src/environment/createEnvironment.d.ts +1 -1
- package/src/environment/createEnvironment.js +13 -16
- package/src/environment/createEnvironment.js.map +1 -1
- package/src/environment/dto/Environment.d.ts +1 -1
- package/src/environment/dto/Environment.js +1 -2
- package/src/environment/dto/Environment.js.map +1 -1
- package/src/environment/error/EnvironmentError.js +0 -1
- package/src/environment/error/EnvironmentError.js.map +1 -1
- package/src/environment/path/dto/PlaydateSdkPath.js +3 -4
- package/src/environment/path/dto/PlaydateSdkPath.js.map +1 -1
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js +1 -2
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js.map +1 -1
- package/src/environment/path/getPlaydateSdkPath.js +5 -3
- package/src/environment/path/getPlaydateSdkPath.js.map +1 -1
- package/src/index.js +7 -5
- package/src/index.js.map +1 -1
- package/src/types.d.ts +3 -3
- package/src/types.js +4 -5
- package/src/types.js.map +1 -1
- package/src/utils/appendExeOnWindows.js +1 -2
- package/src/utils/appendExeOnWindows.js.map +1 -1
- package/src/utils/dirname.js +0 -1
- package/src/utils/dirname.js.map +1 -1
- package/src/utils/platform.js +0 -1
- package/src/utils/platform.js.map +1 -1
- package/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.js +0 -4
- package/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-automatic-imports/src/index.js +0 -3
- package/src/commands/TranspileCommand/fn/_tests/test-automatic-imports/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-builtins/src/index.js +0 -4
- package/src/commands/TranspileCommand/fn/_tests/test-builtins/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-default-parameters/src/index.js +0 -17
- package/src/commands/TranspileCommand/fn/_tests/test-default-parameters/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-implicit-constructor/src/index.js +0 -10
- package/src/commands/TranspileCommand/fn/_tests/test-implicit-constructor/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-static/src/index.js +0 -18
- package/src/commands/TranspileCommand/fn/_tests/test-static/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-super/src/index.js +0 -24
- package/src/commands/TranspileCommand/fn/_tests/test-super/src/index.js.map +0 -1
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StatusMessage } from '@inkjs/ui';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { Item } from './Item.js';
|
|
4
|
-
export const CheckList = ({ items, onFinish })=>{
|
|
4
|
+
export const CheckList = ({ items, onFinish, display, }) => {
|
|
5
5
|
const [currentIndex, setCurrentIndex] = useState(null);
|
|
6
6
|
const [hasFailure, setHasFailure] = useState(false);
|
|
7
|
-
useEffect(()=>{
|
|
7
|
+
useEffect(() => {
|
|
8
8
|
if (currentIndex === null && items.length > 0) {
|
|
9
9
|
setCurrentIndex(0);
|
|
10
10
|
}
|
|
11
|
-
}, [
|
|
12
|
-
|
|
13
|
-
items
|
|
14
|
-
]);
|
|
15
|
-
const handleFinish = (index)=>{
|
|
11
|
+
}, [currentIndex, items]);
|
|
12
|
+
const handleFinish = (index) => {
|
|
16
13
|
if (index + 1 < items.length) {
|
|
17
14
|
setCurrentIndex(index + 1);
|
|
18
|
-
}
|
|
19
|
-
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(hasFailure);
|
|
20
18
|
setHasFailure(false);
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
onFinish: (result)=>{
|
|
27
|
-
var _item_onFinish;
|
|
21
|
+
return (React.createElement(React.Fragment, null,
|
|
22
|
+
items.map((item, index) => (React.createElement(Item, { visible: !display && display !== 'silent', key: item.waitingDescription, item: Object.assign(Object.assign({}, item), { onFinish: (result) => {
|
|
23
|
+
var _a;
|
|
28
24
|
if (result === false) {
|
|
29
25
|
setHasFailure(true);
|
|
30
26
|
}
|
|
31
|
-
item
|
|
27
|
+
(_a = item === null || item === void 0 ? void 0 : item.onFinish) === null || _a === void 0 ? void 0 : _a.call(item, result);
|
|
32
28
|
handleFinish(index);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
start: index === currentIndex
|
|
36
|
-
})));
|
|
29
|
+
} }), start: index === currentIndex }))),
|
|
30
|
+
display && display !== 'silent' && (React.createElement(StatusMessage, { variant: "success" }, display === null || display === void 0 ? void 0 : display.finishedDescription(true)))));
|
|
37
31
|
};
|
|
38
|
-
|
|
39
32
|
//# sourceMappingURL=CheckList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/components/CheckList/CheckList.tsx"],"
|
|
1
|
+
{"version":3,"file":"CheckList.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/components/CheckList/CheckList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAiBjC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAW,EAChC,KAAK,EACL,QAAQ,EACR,OAAO,GACe,EAAE,EAAE;IAC1B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACtE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,YAAY,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5C,eAAe,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;IAE1B,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE;QACnC,IAAI,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,UAAU,CAAC,CAAC;YACvB,aAAa,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH;QACK,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,oBAAC,IAAI,IACD,OAAO,EAAE,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,EACzC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAC5B,IAAI,kCACG,IAAI,KACP,QAAQ,EAAE,CAAC,MAAuB,EAAE,EAAE;;oBAClC,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;wBACnB,aAAa,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAED,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,qDAAG,MAAM,CAAC,CAAC;oBACzB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC,KAEL,KAAK,EAAE,KAAK,KAAK,YAAY,GAC/B,CACL,CAAC;QACD,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,CAChC,oBAAC,aAAa,IAAC,OAAO,EAAC,SAAS,IAC3B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,CAAC,IAAe,CAAC,CAClC,CACnB,CACF,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CheckListItem } from '../../types.js';
|
|
2
|
+
import type { CheckListItem } from '../../types.js';
|
|
3
3
|
export interface ItemProps<TResult> {
|
|
4
4
|
item: CheckListItem<TResult>;
|
|
5
5
|
start: boolean;
|
|
6
|
+
visible?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const Item: <TResult>({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, skipDescription, runner, onFinish, ready, quitOnError, skip, }, start, }: ItemProps<TResult>) => React.JSX.Element;
|
|
8
|
+
export declare const Item: <TResult>({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, skipDescription, runner, onFinish, ready, quitOnError, skip, }, start, visible, }: ItemProps<TResult>) => React.JSX.Element | null;
|
|
@@ -3,7 +3,7 @@ import { Text } from 'ink';
|
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useCrankScriptContext } from '../../commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js';
|
|
5
5
|
import { Spinner } from '../../components/Spinner.js';
|
|
6
|
-
export const Item = ({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, skipDescription, runner, onFinish, ready, quitOnError = true, skip }, start })=>{
|
|
6
|
+
export const Item = ({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, skipDescription, runner, onFinish, ready, quitOnError = true, skip, }, start, visible = true, }) => {
|
|
7
7
|
const executed = useRef(false);
|
|
8
8
|
const interval = useRef(null);
|
|
9
9
|
const [dotCount, setDotCount] = useState(0);
|
|
@@ -12,39 +12,34 @@ export const Item = ({ item: { runningDescription, waitingDescription, errorDesc
|
|
|
12
12
|
const [failedDetails, setFailedDetails] = useState(null);
|
|
13
13
|
const [isSkipped, setIsSkipped] = useState(false);
|
|
14
14
|
const { verbose } = useCrankScriptContext();
|
|
15
|
-
// Determine if the task should be skipped
|
|
16
15
|
const shouldSkip = typeof skip === 'function' ? skip() : skip === true;
|
|
17
16
|
const hasResult = !failedReason && result !== null;
|
|
18
17
|
const isRunning = !failedReason && !hasResult && start && ready !== false && !shouldSkip;
|
|
19
18
|
const isWaiting = !failedReason && !hasResult && (!start || !ready);
|
|
20
19
|
const couldStartButNotReady = !failedReason && !hasResult && start && ready === false;
|
|
21
|
-
useEffect(()=>{
|
|
20
|
+
useEffect(() => {
|
|
22
21
|
if (failedReason && quitOnError) {
|
|
23
22
|
process.exit(1);
|
|
24
23
|
}
|
|
25
|
-
}, [
|
|
26
|
-
|
|
27
|
-
quitOnError
|
|
28
|
-
]);
|
|
29
|
-
useEffect(()=>{
|
|
24
|
+
}, [failedReason, quitOnError]);
|
|
25
|
+
useEffect(() => {
|
|
30
26
|
if (couldStartButNotReady) {
|
|
31
|
-
interval.current = setInterval(()=>{
|
|
32
|
-
setDotCount((count)=>(count + 1) % 4);
|
|
27
|
+
interval.current = setInterval(() => {
|
|
28
|
+
setDotCount((count) => (count + 1) % 4);
|
|
33
29
|
}, 250);
|
|
34
|
-
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
35
32
|
if (interval.current) {
|
|
36
33
|
clearInterval(interval.current);
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
|
-
return ()=>{
|
|
36
|
+
return () => {
|
|
40
37
|
if (interval.current) {
|
|
41
38
|
clearInterval(interval.current);
|
|
42
39
|
}
|
|
43
40
|
};
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
]);
|
|
47
|
-
useEffect(()=>{
|
|
41
|
+
}, [couldStartButNotReady]);
|
|
42
|
+
useEffect(() => {
|
|
48
43
|
if (!start || executed.current || ready === false) {
|
|
49
44
|
return;
|
|
50
45
|
}
|
|
@@ -53,58 +48,66 @@ export const Item = ({ item: { runningDescription, waitingDescription, errorDesc
|
|
|
53
48
|
executed.current = true;
|
|
54
49
|
setIsSkipped(true);
|
|
55
50
|
setResult(true);
|
|
56
|
-
onFinish
|
|
51
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(true);
|
|
57
52
|
return;
|
|
58
53
|
}
|
|
59
|
-
runner()
|
|
54
|
+
runner()
|
|
55
|
+
.then((result) => {
|
|
60
56
|
executed.current = true;
|
|
61
57
|
if (result === false) {
|
|
62
58
|
setfailedReason(errorDescription);
|
|
63
59
|
return;
|
|
64
60
|
}
|
|
65
61
|
setResult(result);
|
|
66
|
-
onFinish
|
|
67
|
-
})
|
|
62
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(result);
|
|
63
|
+
})
|
|
64
|
+
.catch((reason) => {
|
|
68
65
|
setfailedReason(reason instanceof Error ? reason.message : 'Unknown error');
|
|
69
|
-
setFailedDetails(reason instanceof Error && reason.stack
|
|
66
|
+
setFailedDetails(reason instanceof Error && reason.stack
|
|
67
|
+
? reason.stack
|
|
68
|
+
: null);
|
|
70
69
|
setResult(false);
|
|
71
|
-
onFinish
|
|
70
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(false);
|
|
72
71
|
});
|
|
73
|
-
}, [
|
|
74
|
-
errorDescription,
|
|
75
|
-
onFinish,
|
|
76
|
-
runner,
|
|
77
|
-
start,
|
|
78
|
-
shouldSkip
|
|
79
|
-
]);
|
|
72
|
+
}, [errorDescription, onFinish, runner, start, shouldSkip, ready]);
|
|
80
73
|
let message = waitingDescription;
|
|
81
74
|
let variant = 'info';
|
|
82
75
|
if (failedReason) {
|
|
83
76
|
message = ` ${failedReason}`;
|
|
84
77
|
variant = 'error';
|
|
85
|
-
}
|
|
78
|
+
}
|
|
79
|
+
else if (isSkipped) {
|
|
86
80
|
message = skipDescription || 'Task skipped';
|
|
87
81
|
variant = 'info';
|
|
88
|
-
}
|
|
82
|
+
}
|
|
83
|
+
else if (isRunning) {
|
|
89
84
|
message = runningDescription;
|
|
90
85
|
variant = 'warning';
|
|
91
|
-
}
|
|
86
|
+
}
|
|
87
|
+
else if (hasResult) {
|
|
92
88
|
message = finishedDescription(result);
|
|
93
89
|
variant = 'success';
|
|
94
90
|
}
|
|
95
91
|
if (isRunning) {
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
return React.createElement(Spinner, { label: message });
|
|
93
|
+
}
|
|
94
|
+
if (!visible && !failedReason) {
|
|
95
|
+
return null;
|
|
99
96
|
}
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
return (React.createElement(StatusMessage, { variant: variant },
|
|
98
|
+
React.createElement(Text, { bold: !isWaiting, color: isRunning
|
|
99
|
+
? 'yellow'
|
|
100
|
+
: isWaiting
|
|
101
|
+
? 'gray'
|
|
102
|
+
: failedReason
|
|
103
|
+
? 'red'
|
|
104
|
+
: isSkipped
|
|
105
|
+
? 'gray'
|
|
106
|
+
: 'green' },
|
|
107
|
+
message,
|
|
108
|
+
' ',
|
|
109
|
+
couldStartButNotReady &&
|
|
110
|
+
`— not ready yet${'.'.repeat(dotCount)}`,
|
|
111
|
+
verbose && failedDetails && (React.createElement(Text, { color: "red" }, failedDetails)))));
|
|
108
112
|
};
|
|
109
|
-
|
|
110
113
|
//# sourceMappingURL=Item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/components/CheckList/Item.tsx"],"
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/components/CheckList/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uEAAuE,CAAC;AAC9G,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAQtD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAW,EAC3B,IAAI,EAAE,EACF,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,EACR,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,IAAI,GACP,EACD,KAAK,EACL,OAAO,GAAG,IAAI,GACG,EAAE,EAAE;IACrB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACrD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAyB,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACtE,MAAM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CAAC,KAAK;wBACP,CAAC,CAAC,SAAS;4BACT,CAAC,CAAC,MAAM;4BACR,CAAC,CAAC,OAAO;YAGtB,OAAO;YAAE,GAAG;YACZ,qBAAqB;gBAClB,kBAAkB,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YAC3C,OAAO,IAAI,aAAa,IAAI,CACzB,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,aAAa,CAAQ,CAC3C,CACE,CACK,CACnB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/components/CheckList/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/components/CheckList/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { Component, type ReactNode } from 'react';
|
|
2
|
+
interface State {
|
|
3
|
+
error?: Error;
|
|
4
|
+
}
|
|
5
|
+
interface Props {
|
|
6
|
+
verbose: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare class ErrorBoundary extends Component<Props, State> {
|
|
10
|
+
state: State;
|
|
11
|
+
static getDerivedStateFromError(error: Error): Partial<State>;
|
|
12
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -2,10 +2,12 @@ import { StatusMessage } from '@inkjs/ui';
|
|
|
2
2
|
import { Text } from 'ink';
|
|
3
3
|
import React, { Component } from 'react';
|
|
4
4
|
export class ErrorBoundary extends Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.state = {};
|
|
8
|
+
}
|
|
5
9
|
static getDerivedStateFromError(error) {
|
|
6
|
-
return {
|
|
7
|
-
error
|
|
8
|
-
};
|
|
10
|
+
return { error };
|
|
9
11
|
}
|
|
10
12
|
render() {
|
|
11
13
|
const { verbose } = this.props;
|
|
@@ -13,16 +15,8 @@ export class ErrorBoundary extends Component {
|
|
|
13
15
|
if (!error) {
|
|
14
16
|
return this.props.children;
|
|
15
17
|
}
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
}, /*#__PURE__*/ React.createElement(Text, {
|
|
19
|
-
color: "red"
|
|
20
|
-
}, verbose ? error.stack : error.message));
|
|
21
|
-
}
|
|
22
|
-
constructor(...args){
|
|
23
|
-
super(...args);
|
|
24
|
-
this.state = {};
|
|
18
|
+
return (React.createElement(StatusMessage, { variant: "error" },
|
|
19
|
+
React.createElement(Text, { color: "red" }, verbose ? error.stack : error.message)));
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/cli/src/components/ErrorBoundary.tsx"],"
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../../libs/cli/src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAWzD,MAAM,OAAO,aAAc,SAAQ,SAAuB;IAA1D;;QACa,UAAK,GAAG,EAAW,CAAC;IAoBjC,CAAC;IAlBG,MAAM,CAAC,wBAAwB,CAAC,KAAY;QACxC,OAAO,EAAE,KAAK,EAAE,CAAC;IACrB,CAAC;IAEQ,MAAM;QACX,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7B,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC/B,CAAC;QAED,OAAO,CACH,oBAAC,aAAa,IAAC,OAAO,EAAC,OAAO;YAC1B,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAQ,CACpD,CACnB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Spinner as InkUiSpinner, extendTheme, defaultTheme, ThemeProvider } from '@inkjs/ui';
|
|
1
|
+
import { defaultTheme, extendTheme, Spinner as InkUiSpinner, ThemeProvider, } from '@inkjs/ui';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
const SpinnerTheme = extendTheme(defaultTheme, {
|
|
5
4
|
components: {
|
|
6
5
|
Spinner: {
|
|
7
6
|
styles: {
|
|
8
|
-
frame: ()=>({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
label: ()=>({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
7
|
+
frame: () => ({
|
|
8
|
+
color: 'yellowBright',
|
|
9
|
+
}),
|
|
10
|
+
label: () => ({
|
|
11
|
+
color: 'yellowBright',
|
|
12
|
+
}),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
17
16
|
});
|
|
18
|
-
export const Spinner = (props)=>{
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
}, /*#__PURE__*/ React.createElement(InkUiSpinner, _extends({}, props, {
|
|
22
|
-
label: ` ${props.label}`
|
|
23
|
-
})));
|
|
17
|
+
export const Spinner = (props) => {
|
|
18
|
+
return (React.createElement(ThemeProvider, { theme: SpinnerTheme },
|
|
19
|
+
React.createElement(InkUiSpinner, Object.assign({}, props, { label: ` ${props.label}` }))));
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
//# sourceMappingURL=Spinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/cli/src/components/Spinner.tsx"],"
|
|
1
|
+
{"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../../../../libs/cli/src/components/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,WAAW,EACX,OAAO,IAAI,YAAY,EAEvB,aAAa,GAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,EAAE;IAC3C,UAAU,EAAE;QACR,OAAO,EAAE;YACL,MAAM,EAAE;gBACJ,KAAK,EAAE,GAAc,EAAE,CAAC,CAAC;oBACrB,KAAK,EAAE,cAAc;iBACxB,CAAC;gBACF,KAAK,EAAE,GAAc,EAAE,CAAC,CAAC;oBACrB,KAAK,EAAE,cAAc;iBACxB,CAAC;aACL;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC3C,OAAO,CACH,oBAAC,aAAa,IAAC,KAAK,EAAE,YAAY;QAC9B,oBAAC,YAAY,oBAAK,KAAK,IAAE,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,CACzC,CACnB,CAAC;AACN,CAAC,CAAC"}
|
package/src/constants.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { __dirname } from './utils/dirname.js';
|
|
3
|
-
export const TypescriptReservedNamed = [
|
|
4
|
-
'delete',
|
|
5
|
-
'new',
|
|
6
|
-
'function'
|
|
7
|
-
];
|
|
3
|
+
export const TypescriptReservedNamed = ['delete', 'new', 'function'];
|
|
8
4
|
export const RootFolder = join(__dirname, '..', '..');
|
|
9
5
|
export const DataFolder = join(RootFolder, 'src', 'data');
|
|
10
|
-
|
|
11
6
|
//# sourceMappingURL=constants.js.map
|
package/src/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../libs/cli/src/constants.ts"],"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../libs/cli/src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import { HealthCheckStatusType } from '../types.js';
|
|
1
|
+
import { HealthCheckStatusType, } from '../types.js';
|
|
2
2
|
import { Environment } from './dto/Environment.js';
|
|
3
3
|
import { getPlaydateSdkPath } from './path/getPlaydateSdkPath.js';
|
|
4
4
|
/**
|
|
5
5
|
* Will create a configuration object from the environment.
|
|
6
|
-
*/
|
|
7
|
-
|
|
6
|
+
*/
|
|
7
|
+
export const createEnvironment = (input) => {
|
|
8
|
+
const { environment = process.env } = input !== null && input !== void 0 ? input : {};
|
|
8
9
|
let sdkPath;
|
|
9
10
|
try {
|
|
10
|
-
sdkPath = getPlaydateSdkPath({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} catch (error) {
|
|
11
|
+
sdkPath = getPlaydateSdkPath({ environment });
|
|
12
|
+
}
|
|
13
|
+
catch (_error) {
|
|
14
14
|
return {
|
|
15
15
|
isHealthy: false,
|
|
16
16
|
health: {
|
|
17
|
-
sdkPathKnown: {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
}
|
|
17
|
+
sdkPathKnown: { healthStatus: HealthCheckStatusType.Unhealthy },
|
|
18
|
+
},
|
|
21
19
|
};
|
|
22
20
|
}
|
|
23
21
|
return {
|
|
24
22
|
isHealthy: true,
|
|
25
23
|
environment: new Environment({
|
|
26
|
-
sdkPath
|
|
24
|
+
sdkPath,
|
|
27
25
|
}),
|
|
28
26
|
health: {
|
|
29
27
|
sdkPathKnown: {
|
|
30
28
|
healthStatus: HealthCheckStatusType.Healthy,
|
|
31
|
-
argument: sdkPath
|
|
32
|
-
}
|
|
33
|
-
}
|
|
29
|
+
argument: sdkPath,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
34
32
|
};
|
|
35
33
|
};
|
|
36
|
-
|
|
37
34
|
//# sourceMappingURL=createEnvironment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/cli/src/environment/createEnvironment.ts"],"
|
|
1
|
+
{"version":3,"file":"createEnvironment.js","sourceRoot":"","sources":["../../../../../libs/cli/src/environment/createEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,qBAAqB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAOjC,EAA2B,EAAE;IAC1B,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;IAClD,IAAI,OAAwB,CAAC;IAE7B,IAAI,CAAC;QACD,OAAO,GAAG,kBAAkB,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QACd,OAAO;YACH,SAAS,EAAE,KAAK;YAChB,MAAM,EAAE;gBACJ,YAAY,EAAE,EAAE,YAAY,EAAE,qBAAqB,CAAC,SAAS,EAAE;aAClE;SACJ,CAAC;IACN,CAAC;IAED,OAAO;QACH,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI,WAAW,CAAC;YACzB,OAAO;SACV,CAAC;QACF,MAAM,EAAE;YACJ,YAAY,EAAE;gBACV,YAAY,EAAE,qBAAqB,CAAC,OAAO;gBAC3C,QAAQ,EAAE,OAAO;aACpB;SACJ;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/environment/dto/Environment.ts"],"
|
|
1
|
+
{"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/environment/dto/Environment.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,WAAW;IAGpB,YAAmB,EAAE,OAAO,EAAgC;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/environment/error/EnvironmentError.ts"],"
|
|
1
|
+
{"version":3,"file":"EnvironmentError.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/environment/error/EnvironmentError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,gBAAiB,SAAQ,KAAK;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/environment/path/dto/PlaydateSdkPath.ts"],"
|
|
1
|
+
{"version":3,"file":"PlaydateSdkPath.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/environment/path/dto/PlaydateSdkPath.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,eAAe;IACxB,YAAoC,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE7C,MAAM,CAAC,UAAU,CAAC,IAAY;QACjC,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACJ"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EnvironmentError } from '../../error/EnvironmentError.js';
|
|
2
2
|
export class PlaydateSdkPathVariableNotSetError extends EnvironmentError {
|
|
3
|
-
constructor(){
|
|
3
|
+
constructor() {
|
|
4
4
|
super('Playdate SDK path variable not set.');
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
//# sourceMappingURL=PlaydateSdkPathVariableNotSetError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/environment/path/error/PlaydateSdkPathVariableNotSetError.ts"],"
|
|
1
|
+
{"version":3,"file":"PlaydateSdkPathVariableNotSetError.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/environment/path/error/PlaydateSdkPathVariableNotSetError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,OAAO,kCAAmC,SAAQ,gBAAgB;IACpE;QACI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACjD,CAAC;CACJ"}
|
|
@@ -5,12 +5,14 @@ import { PlaydateSdkPathVariableNotSetError } from './error/PlaydateSdkPathVaria
|
|
|
5
5
|
* Get the path to the Playdate SDK from the environment.
|
|
6
6
|
*
|
|
7
7
|
* @throws {PlaydateSdkPathVariableNotSetError} Thrown if the PLAYDATE_SDK_PATH environment variable is not set.
|
|
8
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
export const getPlaydateSdkPath = (input) => {
|
|
9
10
|
const { environment = process.env } = input;
|
|
10
11
|
if (!('PLAYDATE_SDK_PATH' in environment)) {
|
|
11
12
|
throw new PlaydateSdkPathVariableNotSetError();
|
|
12
13
|
}
|
|
13
|
-
return PlaydateSdkPath.fromString(
|
|
14
|
+
return PlaydateSdkPath.fromString(
|
|
15
|
+
// biome-ignore lint/complexity/useLiteralKeys: otherwise TypeScript will complain
|
|
16
|
+
environment['PLAYDATE_SDK_PATH']);
|
|
14
17
|
};
|
|
15
|
-
|
|
16
18
|
//# sourceMappingURL=getPlaydateSdkPath.js.map
|