Skip to content

Commit 60fcab5

Browse files
committed
Rename jsx and scss files
1 parent 44384cf commit 60fcab5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+36
-21
lines changed

renamer.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const componentsDir = path.resolve(__dirname, 'src', 'core', 'renderers');
5+
6+
const components = fs.readdirSync(componentsDir);
7+
for (const component of components) {
8+
if (!fs.statSync(path.resolve(componentsDir, component)).isDirectory()) continue;
9+
const newJs = path.resolve(componentsDir, component, 'index.js');
10+
fs.renameSync(path.resolve(componentsDir, component, 'index.jsx'), newJs);
11+
const content = fs.readFileSync(newJs, { encoding: 'utf8' });
12+
fs.writeFileSync(newJs, content.replace('stylesheet.module.scss', `${component}.module.scss`), { encoding: 'utf8' });
13+
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`));
14+
}
15+
console.log(components);

src/components/App/index.jsx renamed to src/components/App/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { actions } from 'reducers';
1919
import { createUserFile, extension, refineGist } from 'common/util';
2020
import { exts, languages } from 'common/config';
2121
import { CONTRIBUTING_MD } from 'files';
22-
import styles from './stylesheet.module.scss';
22+
import styles from './App.module.scss';
2323

2424
class App extends BaseComponent {
2525
constructor(props) {

src/components/Button/index.jsx renamed to src/components/Button/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import faExclamationCircle from '@fortawesome/fontawesome-free-solid/faExclamati
55
import faSpinner from '@fortawesome/fontawesome-free-solid/faSpinner';
66
import { classes } from 'common/util';
77
import { Ellipsis } from 'components';
8-
import styles from './stylesheet.module.scss';
8+
import styles from './Button.module.scss';
99

1010
class Button extends React.Component {
1111
constructor(props) {

src/components/CodeEditor/index.jsx renamed to src/components/CodeEditor/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { actions } from 'reducers';
66
import { connect } from 'react-redux';
77
import { languages } from 'common/config';
88
import { Button, Ellipsis, FoldableAceEditor } from 'components';
9-
import styles from './stylesheet.module.scss';
9+
import styles from './CodeEditor.module.scss';
1010

1111
class CodeEditor extends React.Component {
1212
constructor(props) {

src/components/Divider/index.jsx renamed to src/components/Divider/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { classes } from 'common/util';
3-
import styles from './stylesheet.module.scss';
3+
import styles from './Divider.module.scss';
44

55
class Divider extends React.Component {
66
constructor(props) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy