Skip to content

Remove all 'create-react-app-typescript' references #1907

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

Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion contributor-docs/adding-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ In order to understand how this configuration works, we recommend you to take a

Examples:

- [create-react-app-typescript](https://github.com/codesandbox/codesandbox-client/blob/master/packages/app/src/sandbox/eval/presets/create-react-app-typescript/index.js) (most basic one)
- [CxJS](https://github.com/codesandbox/codesandbox-client/blob/master/packages/app/src/sandbox/eval/presets/cxjs/index.js)
- [vue-cli](https://github.com/codesandbox/codesandbox-client/blob/master/packages/app/src/sandbox/eval/presets/vue-cli/index.js)

Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { saveAs } from 'file-saver';
import { Sandbox, Module, Directory } from '@codesandbox/common/lib/types';
import {
react,
reactTs,
vue,
preact,
svelte,
Expand Down Expand Up @@ -209,7 +208,6 @@ export async function createZip(

if (
sandbox.template !== vue.name &&
sandbox.template !== reactTs.name &&
directories.find(m => m.title === 'src' && m.directoryShortid == null)
) {
// This is a full project, with all files already in there. We need to create
Expand All @@ -219,10 +217,6 @@ export async function createZip(
promise = import(
/* webpackChunkName: 'create-react-app-zip' */ './create-react-app'
).then(generator => generator.default(zip, sandbox, modules, directories));
} else if (sandbox.template === reactTs.name) {
promise = import(
/* webpackChunkName: 'create-react-app-typescript-zip' */ './create-react-app-typescript'
).then(generator => generator.default(zip, sandbox, modules, directories));
} else if (sandbox.template === vue.name) {
try {
const packageJSONModule = sandbox.modules.find(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { saveAs } from 'file-saver';
import type { Sandbox, Module, Directory } from '@codesandbox/common/lib/types';
import {
react,
reactTs,
vue,
preact,
svelte,
Expand Down Expand Up @@ -209,7 +208,6 @@ export async function createZip(

if (
sandbox.template !== vue.name &&
sandbox.template !== reactTs.name &&
directories.find(m => m.title === 'src' && m.directoryShortid == null)
) {
// This is a full project, with all files already in there. We need to create
Expand All @@ -221,12 +219,6 @@ export async function createZip(
).then(generator =>
generator.default(zip, sandbox, modules, directories, downloadBlobs)
);
} else if (sandbox.template === reactTs.name) {
promise = import(
/* webpackChunkName: 'create-react-app-typescript-zip' */ './create-react-app-typescript'
).then(generator =>
generator.default(zip, sandbox, modules, directories, downloadBlobs)
);
} else if (sandbox.template === vue.name) {
try {
const packageJSONModule = sandbox.modules.find(
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/sandbox/eval/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
parcel,
svelte,
preact,
reactTs,
angular,
cxjs,
babel,
Expand All @@ -15,7 +14,6 @@ import {
} from '@codesandbox/common/lib/templates';

import reactPreset from './presets/create-react-app';
import reactTsPreset from './presets/create-react-app-typescript';
import vuePreset from './presets/vue-cli';
import preactPreset from './presets/preact-cli';
import sveltePreset from './presets/svelte';
Expand All @@ -31,8 +29,6 @@ export default function getPreset(template: string) {
switch (template) {
case react.name:
return reactPreset();
case reactTs.name:
return reactTsPreset();
case reason.name:
return reasonPreset();
case vue.name:
Expand Down

This file was deleted.

4 changes: 1 addition & 3 deletions packages/app/src/sandbox/eval/tests/jest-lite.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dispatch, actions, listen } from 'codesandbox-api';
import { react, reactTs } from '@codesandbox/common/lib/templates';
import { react } from '@codesandbox/common/lib/templates';
import expect from 'jest-matchers';
import jestMock from 'jest-mock';
import jestTestHooks from 'jest-circus';
Expand Down Expand Up @@ -248,8 +248,6 @@ export default class TestRunner {
this.manager.resolveModule('./src/setupTests.ts', '/'),
];
}
} else if (this.manager.preset.name === reactTs.name) {
testModules = [this.manager.resolveModule('./src/setupTests.ts', '/')];
} else if (this.manager.configurations.package) {
const { parsed } = this.manager.configurations.package;

Expand Down
36 changes: 0 additions & 36 deletions packages/common/src/templates/configuration/tsconfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,6 @@ const config: ConfigurationFile = {
template: string,
resolveModule: (path: string) => { code: string } | undefined
) => {
if (template === 'create-react-app-typescript') {
return JSON.stringify(
{
compilerOptions: {
outDir: 'build/dist',
module: 'esnext',
target: 'es5',
lib: ['es6', 'dom'],
sourceMap: true,
allowJs: true,
jsx: 'react',
moduleResolution: 'node',
rootDir: 'src',
forceConsistentCasingInFileNames: true,
noImplicitReturns: true,
noImplicitThis: true,
noImplicitAny: true,
strictNullChecks: true,
suppressImplicitAnyIndexErrors: true,
noUnusedLocals: true,
},
exclude: [
'node_modules',
'build',
'scripts',
'acceptance-tests',
'webpack',
'jest',
'src/setupTests.ts',
],
},
null,
2
);
}

if (template === 'parcel') {
const tsconfig = {
compilerOptions: {
Expand Down
3 changes: 0 additions & 3 deletions packages/common/src/templates/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
ember,
vue,
preact,
reactTs,
svelte,
angular,
parcel,
Expand Down Expand Up @@ -72,8 +71,6 @@ export default function getIcon(theme: TemplateType): ReturnedIcon {
return Vue;
case preact.name:
return Preact;
case reactTs.name:
return React;
case svelte.name:
return Svelte;
case angular.name:
Expand Down
5 changes: 0 additions & 5 deletions packages/common/src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import parcel from './parcel';
import preact from './preact';
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';
Expand Down Expand Up @@ -43,7 +42,6 @@ export {
parcel,
preact,
react,
reactTs,
reason,
svelte,
vue,
Expand All @@ -64,7 +62,6 @@ export type TemplateType =
| 'vue-cli'
| 'preact-cli'
| 'svelte'
| 'create-react-app-typescript'
| 'angular-cli'
| 'parcel'
| 'cxjs'
Expand Down Expand Up @@ -94,8 +91,6 @@ export default function getDefinition(theme: TemplateType) {
return vue;
case preact.name:
return preact;
case reactTs.name:
return reactTs;
case svelte.name:
return svelte;
case angular.name:
Expand Down
19 changes: 0 additions & 19 deletions packages/common/src/templates/react-ts.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react-embed/src/SandboxEmbed/SandboxEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface CodeSandboxerProps {
* Allow codesandboxer to accept more extensions like .jsx
**/
extensions?: string[];
template?: 'create-react-app' | 'create-react-app-typescript';
template?: 'create-react-app';
}

export interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export interface Props {
skipEval?: boolean;
template?:
| 'create-react-app'
| 'create-react-app-typescript'
| 'parcel'
| 'vue-cli'
| 'angular-cli'
Expand Down