Skip to content

Commit

Permalink
init from vite starter
Browse files Browse the repository at this point in the history
  • Loading branch information
justintaylor-dev committed Nov 17, 2021
0 parents commit 4f926d4
Show file tree
Hide file tree
Showing 23 changed files with 1,947 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Hyper Brew LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/js/main.tsx"></script>
</body>
</html>
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "cep_vrts",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"serve": "vite preview"
},
"dependencies": {
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@vitejs/plugin-react": "^1.0.0",
"sass": "^1.43.4",
"types-for-adobe": "^6.0.1",
"typescript": "^4.4.4",
"vite": "^2.6.4"
},
"main": "index.js",
"license": "yes"
}
42 changes: 42 additions & 0 deletions src/js/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.app {
text-align: center;
}

.app-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.app-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.app-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.app-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

button {
font-size: calc(10px + 2vmin);
}
45 changes: 45 additions & 0 deletions src/js/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { useState } from "react";
import logo from "./logo.svg";
import "./app.scss";

function App() {
const [count, setCount] = useState(0);

return (
<div className="app">
<header className="app-header">
<img src={logo} className="app-logo" alt="logo" />
<p>Hello Vite + React!</p>
<p>
<button type="button" onClick={() => setCount((count) => count + 1)}>
count is: {count}
</button>
</p>
<p>
Edit <code>App.tsx</code> and save to test HMR updates.
</p>
<p>
<a
className="app-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
{" | "}
<a
className="app-link"
href="https://vitejs.dev/guide/features.html"
target="_blank"
rel="noopener noreferrer"
>
Vite Docs
</a>
</p>
</header>
</div>
);
}

export default App;
15 changes: 15 additions & 0 deletions src/js/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/js/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
7 changes: 7 additions & 0 deletions src/js/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/js/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import ReactDOM from "react-dom";
import "./index.scss";
import App from "./app";

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
1 change: 1 addition & 0 deletions src/js/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
5 changes: 5 additions & 0 deletions src/jsx/aeft.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="../../node_modules/types-for-adobe/AfterEffects/2018/index.d.ts" />

export const helloWorld = () => {
alert('Hello from After Effects');
};
5 changes: 5 additions & 0 deletions src/jsx/anim.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="../../node_modules/types-for-adobe/Animate/2013/index.d.ts" />

export const helloWorld = () => {
alert('Hello from Animate');
};
5 changes: 5 additions & 0 deletions src/jsx/ilst.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="../../node_modules/types-for-adobe/Illustrator/2015.3/index.d.ts" />

export const helloWorld = () => {
alert('Hello from Illustrator');
};
28 changes: 28 additions & 0 deletions src/jsx/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//@include './lib/json2.js'

//@ts-ignore
import { ns } from '../shared/shared.ts';

import * as aeft from './aeft';
import * as ilst from './ilst';
import * as anim from './anim';

let main;

switch (BridgeTalk.appName) {
case 'aftereffects':
main = aeft;
break;
case 'illustrator':
main = ilst;
break;
default:
//@ts-ignore
if (app.appName === 'Adobe Animate') {
main = anim;
}
break;
}
//@ts-ignore
const host = typeof $ !== 'undefined' ? $ : window;
host[ns] = main;
1 change: 1 addition & 0 deletions src/jsx/lib/json2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/jsx/module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const getActiveComp = (param: number) => {
const comp = app.project.activeItem as CompItem;
alert(comp.name);
return comp.name;
};
11 changes: 11 additions & 0 deletions src/jsx/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es3",
"noLib": true,
"allowJs": true,
"checkJs": true,
"types": ["../../node_modules/types-for-adobe/AfterEffects/2018"],
"outDir": "../../dist/jsx"
},
"include": ["./**/*"]
}
1 change: 1 addition & 0 deletions src/shared/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ns = 'com.nitro.cep';
16 changes: 16 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "es5",
"moduleResolution": "node",
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "es5"],
"strict": true,
"noEmit": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"isolatedModules": false,
"resolveJsonModule": true
},
"exclude": ["node_modules", "src/jsx"]
}
10 changes: 10 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
build: {
outDir: "dist/cep",
},
});
Loading

0 comments on commit 4f926d4

Please sign in to comment.