Skip to content

Commit

Permalink
fix(cli): adding ApiConfigSchema zod type to zli (#2511)
Browse files Browse the repository at this point in the history
* Revert "fix/packages/modules (#2510)"

This reverts commit 663bed8.

* Revert "refactor(cli): Remove "type" module from package.json"

This reverts commit 43b4cac.

* fix(cli): adding ApiConfigSchema zod type
  • Loading branch information
eikeland authored and odinr committed Oct 14, 2024
1 parent 9fc0f90 commit 7f02123
Show file tree
Hide file tree
Showing 42 changed files with 40 additions and 113 deletions.
55 changes: 0 additions & 55 deletions .changeset/popular-snakes-deliver.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-app",
"version": "9.1.9",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
},
"scripts": {
"build": "pnpm build:lib && pnpm build:dev-proxy && pnpm build:bin",
"build": "pnpm build:lib && pnpm build:dev-proxy && pnpm build:bin",
"build:clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo && pnpm build",
"build:lib": "tsc -b tsconfig.lib.json",
"build:bin": "rollup -c",
Expand Down
36 changes: 17 additions & 19 deletions packages/cli/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import typescript from '@rollup/plugin-typescript';

export default [
{
input: './src/bin/main.ts',
output: {
file: './dist/bin/main.mjs',
format: 'es',
},
plugins: [
typescript({
outputToFilesystem: false,
compilerOptions: {
composite: false,
declaration: false,
outDir: './dist/bin',
declarationDir: './dist/bin',
sourceMap: false,
},
}),
],
{
input: './src/bin/main.ts',
output: {
file: './dist/bin/main.mjs',
format: 'es'
},
];
plugins: [typescript({
outputToFilesystem: false,
compilerOptions: {
composite: false,
declaration: false,
outDir: './dist/bin',
declarationDir: './dist/bin',
sourceMap: false,
}
})]
},
];
2 changes: 1 addition & 1 deletion packages/cli/src/bin/utils/load-app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { formatPath, chalk } from './format.js';
import { createAppConfig } from '../../lib/app-config.js';
import { type ConfigExecuterEnv } from '../../lib/utils/config.js';
import { type ResolvedAppPackage } from '../../lib/app-package.js';
import { ApiAppConfig } from '@equinor/fusion-framework-module-app/schemas.js';
import { ApiAppConfig } from '../../schemas.js';

export const loadAppConfig = async (
env: ConfigExecuterEnv,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/bin/utils/publishAppConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiAppConfig } from '@equinor/fusion-framework-module-app/schemas.js';
import { ApiAppConfig } from '../../schemas.js';

/**
* Publishes app config to the apps-service endpoint
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

import { AssertionError } from './utils/assert.js';

import { ApiAppConfig, ApiAppConfigSchema } from '@equinor/fusion-framework-module-app/schemas.js';
import { ApiAppConfig, ApiAppConfigSchema } from '../schemas.js';

type FindAppConfigOptions = FindConfigOptions & {
file?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppManifest } from '@equinor/fusion-framework-app';

import { ClientRequest, IncomingMessage, ServerResponse } from 'node:http';

import { ApiAppConfig } from '@equinor/fusion-framework-module-app/schemas.js';
import { ApiAppConfig } from '../../../schemas.js';

/**
* Preserve token for executing proxy assets
Expand Down
18 changes: 18 additions & 0 deletions packages/cli/src/schemas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { z } from 'zod';

/**
* Api config object
*/
export const ApiAppConfigSchema = z.object({
environment: z.record(z.any()).optional().default({}),
endpoints: z
.record(
z.object({
url: z.string(),
scopes: z.array(z.string()).optional().default([]),
}),
)
.optional(),
});

export type ApiAppConfig = z.infer<typeof ApiAppConfigSchema>;
1 change: 0 additions & 1 deletion packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"outDir": "dist",
"rootDir": "src",
"target": "ES6",
"declaration": true,
"declarationDir": "./dist/types",
"baseUrl": ".",
"jsx": "react-jsx",
Expand Down
1 change: 0 additions & 1 deletion packages/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "7.2.8",
"description": "",
"main": "dist/esm/index.js",
"type": "module",
"types": "dist/types/index.d.ts",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/ag-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "32.2.0",
"description": "Fusion module for using AG Grid",
"main": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "5.3.11",
"description": "",
"main": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/bookmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.2.12",
"description": "",
"main": "./dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "5.0.12",
"description": "",
"main": "./dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-module-event",
"version": "4.2.4",
"description": "Fusion module for events",
"type": "module",
"main": "./dist/esm/index.js",
"module": "./dist/esm/index.js",
"exports": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/feature-flag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.1.9",
"description": "",
"main": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-module-http",
"version": "6.2.0",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"types": "index.d.ts",
"exports": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "4.3.5",
"description": "",
"main": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/msal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "3.1.5",
"description": "",
"main": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/modules/navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "",
"sideEffects": false,
"main": "dist/esm/index.js",
"type": "module",
"types": "index.d.ts",
"typesVersions": {
">=4.2": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/service-discovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-module-service-discovery",
"version": "8.0.1",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "4.1.5",
"description": "",
"sideEffects": false,
"type": "module",
"main": "dist/esm/index.js",
"types": "index.d.ts",
"typesVersions": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/signalr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "",
"sideEffects": false,
"main": "dist/esm/index.js",
"type": "module",
"types": "dist/types/index.d.ts",
"typesVersions": {
">=4.2": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-module-telemetry",
"version": "4.1.5",
"description": "Fusion module for using Microsoft Telemetry",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/modules/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "8.0.0",
"description": "",
"main": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/react/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-app",
"version": "5.2.9",
"description": "",
"type": "module",
"main": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/components/bookmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-components-bookmark",
"version": "0.5.1",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/components/people-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-components-people-provider",
"version": "1.4.8",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react",
"version": "7.2.3",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/legacy-interopt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-legacy-interopt",
"version": "16.0.0",
"description": "Library for interopt legacy fusion applications",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/modules/bookmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-module-bookmark",
"version": "2.1.17",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/modules/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-module-context",
"version": "6.2.13",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/modules/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-module-event",
"version": "3.2.7",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/modules/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-module-http",
"version": "8.0.0",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/modules/module/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@equinor/fusion-framework-react-module",
"version": "3.1.6",
"type": "module",
"main": "dist/esm/index.js",
"exports": {
".": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/modules/signalr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "3.0.16",
"description": "",
"sideEffects": false,
"type": "module",
"main": "dist/esm/index.js",
"types": "index.d.ts",
"typesVersions": {
Expand Down
1 change: 0 additions & 1 deletion packages/react/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@equinor/fusion-framework-react-widget",
"version": "1.1.17",
"description": "",
"type": "module",
"main": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"exports": {
Expand Down
Loading

0 comments on commit 7f02123

Please sign in to comment.