@malloy-publisher/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +36 -0
- package/.prettierrc +4 -0
- package/README.md +1 -0
- package/openapitools.json +7 -0
- package/package.json +63 -0
- package/src/assets/img/spinner.svg +43 -0
- package/src/client/.openapi-generator/FILES +9 -0
- package/src/client/.openapi-generator/VERSION +1 -0
- package/src/client/.openapi-generator-ignore +23 -0
- package/src/client/api.ts +1170 -0
- package/src/client/base.ts +86 -0
- package/src/client/common.ts +150 -0
- package/src/client/configuration.ts +110 -0
- package/src/client/git_push.sh +57 -0
- package/src/client/index.ts +18 -0
- package/src/components/DOMElement/DOMElement.tsx +19 -0
- package/src/components/DOMElement/index.ts +1 -0
- package/src/components/Model/Model.tsx +110 -0
- package/src/components/Model/ModelCell.tsx +175 -0
- package/src/components/Model/index.ts +1 -0
- package/src/components/Notebook/Notebook.tsx +82 -0
- package/src/components/Notebook/NotebookCell.tsx +194 -0
- package/src/components/Notebook/index.ts +1 -0
- package/src/components/Package/Config.tsx +99 -0
- package/src/components/Package/Databases.tsx +75 -0
- package/src/components/Package/FileTreeView.tsx +224 -0
- package/src/components/Package/Models.tsx +77 -0
- package/src/components/Package/Package.tsx +78 -0
- package/src/components/Package/index.ts +1 -0
- package/src/components/Project/About.tsx +56 -0
- package/src/components/Project/Packages.tsx +105 -0
- package/src/components/Project/Project.tsx +26 -0
- package/src/components/Project/index.ts +1 -0
- package/src/components/QueryResult/QueryResult.tsx +84 -0
- package/src/components/QueryResult/index.ts +1 -0
- package/src/components/RenderedResult/RenderedResult.tsx +38 -0
- package/src/components/highlighter.ts +649 -0
- package/src/components/index.ts +5 -0
- package/src/components/styles.ts +21 -0
- package/src/index.ts +1 -0
- package/src/react-app-env.d.ts +73 -0
- package/tsconfig.json +34 -0
- package/vite.config.ts +31 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { styled, Card, CardContent, CardMedia } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const StyledCard = styled(Card)({
|
|
4
|
+
display: "flex",
|
|
5
|
+
flexDirection: "column",
|
|
6
|
+
height: "100%",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const StyledCardContent = styled(CardContent)({
|
|
10
|
+
display: "flex",
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
padding: "0px 10px 10px 10px",
|
|
13
|
+
flexGrow: 1,
|
|
14
|
+
"&:last-child": {
|
|
15
|
+
paddingBottom: 0,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const StyledCardMedia = styled(CardMedia)({
|
|
20
|
+
padding: "0px 10px 0px 10px",
|
|
21
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="react" />
|
|
4
|
+
/// <reference types="react-dom" />
|
|
5
|
+
/// <reference types="vite-plugin-svgr/client" />
|
|
6
|
+
|
|
7
|
+
declare namespace NodeJS {
|
|
8
|
+
interface ProcessEnv {
|
|
9
|
+
readonly NODE_ENV: "development" | "production" | "test";
|
|
10
|
+
readonly PUBLIC_URL: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module "*.avif" {
|
|
15
|
+
const src: string;
|
|
16
|
+
export default src;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module "*.bmp" {
|
|
20
|
+
const src: string;
|
|
21
|
+
export default src;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module "*.gif" {
|
|
25
|
+
const src: string;
|
|
26
|
+
export default src;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module "*.jpg" {
|
|
30
|
+
const src: string;
|
|
31
|
+
export default src;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module "*.jpeg" {
|
|
35
|
+
const src: string;
|
|
36
|
+
export default src;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module "*.png" {
|
|
40
|
+
const src: string;
|
|
41
|
+
export default src;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare module "*.webp" {
|
|
45
|
+
const src: string;
|
|
46
|
+
export default src;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare module "*.svg" {
|
|
50
|
+
import * as React from "react";
|
|
51
|
+
|
|
52
|
+
export const ReactComponent: React.FunctionComponent<
|
|
53
|
+
React.SVGProps<SVGSVGElement> & { title?: string }
|
|
54
|
+
>;
|
|
55
|
+
|
|
56
|
+
const src: string;
|
|
57
|
+
export default src;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare module "*.module.css" {
|
|
61
|
+
const classes: { readonly [key: string]: string };
|
|
62
|
+
export default classes;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare module "*.module.scss" {
|
|
66
|
+
const classes: { readonly [key: string]: string };
|
|
67
|
+
export default classes;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare module "*.module.sass" {
|
|
71
|
+
const classes: { readonly [key: string]: string };
|
|
72
|
+
export default classes;
|
|
73
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext", // Specifies the JavaScript version to target when transpiling code.
|
|
4
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"], // Specifies the libraries available for the code.
|
|
5
|
+
"module": "ESNext", // Defines the module system to use for code generation.
|
|
6
|
+
"skipLibCheck": true, // Skips type checking of declaration files.
|
|
7
|
+
"useDefineForClassFields": true, // Enables the use of 'define' for class fields.
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler", // Specifies how modules are resolved when bundling.
|
|
11
|
+
"allowImportingTsExtensions": true, // Allows importing TypeScript files with extensions.
|
|
12
|
+
"resolveJsonModule": true, // Enables importing JSON modules.
|
|
13
|
+
"isolatedModules": true, // Ensures each file is treated as a separate module.
|
|
14
|
+
"noEmit": true, // Prevents TypeScript from emitting output files.
|
|
15
|
+
"jsx": "react-jsx", // Configures JSX support for React.
|
|
16
|
+
"esModuleInterop": false,
|
|
17
|
+
|
|
18
|
+
/* Linting */
|
|
19
|
+
// Can not set strict due to malloy renderer. Fix Malloy rendered or get rid of dep.
|
|
20
|
+
"strict": false, // Enables strict type checking.
|
|
21
|
+
"allowJs": false,
|
|
22
|
+
"allowSyntheticDefaultImports": true,
|
|
23
|
+
// Can not set no unused locals due to openapi client.
|
|
24
|
+
"noUnusedLocals": false, // Flags unused local variables.
|
|
25
|
+
"noUnusedParameters": true, // Flags unused function parameters.
|
|
26
|
+
"noFallthroughCasesInSwitch": true, // Requires handling all cases in a switch statement.
|
|
27
|
+
"declaration": true, // Generates declaration files for TypeScript.
|
|
28
|
+
"forceConsistentCasingInFileNames": true,
|
|
29
|
+
},
|
|
30
|
+
"include": ["src"], // Specifies the directory to include when searching for TypeScript files.
|
|
31
|
+
"exclude": [
|
|
32
|
+
"src/**/__docs__","src/**/__test__"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import dts from "vite-plugin-dts";
|
|
3
|
+
import { peerDependencies } from "./package.json";
|
|
4
|
+
import svgr from "vite-plugin-svgr";
|
|
5
|
+
import react from "@vitejs/plugin-react";
|
|
6
|
+
|
|
7
|
+
export default ({ mode }) => {
|
|
8
|
+
return defineConfig({
|
|
9
|
+
build: {
|
|
10
|
+
minify: mode === "production",
|
|
11
|
+
lib: {
|
|
12
|
+
entry: "./src/index.ts", // Specifies the entry point for building the library.
|
|
13
|
+
name: "@malloy-publisher/sdk", // Sets the name of the generated library.
|
|
14
|
+
fileName: (format) => `index.${format}.js`, // Generates the output file name based on the format.
|
|
15
|
+
formats: ["cjs", "es"], // Specifies the output formats (CommonJS and ES modules).
|
|
16
|
+
},
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
onwarn(warning, warn) {
|
|
19
|
+
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
warn(warning);
|
|
23
|
+
},
|
|
24
|
+
external: [...Object.keys(peerDependencies)], // Defines external dependencies for Rollup bundling.
|
|
25
|
+
},
|
|
26
|
+
sourcemap: true, // Generates source maps for debugging.
|
|
27
|
+
emptyOutDir: true, // Clears the output directory before building.
|
|
28
|
+
},
|
|
29
|
+
plugins: [dts(), svgr(), react()],
|
|
30
|
+
});
|
|
31
|
+
};
|