Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove deprecated src directory and sync with v0/src and v1/src #495

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

aryanndwi123
Copy link
Contributor

@aryanndwi123 aryanndwi123 commented Feb 23, 2025

Fixes #491

Remove deprecated src directory and sync changes with v0/src and v1/src

Changes

  • Removed the deprecated src directory to reduce confusion and maintenance overhead
  • Synchronized changes between v0/src and v1/src directories to maintain consistency
  • All functionality remains intact, just reorganized for better maintainability

Testing

  • Verified all functionalities are working after directory restructuring
  • Confirmed no regressions in both v0 and v1 versions

Additional Notes

The deprecated src directory was causing confusion as it contained outdated code. This cleanup helps maintain a cleaner codebase while ensuring all necessary changes are properly synced between v0 and v1 versions.

Summary by CodeRabbit

  • Chores / Refactor

    • Streamlined the application by removing deprecated UI components, dialogs, menus, and legacy simulation modules for improved performance and maintainability.
  • Documentation & Localization

    • Cleaned up outdated localization and documentation resources.
  • Tests & Utilities

    • Removed obsolete test files and helper utilities to simplify future development.

These changes result in a leaner, more focused interface that emphasizes core functionalities for a smoother user experience.

Copy link
Contributor

coderabbitai bot commented Feb 23, 2025

Walkthrough

This pull request removes a significant portion of the project’s codebase. Multiple files have been deleted including root and configuration files, Vue components for UI elements (dialogs, menus, panels, navigations, and helpers), localization and internationalization files, global declarations, and core simulator modules such as Verilog conversion, canvas APIs, circuit elements, analysis, backup, file operations, events, drag handlers, and hotkey management. These deletions eliminate many front‐end and simulator functionalities previously provided by the project.

Changes

File(s) Change Summary
src/App.vue Removed the root Vue component that handled routing and provided a placeholder for component management.
src/assets/constants/…/Navbar/*.json, src/assets/constants/…/Panels/*.json Deleted JSON configuration files for navigation (menu structure, user data) and panel settings (timing diagram buttons, Verilog editor themes).
src/components/… Removed numerous Vue components including context menus, dialog boxes (BooleanTable, CombinationalAnalysis, CustomShortcut, Export/Import dialogs, etc.), navigation elements (Logo, Navbar, Hamburger, QuickButton, User, etc.), panels (ElementsPanel, PropertiesPanel, Module/Project/Subcircuit properties, TimingDiagram panels, VerilogEditorPanel), tabs, helper components, and related sub-components.
src/env.d.ts, src/globalVariables.ts Deleted TypeScript declaration files and global variable initializations.
src/locales/* Removed localization files and i18n configuration including language JSON files and the i18n setup module.
src/main.ts, src/pages/* Removed the application entry point and page components (embed, simulator, simulatorHandler) that maintained the UI and access control.
src/plugins/*, src/router/*, src/shims-vuetify.d.ts Deleted plugin configurations for Vuetify, web font loading, routing setups, and TypeScript shims for Vuetify.
src/simulator/spec/* Removed simulator specification and test data files including circuit JSON data and unit tests.
src/simulator/src/* Deleted core simulator modules covering Verilog conversion, canvas API, circuit element classes, combinational analysis functions, data management (backup, load, save), drag and embed handling, simulation engine logic, event handlers, file operations (import/export), hotkey bindings, and i18n support.

Suggested labels

GSOC'24

Suggested reviewers

  • JoshVarga
  • Arnabdaz

Poem

I hop through lines of code once bright,
Removing files in the soft moonlight.
With every deletion, a new path is clear,
Carrots crunch as old bugs disappear.
I’m the rabbit of revisions—hopping free and dear!

Happy trails on this leaner frontier!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Feb 23, 2025

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 86ccf0a
🔍 Latest deploy log https://app.netlify.com/sites/circuitverse/deploys/67c1378c4a68a800089146ad
😎 Deploy Preview https://deploy-preview-495--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


import CodeMirror from 'codemirror'
import { setup } from '../src/setup'
vi.mock('codemirror', async (importOriginal) => {

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
const actual = await importOriginal();
return {
...actual,
fromTextArea: vi.fn(() => ({ setValue: () => { } })),

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
import circuitData from './circuits/gates-circuitdata.json'
import testData from './testData/gates-testdata.json'
import { runAll } from '../src/testbench'
vi.mock('codemirror-editor-vue3', () => ({

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
import testData from './testData/gates-testdata.json'
import { runAll } from '../src/testbench'
vi.mock('codemirror-editor-vue3', () => ({
defineSimpleMode: vi.fn(),

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.

jest.mock('codemirror')
describe('Simulator Gates Working', () => {

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'describe' is not defined.
}

global.document.createRange = vi.fn(() => ({
setEnd: vi.fn(),

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.

global.document.createRange = vi.fn(() => ({
setEnd: vi.fn(),
setStart: vi.fn(),

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
global.document.createRange = vi.fn(() => ({
setEnd: vi.fn(),
setStart: vi.fn(),
getBoundingClientRect: vi.fn(() => ({

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
bottom: 0,
left: 0,
})),
getClientRects: vi.fn(() => ({

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
left: 0,
})),
getClientRects: vi.fn(() => ({
item: vi.fn(() => null),

Check failure

Code scanning / ESLint

disallow the use of undeclared variables unless mentioned in `/*global */` comments Error test

'vi' is not defined.
@@ -207,16 +165,16 @@
this.downDimensionY = subcircuitScope.layout.height
}

this.nodeList.extend(this.inputNodes)
this.nodeList.extend(this.outputNodes)
this.nodeList.push(...this.inputNodes)

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
this.nodeList.extend(this.inputNodes)
this.nodeList.extend(this.outputNodes)
this.nodeList.push(...this.inputNodes)
this.nodeList.push(...this.outputNodes)

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
@@ -207,16 +165,16 @@
this.downDimensionY = subcircuitScope.layout.height
}

this.nodeList.extend(this.inputNodes)
this.nodeList.extend(this.outputNodes)
this.nodeList.push(...this.inputNodes)

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
this.nodeList.extend(this.inputNodes)
this.nodeList.extend(this.outputNodes)
this.nodeList.push(...this.inputNodes)
this.nodeList.push(...this.outputNodes)

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
@aryanndwi123
Copy link
Contributor Author

Hey @Arnabdaz , could you review this PR and merge it

@ThatDeparted2061
Copy link
Member

ThatDeparted2061 commented Feb 28, 2025

Currently we have some broken functioning in the src folder we are syncing So I'd suggest we keep the old src in the v0 src complete complete the work in v1 fix it completely, implement the version switch and then we should sync v0 and v1.
@Arnabdaz What are your thoughts on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync the src changes to v0 and v1 versions of the simualtor
2 participants