-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial commit to convert everything to typescript
- Loading branch information
Sylvester Aswin Stanley
committed
Nov 1, 2020
1 parent
23f00ae
commit 9f5d8e2
Showing
110 changed files
with
3,408 additions
and
3,667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
module.exports = { | ||
parser: "babel-eslint", | ||
parser: "@typescript-eslint/parser", // Specifies the ESLint parser | ||
root: true, | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin | ||
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
plugins: [], | ||
parserOptions: { | ||
sourceType: "module" | ||
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features | ||
sourceType: "module", // Allows for the use of imports | ||
ecmaFeatures: {}, | ||
}, | ||
env: { | ||
es6: true, | ||
node: true | ||
node: true, | ||
}, | ||
extends: ["eslint:recommended", "prettier"], | ||
plugins: ["prettier"], | ||
rules: { | ||
"prettier/prettier": "error" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import path from "path"; | ||
import { promises as fsAsync } from "fs"; | ||
import _ from "lodash"; | ||
|
||
interface BuildCSS { | ||
packageName: string; | ||
atomCss: string; | ||
} | ||
|
||
export default async function ({ | ||
packageName, | ||
atomCss, | ||
}: BuildCSS): Promise<string> { | ||
const cssFile = await fsAsync.readFile( | ||
path.join(__dirname, "templates", "theme.css"), | ||
"utf-8" | ||
); | ||
const headTemplate = _.template( | ||
await fsAsync.readFile( | ||
path.join(__dirname, "templates", "head.html"), | ||
"utf-8" | ||
) | ||
); | ||
const headHtml = headTemplate({ | ||
packageName, | ||
cssFile, | ||
atomCss, | ||
}); | ||
|
||
return headHtml; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import buildCss from "./build-css"; | ||
import buildNav from "./build-nav"; | ||
import buildSidebar from "./build-sidebar"; | ||
import buildSections from "./build-sections"; | ||
import buildStats from "./build-stats"; | ||
|
||
/* Function which build all parts of the document */ | ||
export default async function buildDocPartials({ | ||
packageName, | ||
modules, | ||
atomCss, | ||
}: { | ||
packageName: string; | ||
modules: any; | ||
atomCss: string; | ||
}): Promise<{ | ||
headHtml: string; | ||
navHtml: string; | ||
sidebarHtml: string; | ||
sectionsHtml: string[]; | ||
statsHtml: string; | ||
}> { | ||
// Build the <head> | ||
const headHtml = await buildCss({ | ||
packageName, | ||
atomCss, | ||
}); | ||
// Build the <TopNav> | ||
const navHtml = await buildNav({ | ||
packageName, | ||
}); | ||
// Build the <Sidebar> | ||
const sidebarHtml = await buildSidebar({ | ||
modules, | ||
}); | ||
// Build the <Sections> | ||
const sectionsHtml = await buildSections({ | ||
modules, | ||
}); | ||
// Build the <> | ||
const statsHtml = await buildStats({ | ||
atomCss, | ||
}); | ||
|
||
return { | ||
headHtml, | ||
navHtml, | ||
sidebarHtml, | ||
sectionsHtml, | ||
statsHtml, | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import path from "path"; | ||
import _ from "lodash"; | ||
import { promises as fsAsync } from "fs"; | ||
|
||
interface BuildIndex { | ||
headHtml: string; | ||
navHtml: string; | ||
sidebarHtml: string; | ||
sectionsHtml: string[]; | ||
statsHtml: string; | ||
packageName: string; | ||
} | ||
|
||
export default async function ({ | ||
headHtml, | ||
navHtml, | ||
sidebarHtml, | ||
sectionsHtml, | ||
statsHtml, | ||
packageName, | ||
}: BuildIndex): Promise<string> { | ||
const indexTemplate = _.template( | ||
await fsAsync.readFile( | ||
path.join(__dirname, "templates", "index.html"), | ||
"utf-8" | ||
) | ||
); | ||
const indexHtml = indexTemplate({ | ||
packageName, | ||
head: headHtml, | ||
nav: navHtml, | ||
sidebar: sidebarHtml, | ||
sections: sectionsHtml, | ||
stats: statsHtml, | ||
}); | ||
|
||
return indexHtml; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import { promises as fsAsync } from "fs"; | ||
import _ from "lodash"; | ||
|
||
export default async function buildNav({ | ||
packageName, | ||
}: { | ||
packageName: string; | ||
}): Promise<string> { | ||
const navTemplate = _.template( | ||
await fsAsync.readFile( | ||
path.join(__dirname, "templates", "nav.html"), | ||
"utf8" | ||
) | ||
); | ||
const navHtml = navTemplate({ | ||
packageName, | ||
}); | ||
|
||
return navHtml; | ||
} |
Oops, something went wrong.