10 |
11 | If you're reading this document, we're really excited that you want to contribute to the project! All work on AthenaJS happens directly on GitHub. If you would like to contribute, please send a pull request to the dev branch. The following guide has some useful information, so we highly recommend you take a look at it before getting started!
12 |
13 | ## Code of Conduct
14 |
15 | We expect contributors to adhere to our code of conduct. Please read the full text so that you can understand what actions are expected of contributors to the project.
16 |
17 | ## Not sure where to start?
18 |
19 | - You'll most likely need to read up on a few tools and libraries
20 | - [React Live](https://github.com/FormidableLabs/react-live)
21 | - Used to render components
22 | - [React Flow](https://reactflow.dev/docs/quickstart/)
23 | - Enables the drag and drop UI prototyping tool with custom nodes
24 | - [Styled Components](https://styled-components.com/docs)
25 | - Styling components within the app is primarily done using the Styled Components Library
26 | - [Fetch Mock](https://www.wheresrhys.co.uk/fetch-mock/)
27 | - Used to set up a mock server
28 | - Parsing user uploaded files
29 | - [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree):
30 | - We use Babel for parsing and traversing user uploaded files: the Babel AST [spec](https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree).
31 | - Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook), in particular the parser, traverser, and best practices section
32 | - Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs
33 | - testing with [Jest](https://jestjs.io/docs/getting-started)
34 | - [Mocking React Context](https://polvara.me/posts/mocking-context-with-react-testing-library)
35 |
36 | - Helpful diagrams
37 | - [Athena App Diagram (Excalidraw)](#)
38 |
39 |
40 | ### Setup
41 |
42 | If you want to contribute to AthenaJS, the first step is to fork and clone the repository to your local machine. Once you've cloned it, navigate to the "electron-react" folder and run "npm run dev" to start up the application after installing the dependencies. This will allow you to begin making changes and testing your code.
43 |
44 | ```sh
45 | git clone https://github.com/oslabs-beta/Athena.git
46 | cd Athena/electron-react
47 | ```
48 |
49 | Then you can run:
50 |
51 | ```sh
52 | npm run dev
53 | ```
54 | Which will spin up the application on your local machine. AthenaJS uses Vite for an enhanced development experience with really fast HMR. Any changes you make to the codebase on your local machine will be quickly reflected on your running instance of AthenaJS!
55 |
56 | ## File Structure
57 |
58 | - Electron React (Root Directory for AthenaJS Project)
59 | - Electron (Electron)
60 | - Main (Electron-main)
61 | - Preload (Pre-load scripts)
62 | - src (React)
63 | - Index.tsx (Hangs app off of root and wraps app in context providers)
64 | - App.tsx
65 | - Pages
66 | - UI Page
67 | - Workshop
68 | - Components
69 | - Components are grouped by category
70 | - Accompanying tests should be placed in a __test__ folder next to the components they are unit testing
71 | - Files containing TypeScript Types used for components are located in the same category folder as the components
72 |
73 | ## Iteration Roadmap
74 |
75 | Not sure what contribution you want to make? Here are a few starting points:
76 |
77 | 1. Add unit tests with Jest. We are continually adding unit tests for components in order to enhance the quality and reliability of the codebase.
78 | - If you notice tests are missing for a component, we welcome additions to the testing ecosystem of AthenaJS!
79 | - If you make a pull request with a new component, consider adding an accompanying test file
80 | 2. Adding support for class components
81 | 3. Adding support for components written in TypeScript
82 | 4. Adding Tailwind CSS support for styling components
83 |
84 | ## License
85 | By contributing to AthenaJS, you agree that your contributions will be licensed under its MIT license.
86 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 OSLabs Beta
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.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
40 |
41 |
42 |
43 | ## What is AthenaJS?
44 |
45 | AthenaJS is a component visualizer workshop that allows developers to quickly develop and edit their React
46 | components in isolation without codebase integration.
47 |
48 | **Easy to use**: AthenaJS is a standalone electron application that allows developers to import their
49 | own React components or create components from scratch within the application's code editor.
50 |
51 | **Dynamic**: Developers can mock HTTP requests, style, and change the functionality of their components within the application's code editors. Changes are reflected in the renderer with the press of a button!
52 |
53 | **UI Mode**: After developers have created/edited their react components, they can navigate to the UI Mode section and prototype UIs using components from their library.
54 |
55 |
56 |
57 | ## Documentation & Installation
58 |
59 | You can find documentation and download the app on our website
60 |
61 | If you just want to download the app, you can find it under "Releases" on the right-hand side of GitHub!
62 |
63 | **Mac users**: The application needs to be approved in the "Security and Privacy" tab before it can be run.
64 |
65 |
66 |
67 | ## Features
68 |
69 | Interested in what you can do with AthenaJS? Here is a quick summary of all the great features you can start developing with!
70 |
71 | Please note AthenaJS only works for ***functional components***, but work is currently being done to add support for class components!
72 |
73 | ### Developing a Component from Scratch
74 |
75 | https://user-images.githubusercontent.com/35904733/230973355-08ee1f98-7428-48ec-9b7a-d8a31f8cd1d2.mov
76 |
77 |
78 |
79 | 💠 You can develop components from scratch and export them to your React project using our code editors! The JSX editor holds the return statement of the component and the body contains everything else (your hooks, functions, etc.). Press update view to view your changes live in the component renderer. Save your progress by choosing a name for your component and saving it to the component library.
80 |
81 | ### Upload and Edit Components
82 |
83 | https://user-images.githubusercontent.com/35904733/230982140-5f46aa3d-eb19-4bde-be6c-f82d078a858e.mov
84 |
85 |
86 |
87 | 💠 If you already have components built for your project and want to edit them, open the file explorer and import any of your React components! Our parser will inject your code into the editors so you can get started easily. Simply define any props your component relies on in the body editor and update the view to get your component working in the app!
88 |
89 | ### Fetch Mock Integration
90 |
91 | https://user-images.githubusercontent.com/35904733/230982230-daf91647-7ccb-4ff0-b57f-6e0ce4dc4567.mov
92 |
93 |
94 |
95 | 💠 If your component makes an http request with fetch, AthenaJS includes feck-motch integration to mock the response. If you are interested in all of the great features available to you with feck-motch, check out the documentation . By default, our settings intercept all requests and respond with an object {data: 'mock data'} to get you started quickly.
96 |
97 | ### Styling Your Components
98 |
99 | https://user-images.githubusercontent.com/35904733/230982240-82f1cc69-ff5b-49c7-aa61-be5cfd357268.mov
100 |
101 |
102 |
103 | 💠 AthenaJS includes styled-components integration, check out the documentation here to get started. Styled components lets you write actual CSS code to style your components, so you can get started quick and easy! Declare your styled component variable in the body editor and write CSS or copy over code from your CSS file to quickly style your component!
104 |
105 | ### Compare Component Render Times
106 |
107 | https://user-images.githubusercontent.com/35904733/230982261-e5e4f161-35d0-4cfb-a17d-f2e5feda18f6.mov
108 |
109 |
110 |
111 | 💠 Curious which components are causing or have the potential to cause a bottleneck in your application? Every time you render a new component, the render time is captured using the React Profiler API, the same API that React Dev Tools are built on. Render times can be added to a bar graph with the click of a button to easily compare render times across different components.
112 |
113 | ### Save Components
114 |
115 | https://user-images.githubusercontent.com/35904733/230982276-2df23884-b1c8-4d6c-bc5d-93f6ff4173f1.mov
116 |
117 |
118 |
119 | 💠 Press 'Save Library' to save your component library to your home directory. Your components will be persisted between sessions, so you can easily pick up from where you left off. Render any of your components and make changes to them, delete them from your library, or export them as a jsx file to easily integrate the components you develop into your React projects.
120 |
121 | ### UI Whiteboard
122 |
123 | https://user-images.githubusercontent.com/35904733/230982285-5e3f8933-2ca8-49a4-a995-e42e5acd0fe8.mov
124 |
125 |
126 |
127 | 💠 Once you build a component library, you can easily prototype UIs using the drag and drop UI whiteboard. The whiteboard area can be saved as a screenshot to your downloads folder by pressing the screenshot button on the top right portion of the screen.
128 |
129 | 💠 One of the team's favorite uses of this tool is to compare similar components. Not sure which navbar or button you like best? Add them to the whiteboard and compare them side-by-side!
130 |
131 |
132 |
133 |
134 | ## Questions and Support
135 |
136 | If you have any questions or need help with the project, please don't hesitate to ask! You can reach out to us on [Discord](https://discord.gg/6xkMNXtBYp) or [create an issue](https://github.com/oslabs-beta/Athena/issues/new/choose) on this repo.
137 |
138 |
139 |
140 | ## Contributing
141 |
142 | Navigate to the [CONTRIBUTING.md](CONTRIBUTING.md) file to learn how you can contribute to AthenaJS!
143 |
144 |
145 |
146 | ## Read More
147 |
148 | Check out our Medium article to read more!
149 |
150 |
151 |
152 | ## The Team
153 |
154 | ***AthenaJS Core Team***
155 |
156 | | Developed By | Github | LinkedIn |
157 | | :------------------: | :-------------: | :-------------: |
158 | | Christopher Long | [](https://github.com/cvalong) | [](https://www.linkedin.com/in/cvalong) |
159 | | Daniel Chang | [](https://github.com/Chang254) | [](www.linkedin.com/in/daniel-k-chang) |
160 | | Derrick Oh | [](https://github.com/Igniphis) | [](https://www.linkedin.com/in/derrickjoh/) |
161 | | Matthew Fukudome | [](https://github.com/mattfookoo) | [](https://www.linkedin.com/in/matthewfukudome/) |
162 | | Ryan Motamen | [](https://github.com/ryanmotamen) | [](https://www.linkedin.com/in/ryan-motamen/) |
163 |
164 | Special thanks to our friend Michelle for the logo and icon design!
165 |
166 |
167 | ## How is the repo structured?
168 |
169 | The Athena JS repo is managed as a monorepo check out the [CONTRIBUTING.md](CONTRIBUTING.md) for development and check here for the doc website.
170 |
171 |
172 |
173 | ## License
174 |
175 | Athena is [MIT licensed](https://github.com/oslabs-beta/Athena/blob/main/LICENSE).
176 |
177 |
178 |
--------------------------------------------------------------------------------
/electron-react/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "root": true,
3 | "ignorePatterns": ["**/test", "**/__tests__"],
4 | "env": {
5 | "node": true,
6 | "browser": true,
7 | "es2021": true
8 | },
9 | "plugins": ["react"],
10 | "extends": ["eslint:recommended", "plugin:react/recommended"],
11 | "parserOptions": {
12 | "sourceType": "module",
13 | "ecmaFeatures": {
14 | "jsx": true
15 | }
16 | },
17 | "rules": {
18 | "indent": ["warn", 2],
19 | "no-unused-vars": ["off", { "vars": "local" }],
20 | "no-case-declarations": "off",
21 | "prefer-const": "warn",
22 | "quotes": ["warn", "single"],
23 | "react/prop-types": "off",
24 | "semi": ["warn", "always"],
25 | "space-infix-ops": "warn"
26 | },
27 | "settings": {
28 | "react": { "version": "detect"}
29 | }
30 | };
31 |
32 |
33 |
--------------------------------------------------------------------------------
/electron-react/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | dist-electron
14 | release
15 | *.local
16 |
17 | # Editor directories and files
18 | .vscode/.debug.env
19 | .idea
20 | .DS_Store
21 | *.suo
22 | *.ntvs*
23 | *.njsproj
24 | *.sln
25 | *.sw?
26 |
27 | #lockfile
28 | package-lock.json
29 | pnpm-lock.yaml
30 | yarn.lock
31 | /test-results/
32 | /playwright-report/
33 | /playwright/.cache/
34 |
35 | #Zone identifier
36 | *.Zone.Identifier
--------------------------------------------------------------------------------
/electron-react/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist=true
--------------------------------------------------------------------------------
/electron-react/.vscode/.debug.script.mjs:
--------------------------------------------------------------------------------
1 | import fs from 'node:fs'
2 | import path from 'node:path'
3 | import { fileURLToPath } from 'node:url'
4 | import { createRequire } from 'node:module'
5 | import { spawn } from 'node:child_process'
6 |
7 | const pkg = createRequire(import.meta.url)('../package.json')
8 | const __dirname = path.dirname(fileURLToPath(import.meta.url))
9 |
10 | // write .debug.env
11 | const envContent = Object.entries(pkg.debug.env).map(([key, val]) => `${key}=${val}`)
12 | fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
13 |
14 | // bootstrap
15 | spawn(
16 | // TODO: terminate `npm run dev` when Debug exits.
17 | process.platform === 'win32' ? 'npm.cmd' : 'npm',
18 | ['run', 'dev'],
19 | {
20 | stdio: 'inherit',
21 | env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }),
22 | },
23 | )
--------------------------------------------------------------------------------
/electron-react/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | "mrmlnc.vscode-json5"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/electron-react/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "compounds": [
7 | {
8 | "name": "Debug App",
9 | "preLaunchTask": "Before Debug",
10 | "configurations": [
11 | "Debug Main Process",
12 | "Debug Renderer Process"
13 | ],
14 | "presentation": {
15 | "hidden": false,
16 | "group": "",
17 | "order": 1
18 | },
19 | "stopAll": true
20 | }
21 | ],
22 | "configurations": [
23 | {
24 | "name": "Debug Main Process",
25 | "type": "node",
26 | "request": "launch",
27 | "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
28 | "windows": {
29 | "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
30 | },
31 | "runtimeArgs": [
32 | "--no-sandbox",
33 | "--remote-debugging-port=9229",
34 | "."
35 | ],
36 | "envFile": "${workspaceFolder}/.vscode/.debug.env",
37 | "console": "integratedTerminal"
38 | },
39 | {
40 | "name": "Debug Renderer Process",
41 | "port": 9229,
42 | "request": "attach",
43 | "type": "chrome",
44 | "timeout": 60000,
45 | "skipFiles": [
46 | "/**",
47 | "${workspaceRoot}/node_modules/**",
48 | "${workspaceRoot}/dist-electron/**",
49 | // Skip files in host(VITE_DEV_SERVER_URL)
50 | "http://127.0.0.1:7777/**"
51 | ]
52 | },
53 | ]
54 | }
--------------------------------------------------------------------------------
/electron-react/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "node_modules/typescript/lib",
3 | "typescript.tsc.autoDetect": "off",
4 | "json.schemas": [
5 | {
6 | "fileMatch": [
7 | "/*electron-builder.json5",
8 | "/*electron-builder.json"
9 | ],
10 | "url": "https://json.schemastore.org/electron-builder"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/electron-react/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "Before Debug",
8 | "type": "shell",
9 | "command": "node .vscode/.debug.script.mjs",
10 | "isBackground": true,
11 | "problemMatcher": {
12 | "owner": "typescript",
13 | "fileLocation": "relative",
14 | "pattern": {
15 | // TODO: correct "regexp"
16 | "regexp": "^([a-zA-Z]\\:\/?([\\w\\-]\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
17 | "file": 1,
18 | "line": 3,
19 | "column": 4,
20 | "code": 5,
21 | "message": 6
22 | },
23 | "background": {
24 | "activeOnStart": true,
25 | "beginsPattern": "^.*VITE v.* ready in \\d* ms.*$",
26 | "endsPattern": "^.*\\[startup\\] Electron App.*$"
27 | }
28 | }
29 | }
30 | ]
31 | }
--------------------------------------------------------------------------------
/electron-react/athena-website/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | /node_modules
3 |
4 | # Production
5 | /build
6 |
7 | # Generated files
8 | .docusaurus
9 | .cache-loader
10 |
11 | # Misc
12 | .DS_Store
13 | .env.local
14 | .env.development.local
15 | .env.test.local
16 | .env.production.local
17 |
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
--------------------------------------------------------------------------------
/electron-react/athena-website/README.md:
--------------------------------------------------------------------------------
1 | # Website
2 |
3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4 |
5 | ### Installation
6 |
7 | ```
8 | $ yarn
9 | ```
10 |
11 | ### Local Development
12 | navigate to electron-react/athena-website and run:
13 | ```
14 | npm start
15 | ```
16 | ```
17 | $ yarn start
18 | ```
19 |
20 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
21 |
22 | ### Build
23 |
24 | ```
25 | $ yarn build
26 | ```
27 |
28 | This command generates static content into the `build` directory and can be served using any static contents hosting service.
29 |
30 | ### Deployment
31 |
32 | Using SSH:
33 |
34 | ```
35 | $ USE_SSH=true yarn deploy
36 | ```
37 |
38 | Not using SSH:
39 |
40 | ```
41 | $ GIT_USER= yarn deploy
42 | ```
43 |
44 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
45 |
--------------------------------------------------------------------------------
/electron-react/athena-website/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3 | };
4 |
--------------------------------------------------------------------------------
/electron-react/athena-website/blog/2019-05-28-first-blog-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: first-blog-post
3 | title: First Blog Post
4 | authors:
5 | name: Gao Wei
6 | title: Docusaurus Core Team
7 | url: https://github.com/wgao19
8 | image_url: https://github.com/wgao19.png
9 | tags: [hola, docusaurus]
10 | ---
11 |
12 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
13 |
--------------------------------------------------------------------------------
/electron-react/athena-website/blog/2019-05-29-long-blog-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: long-blog-post
3 | title: Long Blog Post
4 | authors: endi
5 | tags: [hello, docusaurus]
6 | ---
7 |
8 | This is the summary of a very long blog post,
9 |
10 | Use a `` comment to limit blog post size in the list view.
11 |
12 |
13 |
14 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
15 |
16 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
17 |
18 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
19 |
20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
21 |
22 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
23 |
24 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
25 |
26 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
27 |
28 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
29 |
30 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
31 |
32 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
33 |
34 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
35 |
36 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
37 |
38 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
39 |
40 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
41 |
42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
43 |
44 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
45 |
--------------------------------------------------------------------------------
/electron-react/athena-website/blog/2021-08-01-mdx-blog-post.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | slug: mdx-blog-post
3 | title: MDX Blog Post
4 | authors: [slorber]
5 | tags: [docusaurus]
6 | ---
7 |
8 | Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
9 |
10 | :::tip
11 |
12 | Use the power of React to create interactive blog posts.
13 |
14 | ```js
15 |
16 | ```
17 |
18 |
19 |
20 | :::
21 |
--------------------------------------------------------------------------------
/electron-react/athena-website/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/AthenaJS/1323799913405bc6c8511a681f84dcf3ec10c854/electron-react/athena-website/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg
--------------------------------------------------------------------------------
/electron-react/athena-website/blog/2021-08-26-welcome/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: welcome
3 | title: Welcome
4 | authors: [slorber, yangshun]
5 | tags: [facebook, hello, docusaurus]
6 | ---
7 |
8 | [Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
9 |
10 | Simply add Markdown files (or folders) to the `blog` directory.
11 |
12 | Regular blog authors can be added to `authors.yml`.
13 |
14 | The blog post date can be extracted from filenames, such as:
15 |
16 | - `2019-05-30-welcome.md`
17 | - `2019-05-30-welcome/index.md`
18 |
19 | A blog post folder can be convenient to co-locate blog post images:
20 |
21 | 
22 |
23 | The blog supports tags as well!
24 |
25 | **And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
26 |
--------------------------------------------------------------------------------
/electron-react/athena-website/blog/authors.yml:
--------------------------------------------------------------------------------
1 | endi:
2 | name: Endilie Yacop Sucipto
3 | title: Maintainer of Docusaurus
4 | url: https://github.com/endiliey
5 | image_url: https://github.com/endiliey.png
6 |
7 | yangshun:
8 | name: Yangshun Tay
9 | title: Front End Engineer @ Facebook
10 | url: https://github.com/yangshun
11 | image_url: https://github.com/yangshun.png
12 |
13 | slorber:
14 | name: Sébastien Lorber
15 | title: Docusaurus maintainer
16 | url: https://sebastienlorber.com
17 | image_url: https://github.com/slorber.png
18 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/UI-mode/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "label": "UI Mode",
3 | "position": 3,
4 | "link": {
5 | "type": "generated-index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/UI-mode/img/docsVersionDropdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/AthenaJS/1323799913405bc6c8511a681f84dcf3ec10c854/electron-react/athena-website/docs/UI-mode/img/docsVersionDropdown.png
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/UI-mode/img/localeDropdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/AthenaJS/1323799913405bc6c8511a681f84dcf3ec10c854/electron-react/athena-website/docs/UI-mode/img/localeDropdown.png
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/UI-mode/manage-docs-versions.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 1
3 | ---
4 |
5 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/editing-your-component/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "label": "Editing Your Component",
3 | "position": 2,
4 | "link": {
5 | "type": "generated-index",
6 | "description": "Core AthenaJS Concepts"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/editing-your-component/defining-actions.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 2
3 | ---
4 |
5 | # Mocking Functions
6 |
7 | In AthenaJS, the function terminal window is a powerful tool that allows users to import and define functions from component files to test and render components. Here's a step-by-step guide on how to use the function terminal window:
8 |
9 | - **Access the function terminal window**: Locate the function terminal window in the bottom-middle of the AthenaJS UI. This window is dedicated to creating and managing functions for your isolated component.
10 |
11 | - **Load the component file**: Use the "Load File" button to load your component file into AthenaJS. The component file will be parsed, and all of the functions defined in the file will be loaded into the function terminal window.
12 |
13 | - **Define functions in the function terminal window**: In the function terminal window, you can define functions or modify the existing ones that have been loaded from the component file. For example, you can define a function named `handleClick` that changes the state of the component when called. The syntax for defining a function in the function terminal window is the same as in a regular JavaScript file.
14 |
15 | - **Utilize the functions in the component**: Once the functions have been defined or imported in the function terminal window, they can be utilized in the component. You can call the functions in the JSX terminal window, passing in any necessary parameters.
16 |
17 | - **Preview the component**: The view component button will render a preview of the component in AthenaJS's component rendering panel. This allows you to see how the component behaves with specific function calls and make any necessary adjustments on the fly thanks to AthenaJS's live component rendering.
18 |
19 | - **Modify or remove functions**: If needed, you can easily modify or remove existing functions by accessing the function terminal window and editing or deleting the corresponding JavaScript entries.
20 |
21 | By following these steps, users can import and define functions from component files or external sources and utilize them in their AthenaJS components.
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/editing-your-component/mocking-props.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 0
3 | ---
4 |
5 | # Mocking Props
6 |
7 | In AthenaJS, mocking props is an essential aspect of component development and testing. It enables developers to simulate the data that their components receive from parent components or external sources, ensuring that they function correctly in various scenarios. Here is a step-by-step guide on how to write and use dummy props in AthenaJS:
8 |
9 | - **Access the props editor**: Find the props editor panel located in the bottom-left of the AthenaJS UI. This panel allows for the creation and management of prop mocks for your isolated component.
10 |
11 | - **Write the mock prop**: In the "Props" text area, you can load props from your component page and edit/create more mock props using JSON notation. For example, you can enter `{“count” : 1}` to create a dummy prop called "count" with a value of 1.
12 |
13 | - - For more complex prop values, you can use JSON objects or arrays, such as `{“items”: [{“id”:1, “name”: “Item 1”}, {“id”: 2, “name”: “Item 2”}]}`.
14 |
15 | - **Utilize the built-in linter**: While writing mock props, AthenaJS's built-in linter will check for syntax errors or issues in your JSON notation. If any problems are detected, the linter will notify you on the left side of the panel and provide helpful feedback if you hover over the notification.
16 |
17 | - **Preview the component**: The component will automatically update as you edit mock props in the editor. With the mock props defined, you can preview the component in AthenaJS's component rendering panel. This enables you to see how the component behaves with specific prop values and make necessary adjustments on the fly thanks to AthenaJS's live component rendering.
18 |
19 | - **Modify or remove mock props**: You can easily modify or remove existing mock props by accessing the Props panel and editing or deleting the corresponding JSON entries.
20 |
21 | By following these steps, you can efficiently create and manage mock props for your components in AthenaJS.
22 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/editing-your-component/mocking-state.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 1
3 | ---
4 |
5 | # Mocking State
6 |
7 | AthenaJS offers a functional component syntax that allows users to simulate state, enabling developers to test their components' behavior in various scenarios. If you're looking to write and implement mock state using AthenaJS, here's a step-by-step guide:
8 |
9 | - **Load Hooks**: Head over to the AthenaJS application and open your project directory. Select the component file you want to modify, and its hooks will be loaded into the state terminal situated in the bottom-left corner of the homepage.
10 |
11 | - **Define State Variables**: Use the state window to define/edit the state variables you want to mock.
12 |
13 | - **Manipulate State in JSX**: In the JSX terminal located in the bottom-right corner of the UI, you can implement the state variables you have defined.
14 |
15 | By following these steps, you can easily create and use mock state in your AthenaJS project to test your components' functionality.
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/editing-your-component/rendering-component.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 3
3 | ---
4 |
5 | # Rendering Your Component
6 |
7 | After defining the state, props, function definitions, and JSX, users can render their component in the Component window by following these steps:
8 |
9 | - **Update View**: To view the most recent changes made, click the 'Update View' button. This will trigger a re-render of the component.
10 |
11 | - **Save Component**: Users can save their components to their component library by giving them a name and clicking the 'Save Component' button. This will allow the component to be reused in UI mode.
12 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/intro.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 1
3 | ---
4 |
5 | # Getting Started
6 |
7 | ## Introduction to AthenaJS:
8 |
9 | AthenaJS is an Electron-based application that streamlines the development process of React components. Its key feature is the ability to **develop individual components in isolation**, allowing for rapid prototyping, testing, and iteration. By providing a dedicated environment for component creation, AthenaJS enhances efficiency and promotes best practices in React development.
10 |
11 | ### Key Features of AthenaJS Include:
12 |
13 | - **Intuitive interface** for editing components, mocking props, and managing state. This includes a built-in linter for JavaScript, JSON, and JSX.
14 |
15 | - Support for **defining custom actions** to manage component behavior and interactions.
16 |
17 | - **Live component rendering and previewing**, making it easy to visualize and test components on the fly.
18 |
19 | - **Render time calculations**, allowing developers to analyze component performance and optimize if needed.
20 |
21 | - **Export** functionality to integrate updated components seamlessly into your React application.
22 |
23 | - Ability to **edit React server components in isolation**, allowing developers to optimize performance and reduce the need for client-side rendering, further enhancing the React development experience.
24 |
25 |
26 | ## Prerequisities
27 |
28 | To get started with AthenaJS, it's important to ensure that your system meets the following requirements:
29 |
30 |
31 | - **Compatible operating system**: AthenaJS is available for Windows, macOS, and Linux.
32 | - **Basic knowledge of React**: Familiarity with React, its core concepts, and component development is highly recommended to use AthenaJS effectively.
33 |
34 |
35 | Once you have met these prerequisites, you can install AthenaJS and begin developing React components with enhanced performance insights and efficient workflows.
36 |
37 | ## Installing Athena JS
38 |
39 | Users will be able to download Athena JS either through our [homepage](http://localhost:3000/) or our [Github](https://github.com/oslabs-beta/Athena).
40 |
41 | **Github Instructions:**
42 |
43 | First, navigate to the Github repository URL and fork the repository.
44 |
45 | Next, clone the repository to your local machine.
46 |
47 | ```bash
48 | git clone https://github.com/YOUR_USERNAME_HERE/Athena.git
49 | ```
50 |
51 | Navigate into the newly created Athena Folder, install all necessary dependencies, and spin up the app
52 |
53 | ```bash
54 | cd Athena
55 | npm install
56 | npm run dev
57 | ```
58 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "label": "Tutorial - Basics",
3 | "position": 4,
4 | "link": {
5 | "type": "generated-index",
6 | "description": "Core AthenaJS Concepts"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/congratulations.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 6
3 | ---
4 |
5 | # Defining Actions
6 |
7 | You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.
8 |
9 | Docusaurus has **much more to offer**!
10 |
11 | Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.
12 |
13 | Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)
14 |
15 | ## What's next?
16 |
17 | - Read the [official documentation](https://docusaurus.io/)
18 | - Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
19 | - Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
20 | - Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
21 | - Add a [search bar](https://docusaurus.io/docs/search)
22 | - Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
23 | - Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
24 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/create-a-blog-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 3
3 | ---
4 |
5 | # Mocking Props
6 |
7 | Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed...
8 |
9 | ## Create your first Post
10 |
11 | Create a file at `blog/2021-02-28-greetings.md`:
12 |
13 | ```md title="blog/2021-02-28-greetings.md"
14 | ---
15 | slug: greetings
16 | title: Greetings!
17 | authors:
18 | - name: Joel Marcey
19 | title: Co-creator of Docusaurus 1
20 | url: https://github.com/JoelMarcey
21 | image_url: https://github.com/JoelMarcey.png
22 | - name: Sébastien Lorber
23 | title: Docusaurus maintainer
24 | url: https://sebastienlorber.com
25 | image_url: https://github.com/slorber.png
26 | tags: [greetings]
27 | ---
28 |
29 | Congratulations, you have made your first post!
30 |
31 | Feel free to play around and edit this post as much you like.
32 | ```
33 |
34 | A new blog post is now available at [http://localhost:3000/blog/greetings](http://localhost:3000/blog/greetings).
35 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/create-a-document.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 2
3 | ---
4 |
5 | # Editing Your Component
6 |
7 | Documents are **groups of pages** connected through:
8 |
9 | - a **sidebar**
10 | - **previous/next navigation**
11 | - **versioning**
12 |
13 | ## Create your first Doc
14 |
15 | Create a Markdown file at `docs/hello.md`:
16 |
17 | ```md title="docs/hello.md"
18 | # Hello
19 |
20 | This is my **first Docusaurus document**!
21 | ```
22 |
23 | A new document is now available at [http://localhost:3000/docs/hello](http://localhost:3000/docs/hello).
24 |
25 | ## Configure the Sidebar
26 |
27 | Docusaurus automatically **creates a sidebar** from the `docs` folder.
28 |
29 | Add metadata to customize the sidebar label and position:
30 |
31 | ```md title="docs/hello.md" {1-4}
32 | ---
33 | sidebar_label: 'Hi!'
34 | sidebar_position: 3
35 | ---
36 |
37 | # Hello
38 |
39 | This is my **first Docusaurus document**!
40 | ```
41 |
42 | It is also possible to create your sidebar explicitly in `sidebars.js`:
43 |
44 | ```js title="sidebars.js"
45 | module.exports = {
46 | tutorialSidebar: [
47 | 'intro',
48 | // highlight-next-line
49 | 'hello',
50 | {
51 | type: 'category',
52 | label: 'Tutorial',
53 | items: ['tutorial-basics/create-a-document'],
54 | },
55 | ],
56 | };
57 | ```
58 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/create-a-page.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 1
3 | ---
4 |
5 | # Importing Your File
6 |
7 | Add **Markdown or React** files to `src/pages` to create a **standalone page**:
8 |
9 | - `src/pages/index.js` → `localhost:3000/`
10 | - `src/pages/foo.md` → `localhost:3000/foo`
11 | - `src/pages/foo/bar.js` → `localhost:3000/foo/bar`
12 |
13 | ## Create your first React Page
14 |
15 | Create a file at `src/pages/my-react-page.js`:
16 |
17 | ```jsx title="src/pages/my-react-page.js"
18 | import React from 'react';
19 | import Layout from '@theme/Layout';
20 |
21 | export default function MyReactPage() {
22 | return (
23 |
24 |
My React page
25 |
This is a React page
26 |
27 | );
28 | }
29 | ```
30 |
31 | A new page is now available at [http://localhost:3000/my-react-page](http://localhost:3000/my-react-page).
32 |
33 | ## Create your first Markdown Page
34 |
35 | Create a file at `src/pages/my-markdown-page.md`:
36 |
37 | ```mdx title="src/pages/my-markdown-page.md"
38 | # My Markdown page
39 |
40 | This is a Markdown page
41 | ```
42 |
43 | A new page is now available at [http://localhost:3000/my-markdown-page](http://localhost:3000/my-markdown-page).
44 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/deploy-your-site.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 5
3 | ---
4 |
5 | # Mocking State
6 |
7 | Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**).
8 |
9 | It builds your site as simple **static HTML, JavaScript and CSS files**.
10 |
11 | ## Build your site
12 |
13 | Build your site **for production**:
14 |
15 | ```bash
16 | npm run build
17 | ```
18 |
19 | The static files are generated in the `build` folder.
20 |
21 | ## Deploy your site
22 |
23 | Test your production build locally:
24 |
25 | ```bash
26 | npm run serve
27 | ```
28 |
29 | The `build` folder is now served at [http://localhost:3000/](http://localhost:3000/).
30 |
31 | You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**).
32 |
--------------------------------------------------------------------------------
/electron-react/athena-website/docs/tutorial-basics/markdown-features.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 4
3 | ---
4 |
5 | # Markdown Features
6 |
7 | Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**.
8 |
9 | ## Front Matter
10 |
11 | Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/):
12 |
13 | ```text title="my-doc.md"
14 | // highlight-start
15 | ---
16 | id: my-doc-id
17 | title: My document title
18 | description: My document description
19 | slug: /my-custom-url
20 | ---
21 | // highlight-end
22 |
23 | ## Markdown heading
24 |
25 | Markdown text with [links](./hello.md)
26 | ```
27 |
28 | ## Links
29 |
30 | Regular Markdown links are supported, using url paths or relative file paths.
31 |
32 | ```md
33 | Let's see how to [Create a page](/create-a-page).
34 | ```
35 |
36 | ```md
37 | Let's see how to [Create a page](./create-a-page.md).
38 | ```
39 |
40 | **Result:** Let's see how to [Create a page](./create-a-page.md).
41 |
42 | ## Images
43 |
44 | Regular Markdown images are supported.
45 |
46 | You can use absolute paths to reference images in the static directory (`static/img/docusaurus.png`):
47 |
48 | ```md
49 | 
50 | ```
51 |
52 | 
53 |
54 | You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them:
55 |
56 | ```md
57 | 
58 | ```
59 |
60 | ## Code Blocks
61 |
62 | Markdown code blocks are supported with Syntax highlighting.
63 |
64 | ```jsx title="src/components/HelloDocusaurus.js"
65 | function HelloDocusaurus() {
66 | return (
67 |