提交 60fcab5b 编写于 作者: J Jason Park

Rename jsx and scss files

上级 44384cfe
const fs = require('fs');
const path = require('path');
const componentsDir = path.resolve(__dirname, 'src', 'core', 'renderers');
const components = fs.readdirSync(componentsDir);
for (const component of components) {
if (!fs.statSync(path.resolve(componentsDir, component)).isDirectory()) continue;
const newJs = path.resolve(componentsDir, component, 'index.js');
fs.renameSync(path.resolve(componentsDir, component, 'index.jsx'), newJs);
const content = fs.readFileSync(newJs, { encoding: 'utf8' });
fs.writeFileSync(newJs, content.replace('stylesheet.module.scss', `${component}.module.scss`), { encoding: 'utf8' });
if (fs.existsSync(path.resolve(componentsDir, component, 'stylesheet.module.scss'))) fs.renameSync(path.resolve(componentsDir, component, 'stylesheet.module.scss'), path.resolve(componentsDir, component, `${component}.module.scss`));
}
console.log(components);
...@@ -19,7 +19,7 @@ import { actions } from 'reducers'; ...@@ -19,7 +19,7 @@ import { actions } from 'reducers';
import { createUserFile, extension, refineGist } from 'common/util'; import { createUserFile, extension, refineGist } from 'common/util';
import { exts, languages } from 'common/config'; import { exts, languages } from 'common/config';
import { CONTRIBUTING_MD } from 'files'; import { CONTRIBUTING_MD } from 'files';
import styles from './stylesheet.module.scss'; import styles from './App.module.scss';
class App extends BaseComponent { class App extends BaseComponent {
constructor(props) { constructor(props) {
......
...@@ -5,7 +5,7 @@ import faExclamationCircle from '@fortawesome/fontawesome-free-solid/faExclamati ...@@ -5,7 +5,7 @@ import faExclamationCircle from '@fortawesome/fontawesome-free-solid/faExclamati
import faSpinner from '@fortawesome/fontawesome-free-solid/faSpinner'; import faSpinner from '@fortawesome/fontawesome-free-solid/faSpinner';
import { classes } from 'common/util'; import { classes } from 'common/util';
import { Ellipsis } from 'components'; import { Ellipsis } from 'components';
import styles from './stylesheet.module.scss'; import styles from './Button.module.scss';
class Button extends React.Component { class Button extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -6,7 +6,7 @@ import { actions } from 'reducers'; ...@@ -6,7 +6,7 @@ import { actions } from 'reducers';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { languages } from 'common/config'; import { languages } from 'common/config';
import { Button, Ellipsis, FoldableAceEditor } from 'components'; import { Button, Ellipsis, FoldableAceEditor } from 'components';
import styles from './stylesheet.module.scss'; import styles from './CodeEditor.module.scss';
class CodeEditor extends React.Component { class CodeEditor extends React.Component {
constructor(props) { constructor(props) {
......
import React from 'react'; import React from 'react';
import { classes } from 'common/util'; import { classes } from 'common/util';
import styles from './stylesheet.module.scss'; import styles from './Divider.module.scss';
class Divider extends React.Component { class Divider extends React.Component {
constructor(props) { constructor(props) {
......
import React from 'react'; import React from 'react';
import styles from './stylesheet.module.scss'; import styles from './Ellipsis.module.scss';
import { classes } from 'common/util'; import { classes } from 'common/util';
class Ellipsis extends React.Component { class Ellipsis extends React.Component {
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import faCaretDown from '@fortawesome/fontawesome-free-solid/faCaretDown'; import faCaretDown from '@fortawesome/fontawesome-free-solid/faCaretDown';
import faCaretRight from '@fortawesome/fontawesome-free-solid/faCaretRight'; import faCaretRight from '@fortawesome/fontawesome-free-solid/faCaretRight';
import styles from './stylesheet.module.scss'; import styles from './ExpandableListItem.module.scss';
import { ListItem } from 'components'; import { ListItem } from 'components';
import { classes } from 'common/util'; import { classes } from 'common/util';
......
...@@ -20,7 +20,7 @@ import { classes, refineGist } from 'common/util'; ...@@ -20,7 +20,7 @@ import { classes, refineGist } from 'common/util';
import { actions } from 'reducers'; import { actions } from 'reducers';
import { languages } from 'common/config'; import { languages } from 'common/config';
import { BaseComponent, Button, Ellipsis, ListItem, Player } from 'components'; import { BaseComponent, Button, Ellipsis, ListItem, Player } from 'components';
import styles from './stylesheet.module.scss'; import styles from './Header.module.scss';
class Header extends BaseComponent { class Header extends BaseComponent {
handleClickFullScreen() { handleClickFullScreen() {
......
import React from 'react'; import React from 'react';
import styles from './stylesheet.module.scss'; import styles from './ListItem.module.scss';
import { classes } from 'common/util'; import { classes } from 'common/util';
import { Button, Ellipsis } from 'components'; import { Button, Ellipsis } from 'components';
......
...@@ -8,7 +8,7 @@ import faGithub from '@fortawesome/fontawesome-free-brands/faGithub'; ...@@ -8,7 +8,7 @@ import faGithub from '@fortawesome/fontawesome-free-brands/faGithub';
import { ExpandableListItem, ListItem } from 'components'; import { ExpandableListItem, ListItem } from 'components';
import { classes } from 'common/util'; import { classes } from 'common/util';
import { actions } from 'reducers'; import { actions } from 'reducers';
import styles from './stylesheet.module.scss'; import styles from './Navigator.module.scss';
class Navigator extends React.Component { class Navigator extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -11,7 +11,7 @@ import { classes, extension } from 'common/util'; ...@@ -11,7 +11,7 @@ import { classes, extension } from 'common/util';
import { TracerApi } from 'apis'; import { TracerApi } from 'apis';
import { actions } from 'reducers'; import { actions } from 'reducers';
import { BaseComponent, Button, ProgressBar } from 'components'; import { BaseComponent, Button, ProgressBar } from 'components';
import styles from './stylesheet.module.scss'; import styles from './Player.module.scss';
class Player extends BaseComponent { class Player extends BaseComponent {
constructor(props) { constructor(props) {
......
import React from 'react'; import React from 'react';
import { classes } from 'common/util'; import { classes } from 'common/util';
import styles from './stylesheet.module.scss'; import styles from './ProgressBar.module.scss';
class ProgressBar extends React.Component { class ProgressBar extends React.Component {
constructor(props) { constructor(props) {
......
import React from 'react'; import React from 'react';
import { classes } from 'common/util'; import { classes } from 'common/util';
import { Divider } from 'components'; import { Divider } from 'components';
import styles from './stylesheet.module.scss'; import styles from './ResizableContainer.module.scss';
class ResizableContainer extends React.Component { class ResizableContainer extends React.Component {
handleResize(prevIndex, index, targetElement, clientX, clientY) { handleResize(prevIndex, index, targetElement, clientX, clientY) {
......
...@@ -6,7 +6,7 @@ import faPlus from '@fortawesome/fontawesome-free-solid/faPlus'; ...@@ -6,7 +6,7 @@ import faPlus from '@fortawesome/fontawesome-free-solid/faPlus';
import { classes } from 'common/util'; import { classes } from 'common/util';
import { actions } from 'reducers'; import { actions } from 'reducers';
import { languages } from 'common/config'; import { languages } from 'common/config';
import styles from './stylesheet.module.scss'; import styles from './TabContainer.module.scss';
class TabContainer extends React.Component { class TabContainer extends React.Component {
handleAddFile() { handleAddFile() {
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { actions } from 'reducers'; import { actions } from 'reducers';
import { classes } from 'common/util'; import { classes } from 'common/util';
import styles from './stylesheet.module.scss'; import styles from './ToastContainer.module.scss';
class ToastContainer extends React.Component { class ToastContainer extends React.Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { BaseComponent } from 'components'; import { BaseComponent } from 'components';
import { actions } from 'reducers'; import { actions } from 'reducers';
import styles from './stylesheet.module.scss'; import styles from './VisualizationViewer.module.scss';
import * as TracerClasses from 'core/tracers'; import * as TracerClasses from 'core/tracers';
import * as LayoutClasses from 'core/layouts'; import * as LayoutClasses from 'core/layouts';
import { classes } from 'common/util'; import { classes } from 'common/util';
......
import React from 'react'; import React from 'react';
import { Array1DRenderer, Renderer } from 'core/renderers'; import { Array1DRenderer, Renderer } from 'core/renderers';
import styles from './stylesheet.module.scss'; import styles from './Array2DRenderer.module.scss';
import { classes } from 'common/util'; import { classes } from 'common/util';
class Array2DRenderer extends Renderer { class Array2DRenderer extends Renderer {
......
import React from 'react'; import React from 'react';
import { Bar } from 'react-chartjs-2'; import { Bar } from 'react-chartjs-2';
import { Array1DRenderer } from 'core/renderers'; import { Array1DRenderer } from 'core/renderers';
import styles from './stylesheet.module.scss'; import styles from './ChartRenderer.module.scss';
class ChartRenderer extends Array1DRenderer { class ChartRenderer extends Array1DRenderer {
renderData() { renderData() {
......
import React from 'react'; import React from 'react';
import { Renderer } from 'core/renderers'; import { Renderer } from 'core/renderers';
import { classes, distance } from 'common/util'; import { classes, distance } from 'common/util';
import styles from './stylesheet.module.scss'; import styles from './GraphRenderer.module.scss';
class GraphRenderer extends Renderer { class GraphRenderer extends Renderer {
constructor(props) { constructor(props) {
......
import React from 'react'; import React from 'react';
import { Renderer } from 'core/renderers'; import { Renderer } from 'core/renderers';
import styles from './stylesheet.module.scss'; import styles from './LogRenderer.module.scss';
class LogRenderer extends Renderer { class LogRenderer extends Renderer {
constructor(props) { constructor(props) {
......
import React from 'react'; import React from 'react';
import { Renderer } from 'core/renderers'; import { Renderer } from 'core/renderers';
import styles from './stylesheet.module.scss'; import styles from './MarkdownRenderer.module.scss';
import ReactMarkdown from 'react-markdown'; import ReactMarkdown from 'react-markdown';
class MarkdownRenderer extends Renderer { class MarkdownRenderer extends Renderer {
......
import React from 'react'; import React from 'react';
import styles from './stylesheet.module.scss'; import styles from './Renderer.module.scss';
import { Ellipsis } from 'components'; import { Ellipsis } from 'components';
import { classes } from 'common/util'; import { classes } from 'common/util';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册