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 add support for Rax #3441

Closed
wants to merge 11 commits into from
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,15 @@
"bug"
]
},
{
"login": "rax-public",
"name": "Rax Team",
"avatar_url": "https://avatars3.githubusercontent.com/u/59947214?v=4",
"profile": "https://github.com/rax-public",
"contributions": [
"code"
]
},
{
"login": "tomkuehl",
"name": "Tom Kühl",
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/components/SandboxCard/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const templates: TemplateType[] = [
'create-react-app',
'vue-cli',
'preact-cli',
'rax',
'svelte',
'create-react-app-typescript',
'angular-cli',
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/templates/helpers/is-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SERVER_TEMPLATE_NAMES = [
'node',
'nuxt',
'quasar-framework',
'rax',
'sapper',
'styleguidist',
'unibit',
Expand Down
5 changes: 5 additions & 0 deletions packages/common/src/templates/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ReasonIcon,
EmberIcon,
PreactIcon,
// RaxIcon,
VueIcon,
SvelteIcon,
DojoIcon,
Expand Down Expand Up @@ -33,6 +34,7 @@ import {
ember,
vue,
preact,
rax,
reactTs,
svelte,
angular,
Expand Down Expand Up @@ -68,6 +70,9 @@ export default function getIcon(theme: TemplateType) {
return VueIcon;
case preact.name:
return PreactIcon;
case rax.name:
// return RaxIcon;
return ReactIcon;
case reactTs.name:
return ReactIcon;
case svelte.name:
Expand Down
5 changes: 5 additions & 0 deletions packages/common/src/templates/iconsDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ReasonIconDark,
EmberIconDark,
PreactIconDark,
// RaxIconDark,
VueIconDark,
SvelteIconDark,
DojoIconDark,
Expand Down Expand Up @@ -33,6 +34,7 @@ import {
ember,
vue,
preact,
rax,
reactTs,
svelte,
angular,
Expand Down Expand Up @@ -68,6 +70,9 @@ export default function getIcon(theme: TemplateType) {
return VueIconDark;
case preact.name:
return PreactIconDark;
case rax.name:
// return RaxIconDark;
return ReactIconDark;
case reactTs.name:
return ReactIconDark;
case svelte.name:
Expand Down
5 changes: 5 additions & 0 deletions packages/common/src/templates/iconsLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ReasonIconLight,
EmberIconLight,
PreactIconLight,
// RaxIconLight,
VueIconLight,
SvelteIconLight,
DojoIconLight,
Expand Down Expand Up @@ -33,6 +34,7 @@ import {
ember,
vue,
preact,
rax,
reactTs,
svelte,
angular,
Expand Down Expand Up @@ -68,6 +70,9 @@ export default function getIcon(theme: TemplateType) {
return VueIconLight;
case preact.name:
return PreactIconLight;
case rax.name:
// return RaxIconLight;
return ReactIconLight;
case reactTs.name:
return ReactIconLight;
case svelte.name:
Expand Down
13 changes: 13 additions & 0 deletions packages/common/src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import adonis from './adonis';
import angular from './angular';
import apollo from './apollo-server';
import babel from './babel';
import parcel from './parcel';
import preact from './preact';
import rax from './rax';
import reason from './reason';
import react from './react';
import reactTs from './react-ts';
import svelte from './svelte';
import vue from './vue';
import ember from './ember';
import custom from './custom';
import cxjs from './cxjs';
import dojo from './dojo';
Expand Down Expand Up @@ -43,6 +52,7 @@ export {
dojo,
parcel,
preact,
rax,
react,
reactTs,
reason,
Expand All @@ -65,6 +75,7 @@ export type TemplateType =
| 'create-react-app'
| 'vue-cli'
| 'preact-cli'
| 'rax'
| 'svelte'
| 'create-react-app-typescript'
| 'angular-cli'
Expand Down Expand Up @@ -101,6 +112,8 @@ export default function getDefinition(theme?: TemplateType | null) {
return vue;
case preact.name:
return preact;
case rax.name:
return rax;
case reactTs.name:
return reactTs;
case svelte.name:
Expand Down
21 changes: 21 additions & 0 deletions packages/common/src/templates/rax.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Template from './template';
import { decorateSelector } from '../utils/decorate-selector';

export class RaxTemplate extends Template {
// The file to open by the editor
getDefaultOpenedFiles() {
return ['/src/app.js'];
}
}
export default new RaxTemplate(
'rax',
'Rax',
'https://rax.js.org/',
'github/raxjs/rax-codesandbox-template',
decorateSelector(() => '#FFB006'),
{
showOnHomePage: true,
distDir: 'build',
mainFile: []
}
);