Skip to content

Commit

Permalink
feat: update webpack-dev-server and node scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wsocha committed Sep 4, 2023
1 parent ab7a106 commit 15dfdf9
Show file tree
Hide file tree
Showing 8 changed files with 11,008 additions and 8,243 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
needs:
- lint

# The following steps are performed for each lint job
# The following steps are performed for each job
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -86,23 +86,23 @@ jobs:
- name: Compile the content
run: |
yarn install
yarn build
yarn build:content
yarn build:swagger
- name: Push compiled content
uses: s0/[email protected]
env:
REPO: self
BRANCH: en
FOLDER: compiled/openapi
FOLDER: compiled/content
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push GH pages for redundancy
uses: s0/[email protected]
env:
REPO: self
BRANCH: gh-pages
FOLDER: compiled/openapi
FOLDER: compiled/content
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push Swagger 2.0 backport
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
needs:
- lint

# The following steps are performed for each lint job
# The following steps are performed for each job
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -181,14 +181,14 @@ jobs:
- name: Compile the content
run: |
yarn install
yarn build
yarn build:content
- name: Push compiled content
uses: s0/[email protected]
env:
REPO: self
BRANCH: en-staging
FOLDER: compiled/openapi
FOLDER: compiled/content
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Trigger Netlify deployment"
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
# We run this on the latest ubuntu
runs-on: ubuntu-latest

# The following steps are performed for each lint job
# The following steps are performed for each job
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -238,7 +238,7 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/box-openapi
yarn install
yarn build
yarn build:content
- name: Check out the Codegen repo
uses: actions/checkout@v3
Expand All @@ -254,5 +254,5 @@ jobs:
npm install
cd scripts
npm install
cp $GITHUB_WORKSPACE/box-openapi/compiled/openapi/openapi.json .
cp $GITHUB_WORKSPACE/box-openapi/compiled/content/openapi.json .
npm run validate ./openapi.json
5 changes: 2 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ yarn install
yarn start
```

This final `yarn start` command starts up a local server and watches the files
for changes. It will open up a browser window with a preview of the compiled API
specification.
This final `yarn start` command starts up a local server. It will open up
a browser window with a preview of the API specification.

## Lint and validate the tests

Expand Down
39 changes: 17 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,23 @@
"version": "3.0.2",
"description": "Box Platform OpenAPI Specification",
"scripts": {
"prelint": "concurrently 'yarn lint:yaml' 'yarn build:dev'",
"lint": "concurrently 'yarn:lint:spectral' 'yarn:lint:spelling' 'yarn lint:markdown:spelling' 'yarn:lint:sensitivity' 'yarn lint:markdown'",
"lint:spectral": "NODE_NO_WARNINGS=1 spectral lint ./src/dev/openapi.json -F error",
"lint:spelling": "json-schema-spell-checker -a -n -d src/dictionaries/en_US -f 'description,title,summary' ./src/dev/openapi.json",
"prelint": "concurrently 'yarn lint:yaml' 'yarn build:schema'",
"lint": "concurrently 'yarn lint:spectral' 'yarn lint:spelling' 'yarn lint:markdown:spelling' 'yarn lint:sensitivity' 'yarn lint:markdown'",
"lint:spectral": "NODE_NO_WARNINGS=1 spectral lint openapi.json -F error",
"lint:spelling": "json-schema-spell-checker -a -n -d src/dictionaries/en_US -f 'description,title,summary' openapi.json",
"lint:markdown:spelling": "mdspell '*.md' './.github/**/*.md' 'docs/*.md' -a -n --en-us -d src/dictionaries/en_US -r",
"lint:sensitivity": "json-schema-sensitivity-checker -f 'description,title,summary' ./src/dev/openapi.json -c .alexrc.json",
"lint:sensitivity": "json-schema-sensitivity-checker -f 'description,title,summary' openapi.json -c .alexrc.json",
"lint:yaml": "yamllint content/",
"lint:markdown": "markdownlint -c markdownlintrc.json ./*.md ./docs/*.md ./.github/**/*.md",
"watch": "concurrently 'yarn:watch:*'",
"watch:tests": "watch 'yarn test' content src/scripts src/spectral docs",
"watch:build": "watch 'yarn run build:dev' content",
"clean": "rm -rf compiled && mkdir compiled",
"prebuild": "yarn run clean & yarn run build:index",
"build": "NODE_NO_WARNINGS=1 node -e 'require(\"./src/scripts/specLoader\").writeSpecification(\"./compiled/openapi\")'",
"build:dev": "NODE_NO_WARNINGS=1 node -e 'require(\"./src/scripts/specLoader\").writeSpecification(\"src/dev\")'",
"test": "yarn lint",
"prebuild": "yarn run build:index",
"build": "cp -rf openapi.json src/dev/openapi.json",
"build:index": "webpack --config webpack.dev.js",
"build:copy": "cp -rf .github src/dev/index.build.js src/dev/index.html src/dev/auth.html compiled/openapi",
"build:swagger": "node -e 'require(\"./src/scripts/swaggerConverter\").writeSpecification(\"./compiled/swagger\")'",
"postbuild": "yarn run build:copy",
"dev-server": "webpack serve --config webpack.dev.js",
"start": "concurrently 'yarn:dev-server' 'yarn:watch'",
"test": "yarn lint"
"build:content": "rm -rf compiled/content && mkdir -p compiled/content && yarn build:index && cp -rf .github openapi.json src/dev/index.build.js src/dev/index.html src/dev/auth.html compiled/content",
"build:swagger": "rm -rf compiled/swagger && mkdir -p compiled/swagger && node -e 'require(\"./src/scripts/swaggerConverter\").writeSpecification(\"./compiled/swagger\")'",
"build:schema": "NODE_NO_WARNINGS=1 node -e 'require(\"./src/scripts/specLoader\").writeSpecification(\".\")'",
"prestart": "yarn build",
"start": "webpack serve --config webpack.dev.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -58,11 +53,11 @@
"markdown-spellcheck": "^1.3.1",
"markdownlint-cli": "^0.25.0",
"style-loader": "^2.0.0",
"swagger-ui": "^4.18.1",
"swagger-ui": "^4.19.1",
"watch": "^1.0.2",
"webpack": "^5.7.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^4.11.1"
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"private": true
}
}
Loading

0 comments on commit 15dfdf9

Please sign in to comment.