Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit ef36b5c

Browse files
authored
Refactor html folders to src (#300)
* Move html to src\views folder * Fix path after moving files.
1 parent b3b14e6 commit ef36b5c

Some content is hidden

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

43 files changed

+13
-13
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ out
33
node_modules
44
.vscode-test
55
.idea
6-
html/app/sprites-generated
6+
src/views/app/sprites-generated

gulpfile.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ const childProcess = require("child_process");
1414

1515
//...
1616
gulp.task("tslint", () => {
17-
return gulp.src(["**/*.ts", "**/*.tsx", "!**/*.d.ts", "!node_modules/**", "!./html/node_modules/**"])
17+
return gulp.src(["**/*.ts", "**/*.tsx", "!**/*.d.ts", "!node_modules/**", "!./src/views/node_modules/**"])
1818
.pipe(tslint())
1919
.pipe(tslint.report());
2020
});
2121

2222
gulp.task("eslint", () => {
23-
return gulp.src(["./vendor/**/*.js","!**/node_modules/**"])
23+
return gulp.src(["./vendor/**/*.js", "!**/node_modules/**"])
2424
.pipe(eslint())
2525
.pipe(eslint.format())
2626
.pipe(eslint.failAfterError());
2727
});
2828

2929
gulp.task("html-webpack", (done) => {
30-
const config = require("./html/webpack.config.js");
31-
config.context = `${__dirname}/html`;
30+
const config = require("./src/views/webpack.config.js");
31+
config.context = `${__dirname}/src/views`;
3232
return webpack(config, (err, stats) => {
3333
const statsJson = stats.toJson();
3434
if (err || (statsJson.errors && statsJson.errors.length)) {
@@ -91,7 +91,7 @@ gulp.task("test", (done) => {
9191
}
9292

9393
// When using cli command "npm test" to exec test, the depended extensions (cpptools) are not available so that
94-
// the extension cannot be activated. As a workaround, remove extensionDependencies from package.json before running test
94+
// the extension cannot be activated. As a workaround, remove extensionDependencies from package.json before running test
9595
// and restore extensionDependencies after test exited.
9696
removeExtensionDependencies();
9797

@@ -127,6 +127,6 @@ gulp.task("build", (done) => {
127127
});
128128

129129
gulp.task("watch", () => {
130-
gulp.watch(["./src/**/*", "./test/**/*"], ["ts-compile"]);
131-
gulp.watch(["./html/**/*", "!./html/node_modules/**"], ["html-webpack"]);
130+
gulp.watch(["./src/**/*", "./test/**/*", "!./src/views/**/*"], ["ts-compile"]);
131+
gulp.watch(["./src/views/**/*", "!./src/views/node_modules/**"], ["html-webpack"]);
132132
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
},
168168
"scripts": {
169169
"vscode:prepublish": "gulp build",
170-
"postinstall": "node ./node_modules/vscode/bin/install && cd ./html && npm install",
170+
"postinstall": "node ./node_modules/vscode/bin/install && cd ./src/views && npm install",
171171
"test": "gulp test"
172172
},
173173
"extensionDependencies": [

src/arduino/arduinoContentProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class ArduinoContentProvider implements vscode.TextDocumentContentProvide
104104
}
105105

106106
public getHtmlView(req, res) {
107-
return res.sendFile(path.join(this._extensionPath, "./out/html/index.html"));
107+
return res.sendFile(path.join(this._extensionPath, "./out/views/index.html"));
108108
}
109109

110110
public async getBoardPackages(req, res) {

src/arduino/localWebServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class LocalWebServer {
1414
private _serverPort: string;
1515

1616
constructor(private _extensionPath: string) {
17-
this.app.use("/", express.static(path.join(this._extensionPath, "./out/html")));
17+
this.app.use("/", express.static(path.join(this._extensionPath, "./out/views")));
1818
this.app.use(bodyParser.json());
1919
this.server = http.createServer(this.app);
2020
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

html/webpack.config.js renamed to src/views/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
`${__dirname}/app/index.tsx`
1010
],
1111
output: {
12-
path: `${__dirname}/../out/html`,
12+
path: `${__dirname}/../../out/views`,
1313
filename: "app.js"
1414
},
1515
resolve: {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"exclude": [
1414
"node_modules",
1515
".vscode-test",
16-
"html"
16+
"src/views"
1717
]
1818
}

0 commit comments

Comments
 (0)