@docusaurus/theme-live-codeblock 2.0.0-beta.17 → 2.0.0-beta.18

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/lib/index.js CHANGED
@@ -7,8 +7,6 @@
7
7
  */
8
8
  Object.defineProperty(exports, '__esModule', {value: true});
9
9
  exports.validateThemeConfig = void 0;
10
- const tslib_1 = require('tslib');
11
- const path_1 = tslib_1.__importDefault(require('path'));
12
10
  const theme_translations_1 = require('@docusaurus/theme-translations');
13
11
  function themeLiveCodeblock(context) {
14
12
  const {
@@ -17,10 +15,10 @@ function themeLiveCodeblock(context) {
17
15
  return {
18
16
  name: 'docusaurus-theme-live-codeblock',
19
17
  getThemePath() {
20
- return path_1.default.resolve(__dirname, '../lib/theme');
18
+ return '../lib/theme';
21
19
  },
22
20
  getTypeScriptThemePath() {
23
- return path_1.default.resolve(__dirname, '../src/theme');
21
+ return '../src/theme';
24
22
  },
25
23
  getDefaultCodeTranslationMessages() {
26
24
  return (0, theme_translations_1.readDefaultCodeTranslationMessages)({
@@ -32,7 +30,7 @@ function themeLiveCodeblock(context) {
32
30
  return {
33
31
  resolve: {
34
32
  alias: {
35
- buble: path_1.default.resolve(__dirname, './custom-buble.js'),
33
+ buble: require.resolve('./custom-buble.js'),
36
34
  },
37
35
  },
38
36
  };
@@ -5,12 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { Joi } from '@docusaurus/utils-validation';
8
- import type { ThemeConfig, Validate, ValidationResult } from '@docusaurus/types';
8
+ import type { ThemeConfig, ThemeConfigValidationContext } from '@docusaurus/types';
9
9
  export declare const DEFAULT_CONFIG: {
10
10
  playgroundPosition: string;
11
11
  };
12
12
  export declare const Schema: Joi.ObjectSchema<any>;
13
- export declare function validateThemeConfig({ validate, themeConfig, }: {
14
- validate: Validate<ThemeConfig>;
15
- themeConfig: ThemeConfig;
16
- }): ValidationResult<ThemeConfig>;
13
+ export declare function validateThemeConfig({ validate, themeConfig, }: ThemeConfigValidationContext<ThemeConfig>): ThemeConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-live-codeblock",
3
- "version": "2.0.0-beta.17",
3
+ "version": "2.0.0-beta.18",
4
4
  "description": "Docusaurus live code block component.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-live-codeblock.d.ts",
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@docusaurus/core": "2.0.0-beta.17",
25
- "@docusaurus/theme-common": "2.0.0-beta.17",
26
- "@docusaurus/theme-translations": "2.0.0-beta.17",
27
- "@docusaurus/utils-validation": "2.0.0-beta.17",
24
+ "@docusaurus/core": "2.0.0-beta.18",
25
+ "@docusaurus/theme-common": "2.0.0-beta.18",
26
+ "@docusaurus/theme-translations": "2.0.0-beta.18",
27
+ "@docusaurus/utils-validation": "2.0.0-beta.18",
28
28
  "@philpl/buble": "^0.19.7",
29
29
  "clsx": "^1.1.1",
30
30
  "fs-extra": "^10.0.1",
@@ -32,7 +32,7 @@
32
32
  "tslib": "^2.3.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@docusaurus/types": "2.0.0-beta.17",
35
+ "@docusaurus/types": "2.0.0-beta.18",
36
36
  "@types/buble": "^0.20.1"
37
37
  },
38
38
  "peerDependencies": {
@@ -42,5 +42,5 @@
42
42
  "engines": {
43
43
  "node": ">=14"
44
44
  },
45
- "gitHead": "0032c0b0480083227af2e1b4da2d3ee6ce992403"
45
+ "gitHead": "1a945d06993d53376e61bed2c942799fe07dc336"
46
46
  }
package/src/index.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import path from 'path';
9
8
  import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
10
9
  import type {LoadContext, Plugin} from '@docusaurus/types';
11
10
 
@@ -18,10 +17,10 @@ export default function themeLiveCodeblock(context: LoadContext): Plugin {
18
17
  name: 'docusaurus-theme-live-codeblock',
19
18
 
20
19
  getThemePath() {
21
- return path.resolve(__dirname, '../lib/theme');
20
+ return '../lib/theme';
22
21
  },
23
22
  getTypeScriptThemePath() {
24
- return path.resolve(__dirname, '../src/theme');
23
+ return '../src/theme';
25
24
  },
26
25
 
27
26
  getDefaultCodeTranslationMessages() {
@@ -35,7 +34,7 @@ export default function themeLiveCodeblock(context: LoadContext): Plugin {
35
34
  return {
36
35
  resolve: {
37
36
  alias: {
38
- buble: path.resolve(__dirname, './custom-buble.js'),
37
+ buble: require.resolve('./custom-buble.js'),
39
38
  },
40
39
  },
41
40
  };
@@ -6,7 +6,10 @@
6
6
  */
7
7
 
8
8
  import {Joi} from '@docusaurus/utils-validation';
9
- import type {ThemeConfig, Validate, ValidationResult} from '@docusaurus/types';
9
+ import type {
10
+ ThemeConfig,
11
+ ThemeConfigValidationContext,
12
+ } from '@docusaurus/types';
10
13
 
11
14
  export const DEFAULT_CONFIG = {
12
15
  playgroundPosition: 'bottom',
@@ -25,9 +28,6 @@ export const Schema = Joi.object({
25
28
  export function validateThemeConfig({
26
29
  validate,
27
30
  themeConfig,
28
- }: {
29
- validate: Validate<ThemeConfig>;
30
- themeConfig: ThemeConfig;
31
- }): ValidationResult<ThemeConfig> {
31
+ }: ThemeConfigValidationContext<ThemeConfig>): ThemeConfig {
32
32
  return validate(Schema, themeConfig);
33
33
  }