@@ -87,12 +87,12 @@ add (**sandbox** vs. **container**).
87
87
88
88
To get started, you should first follow the steps in our contribution guidelines
89
89
in order to
90
- [ set up CodeSandbox locally] ( https://github.com/codesandbox/codesandbox-client/blob/master /CONTRIBUTING.md#setting-up-the-project-locally ) .
90
+ [ set up CodeSandbox locally] ( https://github.com/codesandbox/codesandbox-client/blob/main /CONTRIBUTING.md#setting-up-the-project-locally ) .
91
91
92
92
### 1. Add template logo
93
93
94
94
Add the logo for your template in the
95
- [ templates repo] ( https://github.com/codesandbox/codesandbox-client/tree/master /packages/template-icons/src )
95
+ [ templates repo] ( https://github.com/codesandbox/codesandbox-client/tree/main /packages/template-icons/src )
96
96
(` codesandbox-templates/packages/template-icons/src ` ).
97
97
98
98
#### SVG logos
@@ -102,24 +102,24 @@ content. If your template's name is "Banana", name your logo file "BananaIcon".
102
102
103
103
Examples:
104
104
105
- - [ Vue logo] ( https://github.com/codesandbox/codesandbox-client/tree/master /packages/template-icons/src/VueIcon.tsx )
106
- - [ React logo] ( https://github.com/codesandbox/codesandbox-client/tree/master /packages/template-icons/src/ReactIcon.tsx )
105
+ - [ Vue logo] ( https://github.com/codesandbox/codesandbox-client/tree/main /packages/template-icons/src/VueIcon.tsx )
106
+ - [ React logo] ( https://github.com/codesandbox/codesandbox-client/tree/main /packages/template-icons/src/ReactIcon.tsx )
107
107
108
108
### 2. Add template definition
109
109
110
110
In order for CodeSandbox to recognise your template, you need to add a new
111
111
definition of it in the ` codesandbox-client/packages/common/src/templates `
112
- [ directory] ( https://github.com/codesandbox/codesandbox-client/tree/master /packages/common/src/templates ) .
112
+ [ directory] ( https://github.com/codesandbox/codesandbox-client/tree/main /packages/common/src/templates ) .
113
113
You do this by creating a new ` .ts ` file with the name of your template.
114
114
115
115
Examples:
116
116
117
- - [ Parcel] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/common/src/templates/parcel.ts )
118
- - [ Gatsby] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/common/src/templates/gatsby.ts )
117
+ - [ Parcel] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/common/src/templates/parcel.ts )
118
+ - [ Gatsby] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/common/src/templates/gatsby.ts )
119
119
120
120
The template definition can have various options, which you can find more
121
121
information about in
122
- [ template.ts] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/common/src/templates/template.ts ) .
122
+ [ template.ts] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/common/src/templates/template.ts ) .
123
123
124
124
We encourage you to improve the user experience of your templates by taking
125
125
advantage of the options you have available while writing your template
@@ -133,7 +133,7 @@ Examples:
133
133
<!-- TODO: Add more examples -->
134
134
135
135
After writing your template definition, you also need to add it to the
136
- [ index.js] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/common/src/templates/index.ts )
136
+ [ index.js] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/common/src/templates/index.ts )
137
137
file in the same directory (` codesandbox-client/packages/common/src/templates ` )
138
138
in order for CodeSandbox to be able to retrieve your template.
139
139
@@ -148,18 +148,18 @@ preset.
148
148
149
149
We call a template configuration for the bundler in CodeSandbox a 'Preset'. All
150
150
currently installed presets are defined in the
151
- [ index.ts] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/app/src/sandbox/eval/index.ts )
151
+ [ index.ts] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/app/src/sandbox/eval/index.ts )
152
152
file under ` codesandbox-client/packages/app/src/sandbox/eval/presets ` .
153
153
154
154
In order to understand how this configuration works, we recommend you to take a
155
155
look at templates that have already been implemented and their presets.
156
156
157
157
Examples:
158
158
159
- - [ create-react-app-typescript] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/app/src/sandbox/eval/presets/create-react-app-typescript/index.js )
159
+ - [ create-react-app-typescript] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/app/src/sandbox/eval/presets/create-react-app-typescript/index.js )
160
160
(most basic one)
161
- - [ CxJS] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/app/src/sandbox/eval/presets/cxjs/index.js )
162
- - [ vue-cli] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/app/src/sandbox/eval/presets/vue-cli/index.js )
161
+ - [ CxJS] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/app/src/sandbox/eval/presets/cxjs/index.js )
162
+ - [ vue-cli] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/app/src/sandbox/eval/presets/vue-cli/index.js )
163
163
164
164
### 4. Add the importer
165
165
@@ -169,7 +169,7 @@ template for every template. This logic is **not** found in `codesanbox-client`.
169
169
170
170
This means you that you also have to add your template in another file in the
171
171
` codesandbox-importers ` repository called
172
- [ templates.ts] ( https://github.com/codesandbox/codesandbox-importers/blob/master /packages/import-utils/src/create-sandbox/templates.ts ) .
172
+ [ templates.ts] ( https://github.com/codesandbox/codesandbox-importers/blob/main /packages/import-utils/src/create-sandbox/templates.ts ) .
173
173
174
174
When you create your Pull Request in ` codesanbox-client ` , you also need to
175
175
create a Pull Request in ` codesandbox-importer ` and reference it in your Pull
@@ -190,7 +190,7 @@ functionality of templates using containers.
190
190
191
191
To test your new template, you need to create a mock response from the API and
192
192
force the new template specification. To do this, you uncomment
193
- [ this line] ( https://github.com/codesandbox/codesandbox-client/blob/master /packages/app/src/app/store/actions.js#L17 )
193
+ [ this line] ( https://github.com/codesandbox/codesandbox-client/blob/main /packages/app/src/app/store/actions.js#L17 )
194
194
and change ` 'custom' ` to the id/name of your template:
195
195
196
196
``` diff
0 commit comments