Skip to content

Commit

Permalink
update node to 18.x
Browse files Browse the repository at this point in the history
  • Loading branch information
netweng committed Oct 19, 2023
1 parent 1043be0 commit bc32cef
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 54 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=development
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'
- uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
- name: get version
run: echo "TAG_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: create release
Expand All @@ -42,7 +42,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
Expand Down
11 changes: 1 addition & 10 deletions cloudtower-api-doc/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const webpack = require("webpack");

if(!process.env.TAURI_ENV) {
process.env = new Proxy(process.env, {
get(target, prop) {
if(prop === 'NODE_ENV') {
return 'development'
}
return typeof target[prop] === 'function' ? target[prop].bind(target) : target[prop]
}
})
}

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -89,6 +79,7 @@ const config = {
};
},
'docusaurus-plugin-sass',
'docusaurus2-dotenv'
],

themeConfig:
Expand Down
17 changes: 10 additions & 7 deletions cloudtower-api-doc/swagger/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,16 @@ const App: React.FC = () => {
const specRef = useRef<ISpec>(spec);
useEffect(() => {
const lastVersion = specMap[version] ? version : Object.keys(specMap)[0];
const swaggerSpec: ISpec = _.cloneDeep(specMap[lastVersion]);
setRawSpec(swaggerSpec);
i18next.changeLanguage(i18n.currentLocale);
const newSpec = splitSchema(
wrapSpecWithI18n(swaggerSpec, i18n.currentLocale, version)
);
setSpec(newSpec);
specMap[lastVersion].then(data => {
const swaggerSpec: ISpec = _.cloneDeep(data.default);
setRawSpec(swaggerSpec);
i18next.changeLanguage(i18n.currentLocale);
const newSpec = splitSchema(
wrapSpecWithI18n(swaggerSpec, i18n.currentLocale, version)
);
setSpec(newSpec);
})

}, [version, i18n.currentLocale]);

useEffect(() => {
Expand Down
50 changes: 16 additions & 34 deletions cloudtower-api-doc/swagger/utils/swagger.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
import { OpenAPIV3 } from 'openapi-types';

import swaggerSpec1_8 from "../../static/specs/1.8.0-swagger.json";
import swaggerSpec1_9 from '../../static/specs/1.9.0-swagger.json';
import swaggerSpec1_10 from '../../static/specs/1.10.0-swagger.json';
import swaggerSpec2_0 from '../../static/specs/2.0.0-swagger.json';
import swaggerSpec2_1 from '../../static/specs/2.1.0-swagger.json';
import swaggerSpec2_2 from '../../static/specs/2.2.0-swagger.json';
import swaggerSpec2_3 from '../../static/specs/2.3.0-swagger.json';
import swaggerSpec2_4 from '../../static/specs/2.4.0-swagger.json';
import swaggerSpec2_5 from '../../static/specs/2.5.0-swagger.json';
import swaggerSpec2_6 from '../../static/specs/2.6.0-swagger.json';
import swaggerSpec2_7 from '../../static/specs/2.7.0-swagger.json';
import swaggerSpec2_8 from '../../static/specs/2.8.0-swagger.json';
import swaggerSpec3_0 from '../../static/specs/3.0.0-swagger.json';
import swaggerSpec3_1 from '../../static/specs/3.1.0-swagger.json';
import swaggerSpec3_2 from '../../static/specs/3.2.0-swagger.json';
import swaggerSpec3_3 from '../../static/specs/3.3.0-swagger.json';


export const specMap = {
'3.3.0': swaggerSpec3_3,
'3.2.0': swaggerSpec3_2,
'3.1.0': swaggerSpec3_1,
'3.0.0': swaggerSpec3_0,
'2.8.0': swaggerSpec2_8,
'2.7.0': swaggerSpec2_7,
'2.6.0': swaggerSpec2_6,
'2.5.0': swaggerSpec2_5,
'2.4.0': swaggerSpec2_4,
'2.3.0': swaggerSpec2_3,
'2.2.0': swaggerSpec2_2,
'2.1.0': swaggerSpec2_1,
'2.0.0': swaggerSpec2_0,
'1.10.0': swaggerSpec1_10,
'1.9.0': swaggerSpec1_9,
'1.8.0': swaggerSpec1_8,
'3.3.0': import('../../static/specs/3.3.0-swagger.json'),
'3.2.0': import('../../static/specs/3.2.0-swagger.json'),
'3.1.0': import('../../static/specs/3.1.0-swagger.json'),
'3.0.0': import('../../static/specs/3.0.0-swagger.json'),
'2.8.0': import('../../static/specs/2.8.0-swagger.json'),
'2.7.0': import('../../static/specs/2.7.0-swagger.json'),
'2.6.0': import('../../static/specs/2.6.0-swagger.json'),
'2.5.0': import('../../static/specs/2.5.0-swagger.json'),
'2.4.0': import('../../static/specs/2.4.0-swagger.json'),
'2.3.0': import('../../static/specs/2.3.0-swagger.json'),
'2.2.0': import('../../static/specs/2.2.0-swagger.json'),
'2.1.0': import('../../static/specs/2.1.0-swagger.json'),
'2.0.0': import('../../static/specs/2.0.0-swagger.json'),
'1.10.0': import('../../static/specs/1.10.0-swagger.json'),
'1.9.0': import('../../static/specs/1.9.0-swagger.json'),
'1.8.0': import('../../static/specs/1.8.0-swagger.json'),
}


Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"commander": "^11.0.0",
"cross-env": "^7.0.3",
"docusaurus-plugin-sass": "^0.2.3",
"docusaurus2-dotenv": "^1.4.0",
"fs-extra": "^10.0.1",
"graphql": "^16.3.0",
"i18next": "^21.3.1",
Expand Down
37 changes: 37 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6742,6 +6742,7 @@ __metadata:
core-js: ^3.21.1
cross-env: ^7.0.3
docusaurus-plugin-sass: ^0.2.3
docusaurus2-dotenv: ^1.4.0
fs-extra: ^10.0.1
graphql: ^16.3.0
httpsnippet: ^2.0.0
Expand Down Expand Up @@ -7869,6 +7870,15 @@ __metadata:
languageName: node
linkType: hard

"docusaurus2-dotenv@npm:^1.4.0":
version: 1.4.0
resolution: "docusaurus2-dotenv@npm:1.4.0"
dependencies:
dotenv-webpack: 1.7.0
checksum: 5589ab71fe4de7bf53ebca47b6763d4dc37708df8171dd515a0464c4509f0bcc78d0cc823a31f32bcd0ba28873d7f4c946a47e61f9ad26104a2eac57f9f29224
languageName: node
linkType: hard

"dom-converter@npm:^0.2.0":
version: 0.2.0
resolution: "dom-converter@npm:0.2.0"
Expand Down Expand Up @@ -8023,6 +8033,33 @@ __metadata:
languageName: node
linkType: hard

"dotenv-defaults@npm:^1.0.2":
version: 1.1.1
resolution: "dotenv-defaults@npm:1.1.1"
dependencies:
dotenv: ^6.2.0
checksum: 623749be33fc30b686ff910522e4c222a08aa4d0011ff40b4354baee5db796f00eb42e818425667db2ffe9d8d2ae5f597a5e5b066b797f7aab9e06e515088fd6
languageName: node
linkType: hard

"dotenv-webpack@npm:1.7.0":
version: 1.7.0
resolution: "dotenv-webpack@npm:1.7.0"
dependencies:
dotenv-defaults: ^1.0.2
peerDependencies:
webpack: ^1 || ^2 || ^3 || ^4
checksum: b5039955cff5961dae690bc779b928ac3ec637ba4223032c62c7bb4d034756d8074aaf4990c2199b87806ce51bf73019349c9930dd8872062427dcd492b37bb3
languageName: node
linkType: hard

"dotenv@npm:^6.2.0":
version: 6.2.0
resolution: "dotenv@npm:6.2.0"
checksum: d4aa189741ff45553038b0436dfdb79143c29760d3481b4b19d9f1c59fb8cc69190ab83674e07b32b3dd2ae477579619cde9f7586ea82086151dbbac5626c54c
languageName: node
linkType: hard

"duplexer3@npm:^0.1.4":
version: 0.1.4
resolution: "duplexer3@npm:0.1.4"
Expand Down

0 comments on commit bc32cef

Please sign in to comment.