feat(client): ts-migrate client/utils/** (#42823)

* rename js files

* update imports and references

* migrate build-challenges

* migrate challenge-types

* migrate utils/index

* migrate state-management

* install @types/psl for tags

* migrate tags

* migrate tags.test

* migrate challenge-page-creator

* migrate utils/gatsby/index

* migrate layout-selector

* migrate layout-selector.test

* revert challenge-types

Curriculum can't handle TS or modules

* convert arrow functions

* revert build-challenges

* revert utils/gatsby/index

* revert challenge-page-creator

* revert challenge-types reference

* Delete state-management

Deleted in #42960

* Disable render-result-naming-convention (for now)

* update layout-selector.test comment

* reorder imports in build-challenges

* change ts-ignore to ts-expect-error
This commit is contained in:
awu43
2021-08-09 01:30:31 -07:00
committed by GitHub
parent fcadd534e7
commit dd5d2919be
23 changed files with 116 additions and 83 deletions

View File

@ -0,0 +1,82 @@
const html = 0;
const js = 1;
const backend = 2;
const zipline = 3;
const frontEndProject = 3;
const backEndProject = 4;
const bonfire = 5;
const modern = 6;
const step = 7;
const quiz = 8;
const invalid = 9;
const pythonProject = 10;
const video = 11;
const codeally = 12;
// individual exports
exports.backend = backend;
exports.frontEndProject = frontEndProject;
exports.backEndProject = backEndProject;
exports.pythonProject = pythonProject;
exports.challengeTypes = {
html,
js,
backend,
zipline,
frontEndProject,
backEndProject,
pythonProject,
bonfire,
modern,
step,
quiz,
invalid,
video,
codeally
};
// turn challengeType to file ext
exports.pathsMap = {
[html]: 'html',
[js]: 'js',
[bonfire]: 'js'
};
// determine the component to view for each challenge
exports.viewTypes = {
[html]: 'classic',
[js]: 'classic',
[bonfire]: 'classic',
[frontEndProject]: 'frontend',
[backEndProject]: 'backend',
[pythonProject]: 'frontend',
[modern]: 'modern',
[step]: 'step',
[quiz]: 'quiz',
[backend]: 'backend',
[video]: 'video',
[codeally]: 'codeally'
};
// determine the type of submit function to use for the challenge on completion
exports.submitTypes = {
[html]: 'tests',
[js]: 'tests',
[bonfire]: 'tests',
// requires just a single url
// like codepen.com/my-project
[frontEndProject]: 'project.frontEnd',
// requires two urls
// a hosted URL where the app is running live
// project code url like GitHub
[backEndProject]: 'project.backEnd',
[pythonProject]: 'project.backEnd',
[step]: 'step',
[quiz]: 'quiz',
[backend]: 'backend',
[modern]: 'tests',
[video]: 'tests'
};
// determine which help forum questions should be posted to
exports.helpCategoryMap = require('./help-category-map.json');