Skip to content

Commit

Permalink
Merge pull request #586 from sebgroup/develop
Browse files Browse the repository at this point in the history
release the build changes to use node 15 and npm 7
  • Loading branch information
mario-subo authored Apr 22, 2021
2 parents 4a0c793 + 964b7e2 commit 60203b8
Show file tree
Hide file tree
Showing 11 changed files with 56,386 additions and 40,969 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14' ]
node: [ '15' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install npm@6
run: npm i npm@6 # to use workspace
- name: Installing dependencies
run: npm ci
- name: Testing
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Setup Node 🏗️
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 15.x

- name: Installing dependencies ⏳
run: npm ci
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Setup Node 🏗️
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 15.x
- name: Installing dependencies ⏳
run: npm ci
- name: Building docs 🔨
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 15.x

- name: Installing dependencies
run: npm ci
Expand Down
13 changes: 6 additions & 7 deletions docs/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ module.exports = {
icon: "src/assets/images/icon.png",
},
},
{
resolve: "gatsby-plugin-tsconfig-paths",
options: {
configFile: `${__dirname}/tsconfig.json`,
silent: true,
},
},
{
resolve: "gatsby-plugin-react-svg",
options: {
Expand All @@ -35,5 +28,11 @@ module.exports = {
},
},
},
{
resolve: `gatsby-plugin-polyfill-io`,
options: {
features: [`String.prototype.codePointAt`, `fetch`],
},
},
],
};
23 changes: 23 additions & 0 deletions docs/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");

exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
const config = getConfig();
const miniCssExtractPlugin = config.plugins.find((plugin) => plugin.constructor.name === "MiniCssExtractPlugin");
if (miniCssExtractPlugin) {
miniCssExtractPlugin.options.ignoreOrder = true;
}
actions.setWebpackConfig({
resolve: {
plugins: [
new TsconfigPathsPlugin({
configFile: `${__dirname}/tsconfig.json`,
silent: true,
}),
],
fallback: {
os: require.resolve("os-browserify/browser"),
path: require.resolve("path-browserify"),
},
},
});
};
17,434 changes: 0 additions & 17,434 deletions docs/package-lock.json

This file was deleted.

30 changes: 19 additions & 11 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,31 @@
},
"license": "Apache-2.0",
"dependencies": {
"@sebgroup/frontend-tools": "^2.0.2",
"browser-typescript-parser": "^2.6.7",
"gatsby": "^2.26.1",
"gatsby-plugin-manifest": "^2.9.1",
"gatsby-plugin-offline": "^3.7.1",
"gatsby-plugin-react-helmet": "^3.7.0",
"classnames": "^2.2.6",
"gatsby": "^3.2.1",
"gatsby-plugin-manifest": "^3.2.0",
"gatsby-plugin-offline": "^4.2.0",
"gatsby-plugin-polyfill-io": "^1.1.0",
"gatsby-plugin-react-helmet": "^4.2.0",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-sass": "^2.8.0",
"gatsby-plugin-sitemap": "^2.9.0",
"gatsby-plugin-tsconfig-paths": "^1.0.2",
"gatsby-plugin-sass": "^4.2.0",
"gatsby-plugin-sitemap": "^3.2.0",
"lorem-ipsum": "^2.0.3",
"react-helmet": "^6.1.0",
"react-syntax-highlighter": "^15.4.3",
"classnames": "^2.2.6",
"@sebgroup/frontend-tools": "^2.0.2"
"react-syntax-highlighter": "^15.4.3"
},
"devDependencies": {
"@types/react-helmet": "^6.1.0",
"dotenv": "^8.2.0"
"dotenv": "^8.2.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"tsconfig-paths-webpack-plugin": "^3.5.1"
},
"resolutions": {
"graphql": "^15.4.0",
"graphql-compose": "^7.25.0",
"webpack": "^5.24.2"
}
}
20 changes: 12 additions & 8 deletions docs/src/utils/api-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ interface RegexMapper<T = any> {
index: string;
}

interface DefaultFileImport {
default: string;
}

export class APIExtractService {
constructor() {}
tsParser: TypescriptParser = new TypescriptParser();
Expand Down Expand Up @@ -183,11 +187,11 @@ export class APIExtractService {
* @param importedTypeFileUrls array of imported types file source
* @returns promise of list of API section
*/
parseSourceFile(source: string, importedTypeFileUrls: Array<any>): Promise<Array<ApiSection>> {
const description: APIInput = APIExtractService.extractDescription(source);
return this.tsParser.parseSource(source).then(async (res: ParsedFile) => {
parseSourceFile(source: DefaultFileImport, importedTypeFileUrls: Array<any>): Promise<Array<ApiSection>> {
const description: APIInput = APIExtractService.extractDescription(source.default);
return this.tsParser.parseSource(source.default).then(async (res: ParsedFile) => {
const importedInterfaces = await this.extractImportedTypesInterfaces(importedTypeFileUrls);
return this.parse(res, source, importedInterfaces, description);
return this.parse(res, source.default, importedInterfaces, description);
});
}

Expand Down Expand Up @@ -240,10 +244,10 @@ export class APIExtractService {
* @return list of list of parsed types/ interfaces
*/
async extractImportedTypesInterfaces(imports: Array<any>): Promise<Array<Array<ParsedPropertyDeclartion>>> {
const test = imports.map((item: any) => {
const rawSource: string = item;
return this.tsParser.parseSource(rawSource).then((parsedFile: ParsedFile) => {
return this.parseTypesInterfaces(this.extractTypesInterfaces(parsedFile, rawSource), "").interfaces;
const test = imports.map((item: DefaultFileImport) => {
const rawSource: DefaultFileImport = item;
return this.tsParser.parseSource(rawSource.default).then((parsedFile: ParsedFile) => {
return this.parseTypesInterfaces(this.extractTypesInterfaces(parsedFile, rawSource.default), "").interfaces;
});
});
return await Promise.all(test);
Expand Down
Loading

0 comments on commit 60203b8

Please sign in to comment.