@scalar/express-api-reference 0.8.1 → 0.8.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @scalar/express-api-reference
2
2
 
3
+ ## 0.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @scalar/core@0.3.2
8
+
9
+ ## 0.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - a90046a: chore: move to esbuild for integration packages
14
+
3
15
  ## 0.8.1
4
16
 
5
17
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import type { Request, Response } from 'express';
2
- import type { ApiReferenceConfiguration } from './types';
2
+ import type { ApiReferenceConfiguration } from './types.js';
3
3
  /**
4
4
  * The custom theme CSS for the Express theme
5
5
  */
@@ -1,8 +1,4 @@
1
- import { getHtmlDocument } from '@scalar/core/libs/html-rendering';
2
-
3
- /**
4
- * The custom theme CSS for the Express theme
5
- */
1
+ import { getHtmlDocument } from "@scalar/core/libs/html-rendering";
6
2
  const customTheme = `
7
3
  /* basic theme */
8
4
  .light-mode {
@@ -98,25 +94,20 @@ const customTheme = `
98
94
  --scalar-radius-xl: 3px;
99
95
  }
100
96
  `;
101
- /**
102
- * The default configuration for the API Reference.
103
- */
104
97
  const DEFAULT_CONFIGURATION = {
105
- _integration: 'express',
98
+ _integration: "express"
106
99
  };
107
- /**
108
- * The route handler to render the Scalar API Reference.
109
- */
110
100
  function apiReference(givenConfiguration) {
111
- // Merge the defaults
112
- const configuration = {
113
- ...DEFAULT_CONFIGURATION,
114
- ...givenConfiguration,
115
- };
116
- // Respond with the HTML document
117
- return (_, res) => {
118
- res.type('text/html').send(getHtmlDocument(configuration, customTheme));
119
- };
101
+ const configuration = {
102
+ ...DEFAULT_CONFIGURATION,
103
+ ...givenConfiguration
104
+ };
105
+ return (_, res) => {
106
+ res.type("text/html").send(getHtmlDocument(configuration, customTheme));
107
+ };
120
108
  }
121
-
122
- export { apiReference, customTheme };
109
+ export {
110
+ apiReference,
111
+ customTheme
112
+ };
113
+ //# sourceMappingURL=apiReference.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/apiReference.ts"],
4
+ "sourcesContent": ["import { getHtmlDocument } from '@scalar/core/libs/html-rendering'\nimport type { Request, Response } from 'express'\n\nimport type { ApiReferenceConfiguration } from './types'\n\n/**\n * The custom theme CSS for the Express theme\n */\nexport const customTheme = `\n/* basic theme */\n.light-mode {\n --scalar-color-1: #353535;\n --scalar-color-2: #555555;\n --scalar-color-3: #aeaeae;\n --scalar-color-accent: #259dff;\n\n --scalar-background-1: #fff;\n --scalar-background-2: #f7f7f7;\n --scalar-background-3: #dadada;\n --scalar-background-accent: #E0F5FF;\n\n --scalar-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --scalar-color-1: rgba(255, 255, 255, 0.9);\n --scalar-color-2: rgba(255, 255, 255, 0.62);\n --scalar-color-3: rgba(255, 255, 255, 0.44);\n --scalar-color-accent: #8ab4f8;\n\n --scalar-background-1: #1a1a1a;\n --scalar-background-2: #252525;\n --scalar-background-3: #323232;\n --scalar-background-accent: #8ab4f81f;\n\n --scalar-border-color: rgba(255, 255, 255, 0.1);\n}\n\n/* Document Sidebar */\n.light-mode .t-doc__sidebar {\n --scalar-sidebar-background-1: var(--scalar-background-1);\n --scalar-sidebar-item-hover-color: currentColor;\n --scalar-sidebar-item-hover-background: var(--scalar-background-2);\n --scalar-sidebar-item-active-background: var(--scalar-background-accent);\n --scalar-sidebar-border-color: var(--scalar-border-color);\n --scalar-sidebar-color-1: var(--scalar-color-1);\n --scalar-sidebar-color-2: var(--scalar-color-2);\n --scalar-sidebar-color-active: var(--scalar-color-accent);\n --scalar-sidebar-search-background: transparent;\n --scalar-sidebar-search-border-color: var(--scalar-border-color);\n --scalar-sidebar-search-color: var(--scalar-color-3);\n}\n\n.dark-mode .sidebar {\n --scalar-sidebar-background-1: var(--scalar-background-1);\n --scalar-sidebar-item-hover-color: currentColor;\n --scalar-sidebar-item-hover-background: var(--scalar-background-2);\n --scalar-sidebar-item-active-background: var(--scalar-background-accent);\n --scalar-sidebar-border-color: var(--scalar-border-color);\n --scalar-sidebar-color-1: var(--scalar-color-1);\n --scalar-sidebar-color-2: var(--scalar-color-2);\n --scalar-sidebar-color-active: var(--scalar-color-accent);\n --scalar-sidebar-search-background: transparent;\n --scalar-sidebar-search-border-color: var(--scalar-border-color);\n --scalar-sidebar-search-color: var(--scalar-color-3);\n}\n\n/* advanced */\n.light-mode {\n --scalar-button-1: rgb(49 53 56);\n --scalar-button-1-color: #fff;\n --scalar-button-1-hover: rgb(28 31 33);\n\n --scalar-color-green: #669900;\n --scalar-color-red: #dc4a68;\n --scalar-color-yellow: #edbe20;\n --scalar-color-blue: #0277aa;\n --scalar-color-orange: #fb892c;\n --scalar-color-purple: #5203d1;\n\n --scalar-scrollbar-color: rgba(0, 0, 0, 0.18);\n --scalar-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --scalar-button-1: #f6f6f6;\n --scalar-button-1-color: #000;\n --scalar-button-1-hover: #e7e7e7;\n\n --scalar-color-green: #00b648;\n --scalar-color-red: #dc1b19;\n --scalar-color-yellow: #ffc90d;\n --scalar-color-blue: #4eb3ec;\n --scalar-color-orange: #ff8d4d;\n --scalar-color-purple: #b191f9;\n\n --scalar-scrollbar-color: rgba(255, 255, 255, 0.24);\n --scalar-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n:root {\n --scalar-radius: 3px;\n --scalar-radius-lg: 3px;\n --scalar-radius-xl: 3px;\n}\n`\n\n/**\n * The default configuration for the API Reference.\n */\nconst DEFAULT_CONFIGURATION: Partial<ApiReferenceConfiguration> = {\n _integration: 'express',\n}\n\n/**\n * The route handler to render the Scalar API Reference.\n */\nexport function apiReference(givenConfiguration: Partial<ApiReferenceConfiguration>) {\n // Merge the defaults\n const configuration = {\n ...DEFAULT_CONFIGURATION,\n ...givenConfiguration,\n }\n\n // Respond with the HTML document\n return (_: Request, res: Response) => {\n res.type('text/html').send(getHtmlDocument(configuration, customTheme))\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,uBAAuB;AAQzB,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmG3B,MAAM,wBAA4D;AAAA,EAChE,cAAc;AAChB;AAKO,SAAS,aAAa,oBAAwD;AAEnF,QAAM,gBAAgB;AAAA,IACpB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAGA,SAAO,CAAC,GAAY,QAAkB;AACpC,QAAI,KAAK,WAAW,EAAE,KAAK,gBAAgB,eAAe,WAAW,CAAC;AAAA,EACxE;AACF;",
6
+ "names": []
7
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { apiReference } from './apiReference.js';
2
- export type { ApiReferenceConfiguration } from './types';
2
+ export type { ApiReferenceConfiguration } from './types.js';
3
3
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1 +1,5 @@
1
- export { apiReference } from './apiReference.js';
1
+ import { apiReference } from "./apiReference.js";
2
+ export {
3
+ apiReference
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export { apiReference } from './apiReference'\nexport type { ApiReferenceConfiguration } from './types'\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;",
6
+ "names": []
7
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "integrations/express"
12
12
  },
13
- "version": "0.8.1",
13
+ "version": "0.8.3",
14
14
  "engines": {
15
15
  "node": ">=20"
16
16
  },
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "module": "dist/index.js",
32
32
  "dependencies": {
33
- "@scalar/core": "0.3.1"
33
+ "@scalar/core": "0.3.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/express": "^5.0.1",
@@ -39,10 +39,10 @@
39
39
  "supertest": "^6.3.3",
40
40
  "vite": "5.4.19",
41
41
  "vitest": "^1.6.0",
42
- "@scalar/build-tooling": "0.2.0"
42
+ "@scalar/build-tooling": "0.2.2"
43
43
  },
44
44
  "scripts": {
45
- "build": "scalar-build-rollup",
45
+ "build": "scalar-build-esbuild",
46
46
  "build:playground": "cd playground && pnpm build",
47
47
  "dev:doesnt-work": "cd playground && pnpm dev",
48
48
  "docker:build": "docker build --build-arg BASE_IMAGE=scalar-base -t express-api-reference -f Dockerfile .",