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

feat(templates): add new asset template #81

Merged
merged 12 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
packages/create-connect-app/build
application-templates/typescript/*/build
application-templates/typescript/*/public
application-templates/javascript/*/public
.nvmrc
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ module.exports = {
es6: true,
jest: true,
node: true, //adds things like process to global
browser: true
},
};
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
v20.15.1
25 changes: 25 additions & 0 deletions application-templates/javascript/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
public/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
12 changes: 12 additions & 0 deletions application-templates/javascript/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Connect Asset template</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions application-templates/javascript/assets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "assets",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
ruidias-commercetools marked this conversation as resolved.
Show resolved Hide resolved
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^5.2.2",
ruidias-commercetools marked this conversation as resolved.
Show resolved Hide resolved
"vite": "^5.3.4"
}
}
143 changes: 143 additions & 0 deletions application-templates/javascript/assets/src/commercetools.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions application-templates/javascript/assets/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
width: 400px;
height: auto;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
filter: drop-shadow(0 0 2em #3178c6aa);
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
17 changes: 17 additions & 0 deletions application-templates/javascript/assets/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import './index.css';
import commercetoolsLogo from './commercetools.svg';

const alertMessage = () => {
alert('Hello! You are now using the Connect Asset Application template!');
};

document.querySelector('#app').innerHTML = `
<div>
<h2>Connect Asset Application Template</h2>
<a href="https://docs.commercetools.com/connect/" target="_blank">
<img src="${commercetoolsLogo}" class="logo commercetools" alt="Commercetools logo" />
</a>
</div>
`;

setTimeout(alertMessage, 2500);
11 changes: 11 additions & 0 deletions application-templates/javascript/assets/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { resolve, dirname } from 'path';
ruidias-commercetools marked this conversation as resolved.
Show resolved Hide resolved
import { defineConfig } from 'vite';

const __dirname = dirname(__filename);

export default defineConfig({
build: {
outDir: resolve(__dirname, 'public'),
},
publicDir: resolve(__dirname, 'static'),
});
2 changes: 1 addition & 1 deletion application-templates/javascript/event/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
v20.15.1
ruidias-commercetools marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion application-templates/javascript/job/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
v20.15.1
2 changes: 1 addition & 1 deletion application-templates/javascript/service/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
v20.15.1
3 changes: 2 additions & 1 deletion application-templates/typescript/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ coverage
.DS_Store
.vscode
build/
.env
.env
public/
25 changes: 25 additions & 0 deletions application-templates/typescript/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
public/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Loading
Loading