@patternfly/documentation-framework 1.4.16 → 1.5.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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.5.1 (2023-02-03)
7
+
8
+ **Note:** Version bump only for package @patternfly/documentation-framework
9
+
10
+
11
+
12
+
13
+
14
+ # 1.5.0 (2023-02-02)
15
+
16
+
17
+ ### Features
18
+
19
+ * add deprecated subpaths ([#3291](https://github.com/patternfly/patternfly-org/issues/3291)) ([b4324a7](https://github.com/patternfly/patternfly-org/commit/b4324a7ef10123a37ad8334e3b3da8be76fc35dc))
20
+
21
+
22
+
23
+
24
+
6
25
  ## 1.4.16 (2023-02-02)
7
26
 
8
27
 
@@ -3,7 +3,9 @@ import { useLocation } from '@reach/router';
3
3
  import { Badge, CodeBlock, CodeBlockCode, debounce, Switch } from '@patternfly/react-core';
4
4
  import * as reactCoreModule from '@patternfly/react-core';
5
5
  import * as reactCoreNextModule from '@patternfly/react-core/next';
6
+ import * as reactCoreDeprecatedModule from '@patternfly/react-core/deprecated';
6
7
  import * as reactTableModule from '@patternfly/react-table';
8
+ import * as reactTableDeprecatedModule from '@patternfly/react-table/deprecated';
7
9
  import { css } from '@patternfly/react-styles';
8
10
  import { getParameters } from 'codesandbox/lib/api/define';
9
11
  import { ExampleToolbar } from './exampleToolbar';
@@ -109,7 +111,8 @@ export const Example = ({
109
111
  // These 2 are in the bundle anyways for the site since we dogfood
110
112
  ...reactCoreModule,
111
113
  ...reactTableModule,
112
- ...(source === 'react-next' ? reactCoreNextModule : {})
114
+ ...(source === 'react-next' ? reactCoreNextModule : {}),
115
+ ...(source === 'react-deprecated' ? {...reactCoreDeprecatedModule, ...reactTableDeprecatedModule} : {})
113
116
  };
114
117
 
115
118
  let livePreview = null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly/documentation-framework",
3
3
  "description": "A framework to build documentation for PatternFly.",
4
- "version": "1.4.16",
4
+ "version": "1.5.1",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -84,5 +84,5 @@
84
84
  "react": "^16.8.0 || ^17.0.0",
85
85
  "react-dom": "^16.8.0 || ^17.0.0"
86
86
  },
87
- "gitHead": "2ce8862258970ecf26c85eae9813bc75d9809f6f"
87
+ "gitHead": "2826dd7d91703e7d292544a5155f85e2d7762ab4"
88
88
  }
package/routes.js CHANGED
@@ -65,7 +65,8 @@ const sourceOrder = {
65
65
  react: 1,
66
66
  'react-next': 1.1,
67
67
  'react-composable': 1.2,
68
- 'react-legacy': 1.3,
68
+ 'react-deprecated': 1.3,
69
+ 'react-legacy': 1.4,
69
70
  'react-demos': 2,
70
71
  html: 3,
71
72
  'html-demos': 4,
@@ -61,7 +61,7 @@ function toReactComponent(mdFilePath, source, buildMode) {
61
61
  }
62
62
 
63
63
  const propComponents = [...new Set(frontmatter.propComponents || [])].reduce((acc, componentName) => {
64
- const name = getTsDocName(componentName, source === 'react-next');
64
+ const name = getTsDocName(componentName, getTsDocNameVariant(source));
65
65
 
66
66
  if (tsDocs[name]) {
67
67
  acc.push(tsDocs[name]);
@@ -242,7 +242,7 @@ function sourcePropsFile(file) {
242
242
  tsDocgen(file)
243
243
  .filter(({ hide }) => !hide)
244
244
  .forEach(({ name, description, props }) => {
245
- tsDocs[getTsDocName(name, file.includes('/next'))] = { name, description, props };
245
+ tsDocs[getTsDocName(name, getTsDocNameVariant(file))] = { name, description, props };
246
246
  });
247
247
  }
248
248
 
@@ -283,10 +283,20 @@ function writeIndex() {
283
283
  return exitCode;
284
284
  }
285
285
 
286
- // Build unique names for components if they are a part of the "next" module.
287
- function getTsDocName(name, isNextComponent) {
288
- return `${name}${isNextComponent ? '-next' : ''}`;
289
- };
286
+ // Build unique names for components with a "variant" extension
287
+ function getTsDocName(name, variant) {
288
+ return `${name}${variant ? `-${variant}` : ''}`;
289
+ }
290
+
291
+ function getTsDocNameVariant(source) {
292
+ if (source.includes('next')) {
293
+ return 'next';
294
+ }
295
+
296
+ if (source.includes('deprecated')) {
297
+ return 'deprecated';
298
+ }
299
+ }
290
300
 
291
301
  module.exports = {
292
302
  sourceProps(glob, ignore) {
@@ -38,6 +38,8 @@ const defaultImports = [
38
38
  'react',
39
39
  '@reach/router',
40
40
  '@patternfly/react-core/next',
41
+ '@patternfly/react-core/deprecated',
42
+ '@patternfly/react-table/deprecated',
41
43
  'react-dropzone',
42
44
  ];
43
45
  const files = {
@@ -118,8 +118,7 @@ module.exports = (_env, argv) => {
118
118
  alias: {
119
119
  'client-styles': path.resolve(process.cwd(), 'patternfly-docs/patternfly-docs.css.js'),
120
120
  './routes-client': path.resolve(process.cwd(), 'patternfly-docs/patternfly-docs.routes.js'),
121
- './routes-generated': path.resolve(process.cwd(), 'patternfly-docs/generated/index.js'),
122
- '@patternfly/react-core/next': '@patternfly/react-core/dist/esm/next/index.js' // Can remove when webpack is updated to v5
121
+ './routes-generated': path.resolve(process.cwd(), 'patternfly-docs/generated/index.js')
123
122
  },
124
123
  modules: [
125
124
  'node_modules',