@snap/valdi 1.0.7 → 1.0.8
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/README.md +12 -3
- package/bundled-skills/CONTRIBUTING_SKILLS.md +74 -0
- package/bundled-skills/registry.json +20 -0
- package/bundled-skills/skills/valdi-android/skill.md +89 -0
- package/bundled-skills/skills/valdi-async/skill.md +246 -0
- package/bundled-skills/skills/valdi-async/tests/BUILD.bazel +19 -0
- package/bundled-skills/skills/valdi-async/tests/README.md +25 -0
- package/bundled-skills/skills/valdi-async/tests/src/reference.tsx +210 -0
- package/bundled-skills/skills/valdi-async/tests/tsconfig.json +1 -0
- package/bundled-skills/skills/valdi-bazel/skill.md +122 -0
- package/bundled-skills/skills/valdi-compiler/skill.md +108 -0
- package/bundled-skills/skills/valdi-component-tests/skill.md +430 -0
- package/bundled-skills/skills/valdi-component-tests/tests/BUILD.bazel +24 -0
- package/bundled-skills/skills/valdi-component-tests/tests/README.md +35 -0
- package/bundled-skills/skills/valdi-component-tests/tests/src/ProfileCard.tsx +38 -0
- package/bundled-skills/skills/valdi-component-tests/tests/test/ProfileCardTest.spec.tsx +107 -0
- package/bundled-skills/skills/valdi-component-tests/tests/tsconfig.json +1 -0
- package/bundled-skills/skills/valdi-cpp-runtime/skill.md +103 -0
- package/bundled-skills/skills/valdi-custom-view/skill.md +62 -0
- package/bundled-skills/skills/valdi-ios/skill.md +93 -0
- package/bundled-skills/skills/valdi-migrate/skill.md +175 -0
- package/bundled-skills/skills/valdi-migrate/tests/BUILD.bazel +23 -0
- package/bundled-skills/skills/valdi-migrate/tests/README.md +70 -0
- package/bundled-skills/skills/valdi-migrate/tests/check_antipatterns.py +89 -0
- package/bundled-skills/skills/valdi-migrate/tests/compose_example.kt +94 -0
- package/bundled-skills/skills/valdi-migrate/tests/flutter_example.dart +129 -0
- package/bundled-skills/skills/valdi-migrate/tests/react_example.tsx +98 -0
- package/bundled-skills/skills/valdi-migrate/tests/src/expected_valdi.tsx +267 -0
- package/bundled-skills/skills/valdi-migrate/tests/tsconfig.json +3 -0
- package/bundled-skills/skills/valdi-overview/skill.md +63 -0
- package/bundled-skills/skills/valdi-perf/skill.md +197 -0
- package/bundled-skills/skills/valdi-perf/tests/BUILD.bazel +19 -0
- package/bundled-skills/skills/valdi-perf/tests/README.md +26 -0
- package/bundled-skills/skills/valdi-perf/tests/src/reference.tsx +202 -0
- package/bundled-skills/skills/valdi-perf/tests/tsconfig.json +1 -0
- package/bundled-skills/skills/valdi-polyglot-module/skill.md +85 -0
- package/bundled-skills/skills/valdi-setup/skill.md +129 -0
- package/bundled-skills/skills/valdi-testing/skill.md +65 -0
- package/bundled-skills/skills/valdi-tsx/skill.md +385 -0
- package/bundled-skills/skills/valdi-tsx/tests/BUILD.bazel +19 -0
- package/bundled-skills/skills/valdi-tsx/tests/README.md +29 -0
- package/bundled-skills/skills/valdi-tsx/tests/src/reference.tsx +173 -0
- package/bundled-skills/skills/valdi-tsx/tests/tsconfig.json +1 -0
- package/dist/commands/bootstrap.js +0 -7
- package/dist/commands/newModule.js +10 -14
- package/dist/commands/skills.js +16 -0
- package/dist/commands/skills_commands/create.js +125 -0
- package/dist/commands/skills_commands/install.js +96 -0
- package/dist/commands/skills_commands/list.js +83 -0
- package/dist/commands/skills_commands/remove.js +41 -0
- package/dist/commands/skills_commands/update.js +59 -0
- package/dist/core/constants.js +0 -1
- package/dist/setup/versions.js +1 -1
- package/dist/utils/skillsAdapters.js +140 -0
- package/dist/utils/skillsRegistry.js +40 -0
- package/package.json +6 -1
- package/.bazelignore +0 -2
- package/.bootstrap/apps/cli_application/BUILD.bazel.template +0 -7
- package/.bootstrap/apps/cli_application/modules/{{MODULE_NAME}}/BUILD.bazel.template +0 -11
- package/.bootstrap/apps/cli_application/modules/{{MODULE_NAME}}/src/index.ts +0 -1
- package/.bootstrap/apps/ui_application/.eslint.rc +0 -27
- package/.bootstrap/apps/ui_application/BUILD.bazel.template +0 -19
- package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/BUILD.bazel.template +0 -21
- package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/res/valdi@3x.png +0 -0
- package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/src/App.tsx +0 -133
- package/.bootstrap/apps/ui_application/package.json +0 -24
- package/.bootstrap/modules/cpp_bridge_module/BUILD.bazel.template +0 -21
- package/.bootstrap/modules/cpp_bridge_module/cpp/CalculatorModuleFactory.cpp.template +0 -28
- package/.bootstrap/modules/cpp_bridge_module/src/Calculator.d.ts +0 -4
- package/.bootstrap/modules/ios_android_bridge_module/BUILD.bazel.template +0 -39
- package/.bootstrap/modules/ios_android_bridge_module/android/CalculatorModuleFactory.kt.template +0 -18
- package/.bootstrap/modules/ios_android_bridge_module/ios/SCCCalculatorModuleFactory.m.template +0 -31
- package/.bootstrap/modules/ios_android_bridge_module/src/Calculator.d.ts +0 -4
- package/.bootstrap/modules/ios_android_view_module/BUILD.bazel.template +0 -41
- package/.bootstrap/modules/ios_android_view_module/android/CircleView.kt.template +0 -42
- package/.bootstrap/modules/ios_android_view_module/android/CircleViewAttributesBinder.kt.template +0 -60
- package/.bootstrap/modules/ios_android_view_module/ios/SCCCircleView.h +0 -6
- package/.bootstrap/modules/ios_android_view_module/ios/SCCCircleView.m +0 -82
- package/.bootstrap/modules/ios_android_view_module/src/Circle.tsx.template +0 -15
- package/.bootstrap/modules/ui_component/BUILD.bazel.template +0 -34
- package/.bootstrap/modules/ui_component/src/NewModuleComponent.tsx +0 -45
- package/.config/copyconfig.json +0 -10
- package/.editorconfig +0 -21
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -72
- package/.github/README.md +0 -164
- package/.metadata/.bazelrc.template +0 -91
- package/.metadata/.bazelversion.template +0 -1
- package/.metadata/.cursorrules.template +0 -60
- package/.metadata/.editorconfig.template +0 -37
- package/.metadata/.eslintrc.js.template +0 -27
- package/.metadata/.gitignore.template +0 -4
- package/.metadata/.prettierrc.json.template +0 -7
- package/.metadata/.watchmanconfig.template +0 -8
- package/.metadata/AGENTS.md.template +0 -282
- package/.metadata/README.md.template +0 -31
- package/.metadata/WORKSPACE.template +0 -57
- package/.metadata/config.yaml.template +0 -1
- package/.metadata/package.json.template +0 -23
- package/.prettierignore +0 -2
- package/.prettierrc.json +0 -7
- package/LINUX_COMPATIBILITY.md +0 -248
- package/prettier.config.js +0 -4
- package/scripts/sync-agents-md.sh +0 -44
- package/scripts/update-agents-templates.ts +0 -170
- package/spec/support/jasmine.json +0 -6
- package/src/commands/bootstrap.ts +0 -410
- package/src/commands/build.ts +0 -89
- package/src/commands/devSetup.ts +0 -17
- package/src/commands/doctor.ts +0 -1832
- package/src/commands/export.ts +0 -131
- package/src/commands/hotreload.ts +0 -108
- package/src/commands/install.ts +0 -93
- package/src/commands/lint.ts +0 -15
- package/src/commands/lint_commands/lintCheck.ts +0 -53
- package/src/commands/lint_commands/lintFormat.ts +0 -49
- package/src/commands/log.ts +0 -108
- package/src/commands/newModule.ts +0 -286
- package/src/commands/package.ts +0 -102
- package/src/commands/projectsync.ts +0 -488
- package/src/commands/test.ts +0 -68
- package/src/core/constants.ts +0 -98
- package/src/core/errors.ts +0 -10
- package/src/index.ts +0 -27
- package/src/setup/DevSetupHelper.ts +0 -290
- package/src/setup/linuxSetup.ts +0 -261
- package/src/setup/macOSSetup.ts +0 -156
- package/src/setup/setupEntryPoint.ts +0 -64
- package/src/setup/versions.ts +0 -8
- package/src/utils/ArgumentsResolver.ts +0 -23
- package/src/utils/BazelClient.ts +0 -285
- package/src/utils/Digraph.ts +0 -81
- package/src/utils/LoadingIndicator.ts +0 -43
- package/src/utils/applicationUtils.ts +0 -276
- package/src/utils/buildInfo.ts +0 -99
- package/src/utils/byString.ts +0 -3
- package/src/utils/cliUtils.ts +0 -112
- package/src/utils/copyBootstrapFiles.ts +0 -30
- package/src/utils/deviceUtils.ts +0 -76
- package/src/utils/errorUtils.ts +0 -63
- package/src/utils/fileUtils.ts +0 -257
- package/src/utils/githubUtils.ts +0 -102
- package/src/utils/jsonUtils.ts +0 -30
- package/src/utils/lintUtils.ts +0 -190
- package/src/utils/linuxDistro.spec.ts +0 -219
- package/src/utils/linuxDistro.ts +0 -326
- package/src/utils/logUtils.ts +0 -9
- package/src/utils/pathUtils.ts +0 -12
- package/src/utils/stringUtils.spec.ts +0 -95
- package/src/utils/stringUtils.ts +0 -103
- package/src/utils/tempDir.ts +0 -24
- package/src/utils/zipUtils.ts +0 -14
- package/test/ValdiSmokeTest.ts +0 -279
- package/test/helpers/AsyncHelpers.ts +0 -113
- package/test/helpers/CommandHelpers.ts +0 -37
- package/test/helpers/ProjectHelpers.ts +0 -153
- package/test/helpers/StreamHelpers.ts +0 -37
- package/test/helpers/TypeScriptClient.ts +0 -217
- package/tsconfig.dist.json +0 -8
- package/tsconfig.json +0 -42
package/src/commands/build.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { type Argv } from 'yargs';
|
|
2
|
-
import { ANSI_COLORS, PLATFORM } from '../core/constants';
|
|
3
|
-
import type { ArgumentsResolver } from '../utils/ArgumentsResolver';
|
|
4
|
-
import { BazelClient } from '../utils/BazelClient';
|
|
5
|
-
import {
|
|
6
|
-
applicationExtensionForPlatform,
|
|
7
|
-
getOutputFilePath,
|
|
8
|
-
makeArgsBuilder,
|
|
9
|
-
} from '../utils/applicationUtils';
|
|
10
|
-
import type { CommandParameters} from '../utils/buildInfo';
|
|
11
|
-
import { getBuildInfo } from '../utils/buildInfo';
|
|
12
|
-
import { installAndroidApk } from '../utils/deviceUtils';
|
|
13
|
-
import { logReproduceThisCommandIfNeeded, makeCommandHandler } from '../utils/errorUtils';
|
|
14
|
-
import { wrapInColor } from '../utils/logUtils';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
async function valdiBuild(argv: ArgumentsResolver<CommandParameters>) {
|
|
18
|
-
const bazel = new BazelClient();
|
|
19
|
-
|
|
20
|
-
const buildInfo = await getBuildInfo(argv, bazel, false);
|
|
21
|
-
|
|
22
|
-
// Output Selection
|
|
23
|
-
// ----------------
|
|
24
|
-
|
|
25
|
-
// Perform build and install
|
|
26
|
-
// -------------------------
|
|
27
|
-
console.log(`Building: ${wrapInColor(buildInfo.application, ANSI_COLORS.GREEN_COLOR)}`);
|
|
28
|
-
|
|
29
|
-
switch (buildInfo.platform) {
|
|
30
|
-
case PLATFORM.ANDROID: {
|
|
31
|
-
const outputFilePath = await argv.getArgumentOrResolve('target_output_path', () => {
|
|
32
|
-
console.log('Resolving output paths...');
|
|
33
|
-
return getOutputFilePath(bazel, applicationExtensionForPlatform(buildInfo.platform), buildInfo.application, buildInfo.bazelArgs);
|
|
34
|
-
});
|
|
35
|
-
await bazel.buildTarget(buildInfo.application, buildInfo.bazelArgs);
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case PLATFORM.IOS: {
|
|
39
|
-
console.log('Building iOS application...');
|
|
40
|
-
await bazel.buildTarget(buildInfo.application, buildInfo.bazelArgs);
|
|
41
|
-
logReproduceThisCommandIfNeeded(argv);
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
case PLATFORM.MACOS: {
|
|
45
|
-
logReproduceThisCommandIfNeeded(argv);
|
|
46
|
-
console.log('Building MacOS application...');
|
|
47
|
-
await bazel.buildTarget(buildInfo.application, buildInfo.bazelArgs);
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
case PLATFORM.CLI: {
|
|
51
|
-
logReproduceThisCommandIfNeeded(argv);
|
|
52
|
-
console.log('Build CLI application...');
|
|
53
|
-
await bazel.buildTarget(buildInfo.application, buildInfo.bazelArgs);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const command = 'build <platform>';
|
|
60
|
-
export const describe = 'Build the application';
|
|
61
|
-
export const builder = makeArgsBuilder((yargs: Argv<CommandParameters>) => {
|
|
62
|
-
yargs
|
|
63
|
-
.option('application', {
|
|
64
|
-
describe: 'Name of the application to install',
|
|
65
|
-
type: 'string',
|
|
66
|
-
requiresArg: true,
|
|
67
|
-
})
|
|
68
|
-
.option('device_id', {
|
|
69
|
-
describe: 'Device ID that will receive the application',
|
|
70
|
-
type: 'string',
|
|
71
|
-
requiresArg: true,
|
|
72
|
-
})
|
|
73
|
-
.option('target_output_path', {
|
|
74
|
-
describe: 'The output path for the Bazel target',
|
|
75
|
-
type: 'string',
|
|
76
|
-
requiresArg: true,
|
|
77
|
-
})
|
|
78
|
-
.option('simulator', {
|
|
79
|
-
describe: 'Whether to build for simulator or for device',
|
|
80
|
-
type: 'boolean',
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
export const handler = makeCommandHandler(valdiBuild);
|
|
84
|
-
|
|
85
|
-
// TODOs:
|
|
86
|
-
// - Cached bazel query results
|
|
87
|
-
|
|
88
|
-
// Extract 'custom_package' from android_binary
|
|
89
|
-
// Extract 'bundle_id' from ios_application target
|
package/src/commands/devSetup.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ANSI_COLORS } from '../core/constants';
|
|
2
|
-
import { beginEnvironmentSetup } from '../setup/setupEntryPoint';
|
|
3
|
-
import { makeCommandHandler } from '../utils/errorUtils';
|
|
4
|
-
import { wrapInColor } from '../utils/logUtils';
|
|
5
|
-
|
|
6
|
-
async function valdiSetup() {
|
|
7
|
-
const returnCode = await beginEnvironmentSetup();
|
|
8
|
-
|
|
9
|
-
if (returnCode !== 0) {
|
|
10
|
-
console.log(wrapInColor('Environment setup did not complete successfully.', ANSI_COLORS.YELLOW_COLOR));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const command = 'dev_setup';
|
|
15
|
-
export const describe = 'Sets up the development environment for Valdi';
|
|
16
|
-
export const builder = () => {};
|
|
17
|
-
export const handler = makeCommandHandler(valdiSetup);
|