Skip to content

Commit 8fd87fd

Browse files
author
GitHub Action Sync Bot
committed
Update from source repository (workflow run: 19356491838) (PR #79) (commit: 4c95e97127994253c2a96b80d75216c5cf8dbb49) (branch: main)
0 parents  commit 8fd87fd

641 files changed

Lines changed: 83561 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codesandbox/tasks.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
// These tasks will run in order when initializing your CodeSandbox project.
3+
"setupTasks": [
4+
{
5+
"name": "Installing Dependencies",
6+
"command": "npm install"
7+
}
8+
],
9+
10+
// These tasks can be run from CodeSandbox. Running one will open a log in the app.
11+
"tasks": {
12+
"dev": {
13+
"name": "dev",
14+
"command": "npm run dev",
15+
"runAtStart": true,
16+
"preview": {
17+
"port": 5173
18+
}
19+
},
20+
"build": {
21+
"name": "build",
22+
"command": "npm run build",
23+
"runAtStart": false
24+
},
25+
"lint": {
26+
"name": "lint",
27+
"command": "npm run lint",
28+
"runAtStart": false
29+
},
30+
"preview": {
31+
"name": "preview",
32+
"command": "npm run preview",
33+
"runAtStart": false
34+
}
35+
}
36+
}
37+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Jenkins Trigger - Security Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
jenkins-security-check:
12+
uses: thoughtspot/workflows/.github/workflows/jenkins-trigger.yml@main
13+
secrets:
14+
JENKINS_USER: ${{ secrets.JENKINS_USER }}
15+
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}

.github/workflows/sonar-scan.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Sonar Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
- '*'
8+
pull_request:
9+
types: [opened, synchronize, reopened]
10+
11+
jobs:
12+
sonar:
13+
uses: thoughtspot/workflows/.github/workflows/sonar-scan.yml@main
14+
secrets:
15+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
16+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
17+
SONAR_PROJECTKEY: ${{ secrets.SONAR_PROJECTKEY }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Sync Repository to Public Mirror
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
# No branches filter means it will trigger for ALL branches
7+
# If you want to sync main branch then add:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
inputs:
12+
force_sync:
13+
description: 'Force sync all branches (WARNING: This will sync all branches)'
14+
required: false
15+
default: false # CRITICAL FIX: Changed from 'true' to false
16+
type: boolean
17+
public_repo_name:
18+
description: 'Public repository name (leave empty to auto-derive by removing "-private")'
19+
required: false
20+
type: string
21+
target_branches:
22+
description: 'Comma-separated list of specific branches to sync (leave empty to sync merged branch only)'
23+
required: false
24+
type: string
25+
26+
# Branch-level concurrency control - allows parallel syncs for different branches
27+
concurrency:
28+
group: sync-public-mirror-${{ github.repository }}-${{ github.event.pull_request.base.ref || github.event.client_payload.branch || github.event.inputs.target_branches || 'default' }}
29+
cancel-in-progress: false # Queue per branch to ensure all changes are synced
30+
31+
jobs:
32+
call-sync-workflow:
33+
# Only run this job when the PR was merged, not just closed, OR when manually triggered, OR via repository_dispatch
34+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch'
35+
uses: thoughtspot/workflows/.github/workflows/sync-to-public-mirror.yml@main
36+
with:
37+
# CRITICAL FIX: Only force sync when explicitly requested, not on every PR
38+
force_sync: ${{ github.event.inputs.force_sync == true || (github.event_name == 'repository_dispatch' && github.event.client_payload.force_sync == true) }}
39+
40+
public_repo_name: ${{ github.event.inputs.public_repo_name || github.event.client_payload.public_repo_name || '' }}
41+
42+
# Optimization: Pass specific target branches instead of syncing all
43+
target_branches: ${{ github.event.inputs.target_branches || github.event.client_payload.target_branches || (github.event_name == 'pull_request' && github.event.pull_request.base.ref) || '' }}
44+
45+
# Enhanced context for better logging and traceability
46+
trigger_type: ${{ github.event_name }}
47+
pr_number: ${{ github.event.pull_request.number || github.event.client_payload.pr_number || '' }}
48+
49+
# CRITICAL FIX: Use base.ref (target branch) instead of head.ref (source branch)
50+
merged_branch: ${{ github.event.pull_request.base.ref || github.event.client_payload.branch || '' }}
51+
52+
merge_commit_sha: ${{ github.event.pull_request.merge_commit_sha || github.event.client_payload.commit_sha || github.sha }}
53+
secrets:
54+
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}

.gitignore

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
.vscode
125+
126+
# yarn v2
127+
.yarn/cache
128+
.yarn/unplugged
129+
.yarn/build-state.yml
130+
.yarn/install-state.gz
131+
.pnp.*
132+
.vercel
133+
.venv
134+
*.egg-info
135+
__pycache__
136+
.env*.local

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ThoughtSpot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<p align="center">
2+
<img src="https://raw.githubusercontent.com/thoughtspot/visual-embed-sdk/main/static/doc-images/images/TS-Logo-black-no-bg.svg" width=120 align="center" alt="ThoughtSpot" />
3+
<h3 align="center">ThoughtSpot Developer Examples</h3>
4+
</p>
5+
6+
<br />
7+
<br />
8+
9+
Enjoy our curated collection of examples and solutions. Use these patterns to integrate robust and scalable analytics into your own applications with ThoughtSpot.
10+
We're going to be shipping new examples weekly. Stay tuned!
11+
12+
- [Visual Embed](/visual-embed) – Drop in ThoughtSpot Analytics components (Plain JS/React) for your web apps. [Learn more.](https://developers.thoughtspot.com/docs/getting-started)
13+
- [REST APIs](/rest-api) – Headless AI for BI, the power of ThoughtSpot's platform via APIs. [Learn more.](https://developers.thoughtspot.com/docs/rest-apis)
14+
- [Mobile](/mobile) - Embedded analytics in your own Mobile app. [Learn more.](https://developers.thoughtspot.com/docs)
15+
- [Solutions](/solutions) – Demos, Architectures, and Best Practices
16+
- [Starter](/starter) – Fully functional applications that encompass an idea as a robust starting point.
17+
18+
<br/>
19+
<br/>
20+
21+
### Contributing
22+
23+
Relevant mostly for ThoughtSpot employees and partners.
24+
25+
- All Web examples are in Typescript + Vite.
26+
- Examples must run with the latest version of the [Visual Embed SDK](https://www.npmjs.com/package/@thoughtspot/visual-embed-sdk).
27+
- All Backend examples in Typescript (no javascript), or other languages.
28+
29+
#### Adding a new example
30+
31+
To quickly start contributing with a new example, run the following commands:
32+
33+
```bash
34+
npm i
35+
npm run new-example
36+
```
37+
38+
All examples must comply with the following format:
39+
40+
- It must have a `.gitignore` similar to [utilities/plop-templates/ts/.gitignore](./utilities/plop-templates/ts/.gitignore)
41+
42+
- It must have a `README.md` similar to [utilities/plop-templates/ts/README.md](./plop-templates/example/README.md). The example has to include the following:
43+
- A codesandbox demo URL (all examples are viewable as a codesandbox at `https://githubbox.com/thoughtspot/developer-examples/tree/main/<path>/<to>/<example>`).
44+
45+
- Link to the relevant documentation for the features, the example is trying to showcase.
46+
47+
- If it requires environment variables, it must have a `.env` file and instructions on how to set them up.
48+
49+
- [Javascript] It must have a `package.json` similar to [utilities/plop-templates/ts/package.json](./utilities/plop-templates/ts/package.json). The license should be `MIT`

eslint.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
import pluginReact from "eslint-plugin-react";
5+
6+
7+
/** @type {import('eslint').Linter.Config[]} */
8+
export default [
9+
{files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
10+
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
11+
pluginJs.configs.recommended,
12+
...tseslint.configs.recommended,
13+
pluginReact.configs.flat.recommended,
14+
{
15+
settings: {
16+
react: {
17+
version: "detect",
18+
},
19+
},
20+
rules: {
21+
"react/react-in-jsx-scope": "off",
22+
"@typescript-eslint/no-explicit-any": "off",
23+
"@typescript-eslint/no-unused-vars" : "off",
24+
"react/prop-types" : "off",
25+
},
26+
},
27+
];

0 commit comments

Comments
 (0)