Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: spec refresh #801

Merged
merged 2 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/sdk-codegen-scripts/scripts/refresh_specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

import { updateSpecs } from './utils'
;(async () => {
console.warn('Did you `yarn wipe` in the root to clear the old spec files?')
console.warn('Did you remove the specs in the /specs folder?')
await updateSpecs()
})()
13 changes: 1 addition & 12 deletions packages/sdk-codegen-scripts/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ const homeToRoost = '../../../'
const getRootPath = () => path.join(__dirname, homeToRoost)
const rootFile = (fileName = '') => path.join(getRootPath(), fileName)

export const apixSpecFileName = (fileName: string) => {
const p = path.parse(fileName)
return rootFile(`spec/${p.base}`)
}

// const copySpec = (fileName: string) => {
// const dest = apixSpecFileName(fileName)
// fs.copyFileSync(fileName, dest)
// console.info(`Copied ${fileName} to ${dest}`)
// }

export const updateSpecs = async (apiVersions = supportedApiVersions) => {
const iniFile = rootFile('looker.ini')
const config = SDKConfig(iniFile)
Expand All @@ -63,7 +52,7 @@ export const updateSpecs = async (apiVersions = supportedApiVersions) => {
} in ${iniFile} ...`
)
const lookerVersions = await fetchLookerVersions(props)
const specs = getSpecsFromVersions(lookerVersions)
const specs = await getSpecsFromVersions(lookerVersions)
for (const v of apiVersions) {
try {
const specFile = await logConvertSpec(name, specs[v], lookerVersions)
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk-codegen/src/specConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export interface IApiVersion {
* API server base url (read-only)
*/
api_server_url?: string
/** Web server url */
web_server_url?: string
}

/** This declaration is duplicated DIRECTLY from @looker/sdk to detach dependency */
Expand Down