Skip to content

Commit

Permalink
feat: Added --versions option to the code generator (#514)
Browse files Browse the repository at this point in the history
- Establish all generator parameters in prepGen
- Moved spec list determination into sdk-codegen
- Gracefully handling the absence of a LICENSE file
- Updating codegen readmes
- use `yarn test:ext` to test the extension SDK packages

* v21.0.10
  • Loading branch information
jkaster authored Mar 23, 2021
1 parent 78cc1e2 commit ee6f3e8
Show file tree
Hide file tree
Showing 63 changed files with 1,020 additions and 631 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "21.0.9"
"version": "21.0.10"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"test:iphone": "xcodebuild test -project swift/looker/looker.xcodeproj -scheme looker-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=13.4.1' | xcpretty --test --color",
"test:sdk": "yarn jest packages/sdk",
"test:jest": "DOT_ENV_FILE=.env.test jest",
"test:ext": "yarn jest packages/extension-sdk packages/extension-sdk-react",
"bootstrap": "lerna clean -y && lerna bootstrap",
"watch": "lerna run --parallel watch",
"watch:cjs": "lerna run --parallel watch:cjs"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/api-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@looker/api-explorer",
"version": "21.0.9",
"version": "21.0.10",
"description": "Looker API Explorer",
"main": "lib/esm/index.js",
"typings": "lib/index.d.ts",
Expand All @@ -26,7 +26,7 @@
"devDependencies": {
"@looker/components-test-utils": "^0.9.29",
"@looker/sdk-codegen-scripts": "^21.0.9",
"@looker/sdk-node": "^21.0.9",
"@looker/sdk-node": "^21.0.10",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.6.0",
Expand All @@ -48,10 +48,10 @@
},
"dependencies": {
"@looker/components": "^0.9.30",
"@looker/run-it": "^21.0.9",
"@looker/sdk": "^21.0.9",
"@looker/sdk-codegen": "^21.0.9",
"@looker/sdk-rtl": "^21.0.9",
"@looker/run-it": "^21.0.10",
"@looker/sdk": "^21.0.10",
"@looker/sdk-codegen": "^21.0.10",
"@looker/sdk-rtl": "^21.0.10",
"ace": "^1.3.0",
"ace-builds": "^1.4.11",
"history": "^4.10.1",
Expand Down
14 changes: 2 additions & 12 deletions packages/api-explorer/src/ApiExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import React, { FC, useReducer, useState, useEffect } from 'react'
import { useLocation } from 'react-router'
import styled from 'styled-components'
import { Aside, ComponentsProvider, Layout, Page } from '@looker/components'
import { ApiModel, KeyedCollection } from '@looker/sdk-codegen'
import { Looker40SDK, Looker31SDK } from '@looker/sdk'
import { SpecList } from '@looker/sdk-codegen'
import { SearchContext, LodeContext, defaultLodeContextValue } from './context'
import { getLoded } from './utils'
import { Header, SideNav } from './components'
Expand All @@ -41,18 +41,8 @@ import {
} from './reducers'
import { AppRouter } from './routes'

export interface SpecItem {
status: string // 'current' | 'deprecated' | 'experimental' | 'stable'
isDefault?: boolean
api?: ApiModel
specURL?: string
specContent?: string
}

export type SpecItems = KeyedCollection<SpecItem>

export interface ApiExplorerProps {
specs: SpecItems
specs: SpecList
sdk?: Looker31SDK | Looker40SDK
lodeUrl?: string
}
Expand Down
5 changes: 3 additions & 2 deletions packages/api-explorer/src/StandaloneApiExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import {
initRunItSdk,
} from '@looker/run-it'
import { Looker40SDK } from '@looker/sdk'
import ApiExplorer, { SpecItems } from './ApiExplorer'
import { SpecList } from '@looker/sdk-codegen'
import ApiExplorer from './ApiExplorer'

export interface StandloneApiExplorerProps {
specs: SpecItems
specs: SpecList
}

export const StandaloneApiExplorer: FC<StandloneApiExplorerProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import React, { FC, Dispatch } from 'react'
import { Select } from '@looker/components'
import { useHistory } from 'react-router-dom'

import { SpecItems } from '../../ApiExplorer'
import { SpecList } from '@looker/sdk-codegen'
import { SpecAction, SpecState, selectSpec } from '../../reducers'

interface ApiSpecSelectorProps {
specs: SpecItems
specs: SpecList
spec: SpecState
specDispatch: Dispatch<SpecAction>
}
Expand Down
4 changes: 2 additions & 2 deletions packages/api-explorer/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ import {
Header as SemanticHeader,
} from '@looker/components'

import { SpecItems } from '../../ApiExplorer'
import { SpecList } from '@looker/sdk-codegen'
import { SpecState, SpecAction } from '../../reducers'
import { diffPath } from '../../utils'
import { ApiSpecSelector } from './ApiSpecSelector'

interface HeaderProps {
specs: SpecItems
specs: SpecList
spec: SpecState
specDispatch: Dispatch<SpecAction>
toggleNavigation: (target?: boolean) => void
Expand Down
12 changes: 8 additions & 4 deletions packages/api-explorer/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,25 @@ import React from 'react'
import { BrowserRouter as Router } from 'react-router-dom'
import ReactDOM from 'react-dom'

import { ApiModel } from '@looker/sdk-codegen'
import { SpecItems } from './ApiExplorer'
import { ApiModel, SpecList } from '@looker/sdk-codegen'
import { StandaloneApiExplorer } from './StandaloneApiExplorer'

export const specs: SpecItems = {
export const specs: SpecList = {
'3.1': {
key: '3.1',
status: 'current',
version: '3.1',
specURL: 'https://self-signed.looker.com:19999/api/3.1/swagger.json',
specContent: require('../../../spec/Looker.3.1.oas.json'),
isDefault: false,
},
'4.0': {
key: '4.0',
status: 'experimental',
isDefault: true,
version: '4.0',
specURL: 'https://self-signed.looker.com:19999/api/4.0/swagger.json',
specContent: require('../../../spec/Looker.4.0.oas.json'),
isDefault: true,
},
}

Expand Down
1 change: 0 additions & 1 deletion packages/api-explorer/src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export {
SpecState,
SpecAction,
getSpecKey,
getSpecsFromVersions,
} from './spec'
export {
searchReducer,
Expand Down
5 changes: 3 additions & 2 deletions packages/api-explorer/src/reducers/spec/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
SOFTWARE.
*/
import { SpecItems } from '../../ApiExplorer'

export const selectSpec = (specs: SpecItems, specKey: string) => ({
import { SpecList } from '@looker/sdk-codegen'

export const selectSpec = (specs: SpecList, specKey: string) => ({
type: 'SELECT_SPEC',
key: specKey,
payload: specs,
Expand Down
7 changes: 1 addition & 6 deletions packages/api-explorer/src/reducers/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
SOFTWARE.
*/
export {
initDefaultSpecState,
getSpecKey,
AbstractLocation,
getSpecsFromVersions,
} from './utils'
export { initDefaultSpecState, getSpecKey, AbstractLocation } from './utils'
export { selectSpec } from './actions'
export { specReducer, SpecAction, SpecState } from './reducer'
5 changes: 2 additions & 3 deletions packages/api-explorer/src/reducers/spec/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

import { ApiModel } from '@looker/sdk-codegen'
import { SpecItem, SpecItems } from '../../ApiExplorer'
import { ApiModel, SpecItem, SpecList } from '@looker/sdk-codegen'
import { fetchSpec } from './utils'

export interface SpecState extends SpecItem {
Expand All @@ -36,7 +35,7 @@ export interface SpecState extends SpecItem {
export interface SpecAction {
type: string
key: string
payload: SpecItems
payload: SpecList
}

export const specReducer = (
Expand Down
Loading

0 comments on commit ee6f3e8

Please sign in to comment.