@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.
Files changed (160) hide show
  1. package/README.md +12 -3
  2. package/bundled-skills/CONTRIBUTING_SKILLS.md +74 -0
  3. package/bundled-skills/registry.json +20 -0
  4. package/bundled-skills/skills/valdi-android/skill.md +89 -0
  5. package/bundled-skills/skills/valdi-async/skill.md +246 -0
  6. package/bundled-skills/skills/valdi-async/tests/BUILD.bazel +19 -0
  7. package/bundled-skills/skills/valdi-async/tests/README.md +25 -0
  8. package/bundled-skills/skills/valdi-async/tests/src/reference.tsx +210 -0
  9. package/bundled-skills/skills/valdi-async/tests/tsconfig.json +1 -0
  10. package/bundled-skills/skills/valdi-bazel/skill.md +122 -0
  11. package/bundled-skills/skills/valdi-compiler/skill.md +108 -0
  12. package/bundled-skills/skills/valdi-component-tests/skill.md +430 -0
  13. package/bundled-skills/skills/valdi-component-tests/tests/BUILD.bazel +24 -0
  14. package/bundled-skills/skills/valdi-component-tests/tests/README.md +35 -0
  15. package/bundled-skills/skills/valdi-component-tests/tests/src/ProfileCard.tsx +38 -0
  16. package/bundled-skills/skills/valdi-component-tests/tests/test/ProfileCardTest.spec.tsx +107 -0
  17. package/bundled-skills/skills/valdi-component-tests/tests/tsconfig.json +1 -0
  18. package/bundled-skills/skills/valdi-cpp-runtime/skill.md +103 -0
  19. package/bundled-skills/skills/valdi-custom-view/skill.md +62 -0
  20. package/bundled-skills/skills/valdi-ios/skill.md +93 -0
  21. package/bundled-skills/skills/valdi-migrate/skill.md +175 -0
  22. package/bundled-skills/skills/valdi-migrate/tests/BUILD.bazel +23 -0
  23. package/bundled-skills/skills/valdi-migrate/tests/README.md +70 -0
  24. package/bundled-skills/skills/valdi-migrate/tests/check_antipatterns.py +89 -0
  25. package/bundled-skills/skills/valdi-migrate/tests/compose_example.kt +94 -0
  26. package/bundled-skills/skills/valdi-migrate/tests/flutter_example.dart +129 -0
  27. package/bundled-skills/skills/valdi-migrate/tests/react_example.tsx +98 -0
  28. package/bundled-skills/skills/valdi-migrate/tests/src/expected_valdi.tsx +267 -0
  29. package/bundled-skills/skills/valdi-migrate/tests/tsconfig.json +3 -0
  30. package/bundled-skills/skills/valdi-overview/skill.md +63 -0
  31. package/bundled-skills/skills/valdi-perf/skill.md +197 -0
  32. package/bundled-skills/skills/valdi-perf/tests/BUILD.bazel +19 -0
  33. package/bundled-skills/skills/valdi-perf/tests/README.md +26 -0
  34. package/bundled-skills/skills/valdi-perf/tests/src/reference.tsx +202 -0
  35. package/bundled-skills/skills/valdi-perf/tests/tsconfig.json +1 -0
  36. package/bundled-skills/skills/valdi-polyglot-module/skill.md +85 -0
  37. package/bundled-skills/skills/valdi-setup/skill.md +129 -0
  38. package/bundled-skills/skills/valdi-testing/skill.md +65 -0
  39. package/bundled-skills/skills/valdi-tsx/skill.md +385 -0
  40. package/bundled-skills/skills/valdi-tsx/tests/BUILD.bazel +19 -0
  41. package/bundled-skills/skills/valdi-tsx/tests/README.md +29 -0
  42. package/bundled-skills/skills/valdi-tsx/tests/src/reference.tsx +173 -0
  43. package/bundled-skills/skills/valdi-tsx/tests/tsconfig.json +1 -0
  44. package/dist/commands/bootstrap.js +0 -7
  45. package/dist/commands/newModule.js +10 -14
  46. package/dist/commands/skills.js +16 -0
  47. package/dist/commands/skills_commands/create.js +125 -0
  48. package/dist/commands/skills_commands/install.js +96 -0
  49. package/dist/commands/skills_commands/list.js +83 -0
  50. package/dist/commands/skills_commands/remove.js +41 -0
  51. package/dist/commands/skills_commands/update.js +59 -0
  52. package/dist/core/constants.js +0 -1
  53. package/dist/setup/versions.js +1 -1
  54. package/dist/utils/skillsAdapters.js +140 -0
  55. package/dist/utils/skillsRegistry.js +40 -0
  56. package/package.json +6 -1
  57. package/.bazelignore +0 -2
  58. package/.bootstrap/apps/cli_application/BUILD.bazel.template +0 -7
  59. package/.bootstrap/apps/cli_application/modules/{{MODULE_NAME}}/BUILD.bazel.template +0 -11
  60. package/.bootstrap/apps/cli_application/modules/{{MODULE_NAME}}/src/index.ts +0 -1
  61. package/.bootstrap/apps/ui_application/.eslint.rc +0 -27
  62. package/.bootstrap/apps/ui_application/BUILD.bazel.template +0 -19
  63. package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/BUILD.bazel.template +0 -21
  64. package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/res/valdi@3x.png +0 -0
  65. package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/src/App.tsx +0 -133
  66. package/.bootstrap/apps/ui_application/package.json +0 -24
  67. package/.bootstrap/modules/cpp_bridge_module/BUILD.bazel.template +0 -21
  68. package/.bootstrap/modules/cpp_bridge_module/cpp/CalculatorModuleFactory.cpp.template +0 -28
  69. package/.bootstrap/modules/cpp_bridge_module/src/Calculator.d.ts +0 -4
  70. package/.bootstrap/modules/ios_android_bridge_module/BUILD.bazel.template +0 -39
  71. package/.bootstrap/modules/ios_android_bridge_module/android/CalculatorModuleFactory.kt.template +0 -18
  72. package/.bootstrap/modules/ios_android_bridge_module/ios/SCCCalculatorModuleFactory.m.template +0 -31
  73. package/.bootstrap/modules/ios_android_bridge_module/src/Calculator.d.ts +0 -4
  74. package/.bootstrap/modules/ios_android_view_module/BUILD.bazel.template +0 -41
  75. package/.bootstrap/modules/ios_android_view_module/android/CircleView.kt.template +0 -42
  76. package/.bootstrap/modules/ios_android_view_module/android/CircleViewAttributesBinder.kt.template +0 -60
  77. package/.bootstrap/modules/ios_android_view_module/ios/SCCCircleView.h +0 -6
  78. package/.bootstrap/modules/ios_android_view_module/ios/SCCCircleView.m +0 -82
  79. package/.bootstrap/modules/ios_android_view_module/src/Circle.tsx.template +0 -15
  80. package/.bootstrap/modules/ui_component/BUILD.bazel.template +0 -34
  81. package/.bootstrap/modules/ui_component/src/NewModuleComponent.tsx +0 -45
  82. package/.config/copyconfig.json +0 -10
  83. package/.editorconfig +0 -21
  84. package/.eslintignore +0 -1
  85. package/.eslintrc.js +0 -72
  86. package/.github/README.md +0 -164
  87. package/.metadata/.bazelrc.template +0 -91
  88. package/.metadata/.bazelversion.template +0 -1
  89. package/.metadata/.cursorrules.template +0 -60
  90. package/.metadata/.editorconfig.template +0 -37
  91. package/.metadata/.eslintrc.js.template +0 -27
  92. package/.metadata/.gitignore.template +0 -4
  93. package/.metadata/.prettierrc.json.template +0 -7
  94. package/.metadata/.watchmanconfig.template +0 -8
  95. package/.metadata/AGENTS.md.template +0 -282
  96. package/.metadata/README.md.template +0 -31
  97. package/.metadata/WORKSPACE.template +0 -57
  98. package/.metadata/config.yaml.template +0 -1
  99. package/.metadata/package.json.template +0 -23
  100. package/.prettierignore +0 -2
  101. package/.prettierrc.json +0 -7
  102. package/LINUX_COMPATIBILITY.md +0 -248
  103. package/prettier.config.js +0 -4
  104. package/scripts/sync-agents-md.sh +0 -44
  105. package/scripts/update-agents-templates.ts +0 -170
  106. package/spec/support/jasmine.json +0 -6
  107. package/src/commands/bootstrap.ts +0 -410
  108. package/src/commands/build.ts +0 -89
  109. package/src/commands/devSetup.ts +0 -17
  110. package/src/commands/doctor.ts +0 -1832
  111. package/src/commands/export.ts +0 -131
  112. package/src/commands/hotreload.ts +0 -108
  113. package/src/commands/install.ts +0 -93
  114. package/src/commands/lint.ts +0 -15
  115. package/src/commands/lint_commands/lintCheck.ts +0 -53
  116. package/src/commands/lint_commands/lintFormat.ts +0 -49
  117. package/src/commands/log.ts +0 -108
  118. package/src/commands/newModule.ts +0 -286
  119. package/src/commands/package.ts +0 -102
  120. package/src/commands/projectsync.ts +0 -488
  121. package/src/commands/test.ts +0 -68
  122. package/src/core/constants.ts +0 -98
  123. package/src/core/errors.ts +0 -10
  124. package/src/index.ts +0 -27
  125. package/src/setup/DevSetupHelper.ts +0 -290
  126. package/src/setup/linuxSetup.ts +0 -261
  127. package/src/setup/macOSSetup.ts +0 -156
  128. package/src/setup/setupEntryPoint.ts +0 -64
  129. package/src/setup/versions.ts +0 -8
  130. package/src/utils/ArgumentsResolver.ts +0 -23
  131. package/src/utils/BazelClient.ts +0 -285
  132. package/src/utils/Digraph.ts +0 -81
  133. package/src/utils/LoadingIndicator.ts +0 -43
  134. package/src/utils/applicationUtils.ts +0 -276
  135. package/src/utils/buildInfo.ts +0 -99
  136. package/src/utils/byString.ts +0 -3
  137. package/src/utils/cliUtils.ts +0 -112
  138. package/src/utils/copyBootstrapFiles.ts +0 -30
  139. package/src/utils/deviceUtils.ts +0 -76
  140. package/src/utils/errorUtils.ts +0 -63
  141. package/src/utils/fileUtils.ts +0 -257
  142. package/src/utils/githubUtils.ts +0 -102
  143. package/src/utils/jsonUtils.ts +0 -30
  144. package/src/utils/lintUtils.ts +0 -190
  145. package/src/utils/linuxDistro.spec.ts +0 -219
  146. package/src/utils/linuxDistro.ts +0 -326
  147. package/src/utils/logUtils.ts +0 -9
  148. package/src/utils/pathUtils.ts +0 -12
  149. package/src/utils/stringUtils.spec.ts +0 -95
  150. package/src/utils/stringUtils.ts +0 -103
  151. package/src/utils/tempDir.ts +0 -24
  152. package/src/utils/zipUtils.ts +0 -14
  153. package/test/ValdiSmokeTest.ts +0 -279
  154. package/test/helpers/AsyncHelpers.ts +0 -113
  155. package/test/helpers/CommandHelpers.ts +0 -37
  156. package/test/helpers/ProjectHelpers.ts +0 -153
  157. package/test/helpers/StreamHelpers.ts +0 -37
  158. package/test/helpers/TypeScriptClient.ts +0 -217
  159. package/tsconfig.dist.json +0 -8
  160. package/tsconfig.json +0 -42
@@ -1,15 +0,0 @@
1
- import 'valdi_tsx/src/JSX';
2
- import { View } from 'valdi_tsx/src/NativeTemplateElements';
3
-
4
- export interface CircleViewModel extends View {
5
- color: string;
6
- thickness: number;
7
- }
8
-
9
- export function Circle(viewModel: CircleViewModel) {
10
- <custom-view
11
- iosClass={'SCCCircleView'}
12
- androidClass={'com.snap.modules.{{MODULE_NAME}}.CircleView'}
13
- {...viewModel}
14
- />;
15
- }
@@ -1,34 +0,0 @@
1
- # Usage Instructions for This Module
2
- #
3
- # Step 1: Add this module to your `BUILD.bazel` file dependencies:
4
- # `//src/valdi/{{MODULE_NAME}}`
5
- #
6
- # Step 2: Import the module in your `.tsx` file:
7
- # `import { NewModuleComponent } from '{{MODULE_NAME}}/src/NewModuleComponent';`
8
- #
9
- # Step 3: Render the component in your `onRender()` function:
10
- # `<NewModuleComponent title={'Valdi'}/>`
11
-
12
- load("@valdi//bzl/valdi:valdi_module.bzl", "valdi_module")
13
-
14
- valdi_module(
15
- name = "{{MODULE_NAME}}",
16
- srcs = glob(
17
- [
18
- "src/**/*.ts",
19
- "src/**/*.tsx",
20
- ],
21
- ),
22
- res = glob([
23
- "res/**/*.jpeg",
24
- "res/**/*.jpg",
25
- "res/**/*.png",
26
- "res/**/*.svg",
27
- "res/**/*.webp",
28
- ]),
29
- visibility = ["//visibility:public"],
30
- deps = [
31
- "@valdi//src/valdi_modules/src/valdi/valdi_core",
32
- "@valdi//src/valdi_modules/src/valdi/valdi_tsx",
33
- ],
34
- )
@@ -1,45 +0,0 @@
1
- import { Component } from 'valdi_core/src/Component';
2
- import { Label, View } from 'valdi_tsx/src/NativeTemplateElements';
3
- import { systemFont } from 'valdi_core/src/SystemFont';
4
- import { Style } from 'valdi_core/src/Style';
5
-
6
- export interface NewModuleViewModel {
7
- title: string;
8
- }
9
-
10
- export class NewModuleComponent extends Component<NewModuleViewModel> {
11
- onCreate() {
12
- // Called when the component is created in the render-tree
13
- // Used to prepare some resources, precomputed values or subscribe to observables
14
- }
15
- onDestroy() {
16
- // Called the component is not longer in the render-tree
17
- // Used to dispose of resources and observables
18
- }
19
- onViewModelUpdate(previous?: NewModuleViewModel) {
20
- // Called every time the view model changes
21
- // Used to trigger some computations, typically used for asynchronous operations,
22
- // that would then impact the internal component state
23
- }
24
-
25
- onRender(): void {
26
- // Called every time the component needs to be rendered
27
- // Used to define child components and child render-tree
28
- // Can access "this.viewModel" that contains the current component parameters values
29
- <view style={styles.root}>
30
- <label style={styles.label} value={this.viewModel.title} />
31
- </view>;
32
- }
33
- }
34
-
35
- const styles = {
36
- root: new Style<View>({
37
- backgroundColor: 'red',
38
- width: '100%',
39
- height: '100%',
40
- }),
41
- label: new Style<Label>({
42
- font: systemFont(20),
43
- color: 'white',
44
- }),
45
- };
@@ -1,10 +0,0 @@
1
- {
2
- "blacklist": [
3
- "open_source/\\.aswb",
4
- "open_source/bazel-.*",
5
- "open_source/cli",
6
- "open_source/docs",
7
- "open_source/\\.git.*",
8
- "\\.DS_Store"
9
- ]
10
- }
package/.editorconfig DELETED
@@ -1,21 +0,0 @@
1
- # EditorConfig is awesome: http://EditorConfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- [*]
7
- # Unix-style newlines with a newline ending every file
8
- end_of_line = lf
9
- insert_final_newline = true
10
- trim_trailing_whitespace = true
11
-
12
- # 4 spaces for indentation
13
- indent_size = 4
14
- indent_style = space
15
-
16
- # 120 characters max per line
17
- max_line_length = 120
18
-
19
- # some files use 2 spaces for indentation
20
- [*.{json,yml,yaml}]
21
- indent_size = 2
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- /**/*.js
package/.eslintrc.js DELETED
@@ -1,72 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: '@typescript-eslint/parser',
4
- parserOptions: {
5
- tsconfigRootDir: __dirname,
6
- project: ['./tsconfig.json'],
7
- },
8
- plugins: ['@typescript-eslint', 'import'],
9
- extends: [
10
- 'eslint:recommended',
11
- 'plugin:@typescript-eslint/recommended',
12
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
13
- 'plugin:import/recommended',
14
- 'plugin:import/typescript',
15
- 'plugin:unicorn/recommended',
16
- 'prettier',
17
- ],
18
- rules: {
19
- eqeqeq: 'error',
20
- '@typescript-eslint/consistent-type-assertions': [
21
- 'warn',
22
- {
23
- assertionStyle: 'as',
24
- objectLiteralTypeAssertions: 'never',
25
- },
26
- ],
27
- '@typescript-eslint/consistent-type-imports': [
28
- 'error',
29
- {
30
- prefer: 'type-imports',
31
- },
32
- ],
33
- '@typescript-eslint/member-ordering': 'warn',
34
- '@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
35
- '@typescript-eslint/prefer-ts-expect-error': 'error',
36
- '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
37
- '@typescript-eslint/no-misused-promises': [
38
- 'error',
39
- {
40
- checksVoidReturn: false,
41
- },
42
- ],
43
- '@typescript-eslint/no-empty-function': 'off',
44
- 'import/default': 'off',
45
- 'import/namespace': 'off',
46
- 'import/no-unresolved': 'off',
47
- 'import/no-duplicates': 'error',
48
- 'import/no-named-as-default': 'error',
49
- 'import/order': ['warn', { alphabetize: { order: 'asc' } }],
50
- 'unicorn/filename-case': [
51
- 'error',
52
- {
53
- cases: {
54
- camelCase: true,
55
- pascalCase: true,
56
- },
57
- ignore: ['^.*CLI.*'],
58
- },
59
- ],
60
- 'unicorn/no-array-for-each': 'off',
61
- 'unicorn/no-array-reduce': 'off',
62
- 'unicorn/no-for-loop': 'off',
63
- 'unicorn/no-null': 'off',
64
- 'unicorn/prefer-node-protocol': 'off',
65
- 'unicorn/prefer-query-selector': 'off',
66
- 'unicorn/prefer-ternary': 'off',
67
- 'unicorn/prefer-top-level-await': 'off',
68
- 'unicorn/prefer-spread': 'off',
69
- 'unicorn/prevent-abbreviations': 'off',
70
- 'sort-imports': ['error', { allowSeparatedGroups: true, ignoreDeclarationSort: true }],
71
- },
72
- };
package/.github/README.md DELETED
@@ -1,164 +0,0 @@
1
- # GitHub Actions CI for Valdi CLI
2
-
3
- ## Workflows
4
-
5
- ### 1. `test-cli-linux.yml` - Linux Distribution Testing
6
-
7
- Tests the CLI on multiple Linux distributions to ensure proper distribution detection and package management.
8
-
9
- **Triggers:**
10
- - Pull requests touching CLI source files
11
- - Pushes to main branch
12
- - Manual workflow dispatch
13
-
14
- **Test Matrix:**
15
- - Ubuntu 22.04
16
- - Ubuntu 24.04
17
- - Fedora 39
18
- - Fedora 40
19
-
20
- **Tests:**
21
- 1. **Distribution Detection**
22
- - Verifies correct detection of distribution type (Debian, RedHat)
23
- - Validates package manager identification (apt, dnf)
24
- - Checks distribution name parsing
25
-
26
- 2. **Package Name Mappings**
27
- - Tests all common package mappings (git, npm, Java, etc.)
28
- - Ensures correct package names for each distribution
29
- - Validates fallback behavior
30
-
31
- 3. **Install Command Generation**
32
- - Tests single and multiple package installation commands
33
- - Verifies correct package manager usage
34
- - Validates sudo requirement handling
35
-
36
- 4. **Git-LFS Setup Detection**
37
- - Tests whether repository setup is needed
38
- - Validates setup command generation
39
- - Checks Debian vs RPM script selection
40
-
41
- 5. **`valdi doctor` Integration**
42
- - Runs the doctor command on each distribution
43
- - Verifies it executes without errors
44
- - Checks distribution-specific fix commands
45
-
46
- 6. **Unit Tests**
47
- - Runs Jasmine unit tests for `linuxDistro` utilities
48
- - Validates ESLint compliance
49
-
50
- **Example Run:**
51
-
52
- ```bash
53
- # Locally test distribution detection (requires Docker)
54
- docker run -it ubuntu:22.04 bash
55
- # Install Node.js, clone repo, run tests
56
-
57
- # Or use act to run GitHub Actions locally
58
- act -j test-distribution-detection -P ubuntu-22.04=ubuntu:22.04
59
- ```
60
-
61
- ### 2. `bzl-changes.yml` - Main CI Pipeline (Updated)
62
-
63
- **Changes:**
64
- - Added `test-cli-linux` job to test CLI on Linux containers
65
- - Updated path triggers to include `npm_modules/cli/src/**`
66
- - Tests run alongside existing Bazel validation
67
-
68
- **Linux Job:**
69
- - Tests CLI on Ubuntu and Fedora
70
- - Validates distribution detection
71
- - Ensures package mappings work correctly
72
-
73
- ### 3. `publish-npm.yml` - NPM Publishing
74
-
75
- **No changes needed** - builds and publishes on Ubuntu, which now benefits from the improved Linux support.
76
-
77
- ## Running Tests Locally
78
-
79
- ### Test Distribution Detection
80
-
81
- ```bash
82
- # On your Linux machine
83
- cd npm_modules/cli
84
- npm install
85
- npm run build
86
-
87
- # Test distribution detection
88
- node -e "
89
- const distro = require('./dist/utils/linuxDistro');
90
- const detected = distro.detectLinuxDistro();
91
- console.log('Detected:', detected);
92
- "
93
-
94
- # Run unit tests
95
- npx jasmine dist/utils/linuxDistro.spec.js
96
- ```
97
-
98
- ### Test on Multiple Distributions (Docker)
99
-
100
- ```bash
101
- # Ubuntu 22.04
102
- docker run --rm -v $(pwd):/workspace -w /workspace node:22-slim bash -c "
103
- apt-get update && apt-get install -y git
104
- cd npm_modules/cli
105
- npm install && npm run build
106
- node -e \"const d = require('./dist/utils/linuxDistro'); console.log(d.detectLinuxDistro())\"
107
- "
108
-
109
- # Fedora 39
110
- docker run --rm -v $(pwd):/workspace -w /workspace node:22-slim bash -c "
111
- dnf install -y git
112
- cd npm_modules/cli
113
- npm install && npm run build
114
- node -e \"const d = require('./dist/utils/linuxDistro'); console.log(d.detectLinuxDistro())\"
115
- "
116
- ```
117
-
118
- ## CI Badge
119
-
120
- Add this to your README to show CI status:
121
-
122
- ```markdown
123
- ![Test CLI on Linux](https://github.com/Snapchat/Valdi/actions/workflows/test-cli-linux.yml/badge.svg)
124
- ```
125
-
126
- ## Troubleshooting CI Failures
127
-
128
- ### Distribution detection fails
129
- - Check `/etc/os-release` file exists in container
130
- - Verify `ID` and `ID_LIKE` fields are present
131
- - Check package manager is in PATH
132
-
133
- ### Package mappings incorrect
134
- - Update `getCommonPackageMappings()` in `src/utils/linuxDistro.ts`
135
- - Add distribution-specific package names
136
- - Update unit tests to match
137
-
138
- ### `valdi doctor` fails
139
- - Check if missing dependencies are expected for CI
140
- - Verify error handling works correctly
141
- - Ensure fix commands use correct distribution detection
142
-
143
- ## Adding New Distributions to CI
144
-
145
- To add a new distribution to the test matrix:
146
-
147
- 1. Edit `.github/workflows/test-cli-linux.yml`
148
- 2. Add to the matrix:
149
- ```yaml
150
- - distro: new-distro-name
151
- container: distro:version
152
- expected_type: debian|redhat|arch|suse
153
- expected_pm: apt|dnf|pacman|zypper
154
- expected_name_pattern: "Distro Name"
155
- ```
156
- 3. Ensure the distribution has Node.js 22+ support
157
- 4. Test locally with Docker first
158
-
159
- ## Notes
160
-
161
- - **Arch Linux** and **openSUSE** are not in CI due to container availability/complexity
162
- - CI uses Docker containers for isolation
163
- - Tests are read-only - we don't actually install packages in CI
164
- - Manual testing on physical distributions is still recommended for full coverage
@@ -1,91 +0,0 @@
1
- # No bzlmod yet
2
- common --noenable_bzlmod
3
-
4
- common --bes_instance_name=client
5
- common --enable_platform_specific_config
6
-
7
- # Disable workers for repo fetching to prevent OOM
8
- common --experimental_worker_for_repo_fetching=off
9
-
10
- # android configuration
11
- # Expose AndroidResourceInfo provider to Kotlin rules
12
- common --experimental_google_legacy_api=true
13
- common --experimental_enable_android_migration_apis=true
14
- common --incompatible_java_common_parameters=false
15
-
16
- # Flags for compilation
17
- common --define enable_web=true
18
-
19
- build --tool_java_language_version=11
20
- build --java_language_version=11
21
-
22
- ## Disable sandboxing for macs, both laptops and in CI; the performance hit is much too high.
23
- build:macos --spawn_strategy=local
24
- build:linux --sandbox_writable_path=/var/tmp
25
-
26
- # common cc configuration
27
- build --cxxopt=-std=c++20
28
- build --cxxopt=-Wno-ambiguous-reversed-operator
29
- build --cxxopt=-D_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
30
- build --host_cxxopt=-std=c++20
31
-
32
- ## we need to disable this due to a bug in bazel
33
- ## see https://github.com/bazelbuild/bazel/issues/12381
34
- build --incompatible_use_specific_tool_files=false
35
- build --incompatible_enable_cc_toolchain_resolution
36
-
37
- # iOS and Apple cc changes and hacks
38
- ## For Objective-C source files
39
- build --per_file_copt=.*\.mm\$@-std=c++20
40
- build --host_per_file_copt=.*\.mm\$@-std=c++20
41
- build --ios_minimum_os=12.0
42
-
43
- ## TODO: (dchapp) this is currently needed otherwise -O0 and -DDEBUG=1 get passed to compilations of .mm/.m for production flavor builds
44
- build --experimental_objc_fastbuild_options=""
45
- ## HACK inject this in the default toolchain which is only used on macos until we switch to bazel_toolchains
46
- build:macos --copt=-fvisibility=hidden
47
-
48
- # java configuration
49
- ## Disable some java checks for now, djinni generates code that errors out
50
- build --javacopt=-XepDisableAllChecks
51
- build --java_runtime_version=11
52
- build --tool_java_runtime_version=17
53
-
54
- build --flag_alias=snap_flavor=@snap_platforms//flavors:snap_flavor
55
- build --snap_flavor=platform_development
56
-
57
- build --android_crosstool_top=@androidndk//:toolchain
58
- build --define=android_dexmerger_tool=d8_dexmerger
59
- build --define=android_incremental_dexing_tool=d8_dexbuilder
60
- build --define=android_standalone_dexing_tool=d8_compat_dx
61
- build --incremental_dexing
62
-
63
- # Disable 3rd party libs warnings
64
- build --per_file_copt=external/com_github_grpc_grpc/.*\$@-Wno-everything
65
- build --per_file_copt=external/snap_protobuf/.*\$@-Wno-everything
66
- build --per_file_copt=external/boringssl/.*\$@-Wno-everything
67
- build --per_file_copt=external/com_github_google_flatbuffers/.*\$@-Wno-everything
68
-
69
- # Enable persistent worker for Valdi compilation
70
- build --strategy=ValdiCompile=worker
71
-
72
- ## Disable sandboxing for macs, both laptops and in CI; the performance hit is much too high.
73
- build:macos --spawn_strategy=local
74
- build:linux --sandbox_writable_path=/var/tmp
75
-
76
- # Disable disk cache to save disk space
77
- # https://docs.google.com/document/d/1N8W_M83n9jhMi7pgUhXuEuxypb3dmlHBu_CG_eXipXI/edit?usp=sharing
78
- build --disk_cache=""
79
-
80
- # common build configuration
81
- build --experimental_generate_json_trace_profile
82
- # enable grpc log
83
- build --remote_grpc_log=/tmp/snap_client_grpc.log
84
- build --experimental_reuse_sandbox_directories
85
-
86
- # Default JS engine
87
- build --flag_alias=valdi_js_engine=@valdi//bzl/valdi:js_engine
88
- build --valdi_js_engine=hermes
89
-
90
- # Valdi Open Source Flags
91
- build --define=open_source_build=true
@@ -1 +0,0 @@
1
- 7.2.1
@@ -1,60 +0,0 @@
1
- # Valdi Open Source - Cursor Rules
2
-
3
- ## ⚠️ Open Source Project
4
-
5
- This is an open source project. Never commit secrets, API keys, or proprietary information.
6
-
7
- ## 🚨 CRITICAL: This is NOT React!
8
-
9
- Valdi uses TSX/JSX syntax but is **fundamentally different from React**.
10
-
11
- **Common AI mistakes:**
12
- - ❌ Suggesting `useState`, `useEffect`, `useContext` (don't exist!)
13
- - ❌ Functional components (don't exist!)
14
- - ❌ `this.props` (should be `this.viewModel`)
15
- - ❌ `markNeedsRender()`, `onMount()`, `onUpdate()` (wrong names/don't exist!)
16
-
17
- **Correct Valdi:**
18
- - ✅ `class MyComponent extends StatefulComponent`
19
- - ✅ `state = {}` + `this.setState()`
20
- - ✅ `this.viewModel` for props
21
- - ✅ `onCreate()`, `onViewModelUpdate()`, `onDestroy()` lifecycle
22
-
23
- ## 📁 Context-Specific Rules
24
-
25
- Cursor automatically loads additional rules based on where you're working:
26
-
27
- | Working In | See |
28
- |-----------|-----|
29
- | TypeScript/TSX components | `.cursor/rules/typescript-tsx.md` |
30
- | Swift compiler | `.cursor/rules/compiler.md` |
31
- | C++ runtime | `.cursor/rules/cpp-runtime.md` |
32
- | Android (Kotlin) | `.cursor/rules/android.md` |
33
- | iOS (Objective-C) | `.cursor/rules/ios.md` |
34
- | Bazel files | `.cursor/rules/bazel.md` |
35
- | Tests | `.cursor/rules/testing.md` |
36
-
37
- **→ Check `.cursor/rules/README.md` for the full list**
38
-
39
- ## Quick Commands
40
-
41
- ```bash
42
- bazel build //... # Build everything
43
- bazel test //... # Run all tests
44
- valdi install ios # Build & install iOS app
45
- valdi hotreload # Start hot reload
46
- ```
47
-
48
- ## Exported library / host apps
49
-
50
- When integrating an exported AAR or xcframework into a host app:
51
-
52
- - **Android:** Generated view classes use package **`com.snap.modules.<module_name>`** (e.g. `com.snap.modules.test_test.App`), not `com.snap.valdi.modules`. `System.loadLibrary(...)` must use the exact `valdi_exported_library()` target name (e.g. `test_test_export`).
53
- - **iOS:** Root view class is **`<module_name><RootComponentName>`** where `module_name` is the Valdi **module name** from `valdi_module()` (snake_case, e.g. `test_test` → `test_testApp`), not `ios_bundle_name`. For export use **`--library test_test_export_ios`** (platform-suffixed target). Embed the xcframework into the app's **Frameworks** folder (Embed Frameworks phase → destination **Frameworks**, not PlugIns), or the app crashes at launch with "Library not loaded: @rpath/...framework/...".
54
-
55
- ## More Information
56
-
57
- - **Comprehensive guide**: `/AGENTS.md` (621 lines)
58
- - **AI tooling**: `/docs/docs/ai-tooling.md`
59
- - **Support**: `/SUPPORT.md`
60
- - **Discord**: https://discord.gg/uJyNEeYX2U
@@ -1,37 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- insert_final_newline = true
7
- trim_trailing_whitespace = true
8
-
9
- [*.{ts,tsx,js,jsx}]
10
- indent_style = space
11
- indent_size = 2
12
-
13
- [*.{cpp,hpp,h,cc}]
14
- indent_style = space
15
- indent_size = 4
16
-
17
- [*.{swift,kt,java}]
18
- indent_style = space
19
- indent_size = 4
20
-
21
- [*.{yml,yaml,json}]
22
- indent_style = space
23
- indent_size = 2
24
-
25
- [*.{bzl,bazel,BUILD}]
26
- indent_style = space
27
- indent_size = 4
28
-
29
- [*.md]
30
- trim_trailing_whitespace = false
31
-
32
- [*.{mm,m}]
33
- indent_style = space
34
- indent_size = 4
35
-
36
- [Makefile]
37
- indent_style = tab
@@ -1,27 +0,0 @@
1
-
2
- module.exports = {
3
- root: true,
4
- parser: '@typescript-eslint/parser',
5
- parserOptions: {
6
- tsconfigRootDir: __dirname,
7
- project: ['./src/valdi/_configs/eslint.tsconfig.json'],
8
- },
9
- plugins: ['@typescript-eslint', 'unused-imports', 'rxjs', 'prettier', '@snapchat/eslint-plugin-valdi'],
10
- extends: [
11
- 'eslint:recommended',
12
- 'plugin:@typescript-eslint/recommended',
13
- 'plugin:import/recommended',
14
- 'plugin:import/typescript',
15
- 'prettier',
16
- ],
17
- rules: {
18
- '@snapchat/valdi/attributed-text-no-array-assignment': 'error',
19
- '@snapchat/valdi/jsx-no-lambda': 'error',
20
- '@snapchat/valdi/assign-timer-id': 'error',
21
- '@snapchat/valdi/only-const-enum': 'off',
22
- '@snapchat/valdi/no-implicit-index-import': 'error',
23
- '@snapchat/valdi/mutate-state-without-set-state': 'error',
24
- '@snapchat/valdi/no-import-from-test-outside-test-dir': 'error',
25
- '@snapchat/valdi/no-declare-test-without-describe': 'error',
26
- },
27
- };
@@ -1,4 +0,0 @@
1
- *.DS_Store
2
-
3
- bazel-*
4
- node_modules
@@ -1,7 +0,0 @@
1
- {
2
- "printWidth": 120,
3
- "singleQuote": true,
4
- "jsxSingleQuote": true,
5
- "arrowParens": "avoid",
6
- "trailingComma": "all"
7
- }
@@ -1,8 +0,0 @@
1
- {
2
- "root_files": [".watchmanconfig"],
3
- "ignore_dirs": [
4
- "bazel-out",
5
- "bazel-bin",
6
- "bazel-testlogs"
7
- ]
8
- }