Skip to content

Commit

Permalink
fix: use js-yaml not sed
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Nov 4, 2022
1 parent 10c9f9f commit 3a02860
Show file tree
Hide file tree
Showing 4 changed files with 944 additions and 834 deletions.
3 changes: 2 additions & 1 deletion lib/nile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"start": "tsdx watch",
"build": "tsdx build && yarn build:types",
"prebuild": "yarn build:api:gen && ./scripts/api-cleaner.sh",
"prebuild": "yarn build:api:gen && ./scripts/api-cleaner.mjs",
"build:types": "tsc -d --declarationDir dist --emitDeclarationOnly",
"build:api:gen": "yarn openapi-generator-cli generate --skip-validate-spec -t templates -i spec/api.yaml -g typescript-fetch --package-name @theniledev/js -o src/client --additional-properties=withoutRuntimeChecks=true,ngVersion=6.1.7,npmName=theniledev,supportsES6=true,npmVersion=6.9.0,withInterfaces=true,moduleName=Nile,typescriptThreePlus=true,projectName=@theniledev/js",
"generate-api-docs": "yarn typedoc --out docs/api --plugin typedoc-plugin-markdown --theme markdown --disableSources --excludeProtected --excludePrivate --excludeNotDocumented --hideBreadcrumbs true --hideInPageTOC true ./src/index.ts",
Expand Down Expand Up @@ -68,6 +68,7 @@
"dependencies": {
"@openapitools/openapi-generator-cli": "^2.5.2",
"es6-promise": "^4.2.8",
"js-yaml": "^4.1.0",
"node-fetch": "^3.2.10",
"sade": "^1.8.1"
}
Expand Down
15 changes: 15 additions & 0 deletions lib/nile/scripts/api-cleaner.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node
/* eslint-disable no-console */

import fs from 'fs';
import path from 'path';

import yaml from 'js-yaml';

const apiFilePath = path.join(process.cwd(), 'spec/api.yaml');
const apiFile = fs.readFileSync(apiFilePath, 'utf8');
const apiYaml = yaml.load(apiFile, {});

apiYaml.components.parameters.workspace.required = false;

fs.writeFileSync(apiFilePath, yaml.dump(apiYaml, {}));
4 changes: 0 additions & 4 deletions lib/nile/scripts/api-cleaner.sh

This file was deleted.

2 comments on commit 3a02860

@vercel
Copy link

@vercel vercel bot commented on 3a02860 Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nile-js – ./

nile-js.vercel.app
nile-js-theniledev.vercel.app
nile-js-git-master-theniledev.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 3a02860 Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.