@patternfly/react-tokens 6.0.0-alpha.35 → 6.0.0-alpha.36

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,10 @@
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
+ # [6.0.0-alpha.36](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-tokens@6.0.0-alpha.35...@patternfly/react-tokens@6.0.0-alpha.36) (2024-08-27)
7
+
8
+ **Note:** Version bump only for package @patternfly/react-tokens
9
+
6
10
  # [6.0.0-alpha.35](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-tokens@6.0.0-alpha.34...@patternfly/react-tokens@6.0.0-alpha.35) (2024-08-19)
7
11
 
8
12
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-tokens",
3
- "version": "6.0.0-alpha.35",
3
+ "version": "6.0.0-alpha.36",
4
4
  "description": "This library provides access to the design tokens of PatternFly 4 from JavaScript",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "homepage": "https://github.com/patternfly/patternfly-react#readme",
27
27
  "scripts": {
28
- "generate": "yarn clean && node scripts/writeTokens.js",
28
+ "generate": "yarn clean && node scripts/writeTokens.mjs",
29
29
  "clean": "rimraf dist"
30
30
  },
31
31
  "devDependencies": {
@@ -33,5 +33,5 @@
33
33
  "css": "^3.0.0",
34
34
  "fs-extra": "^11.2.0"
35
35
  },
36
- "gitHead": "11fa597623c93a0cab58d80a1768ca16bd903759"
36
+ "gitHead": "c51081df254133ab9d594a2d3fe7ce5397cbd182"
37
37
  }
@@ -1,8 +1,10 @@
1
- const { glob } = require('glob');
2
- const { dirname, basename, sep } = require('path');
3
- const { parse, stringify } = require('css');
4
- const { readFileSync } = require('fs');
1
+ import { glob } from 'glob';
2
+ import { createRequire } from 'node:module';
3
+ import { dirname, basename, sep } from 'node:path';
4
+ import { parse, stringify } from 'css';
5
+ import { readFileSync } from 'node:fs';
5
6
 
7
+ const require = createRequire(import.meta.url);
6
8
  const pfStylesDir = dirname(require.resolve('@patternfly/patternfly/patternfly.css'));
7
9
  const version = 'v6';
8
10
 
@@ -91,7 +93,7 @@ const getLocalVarsMap = (cssFiles) => {
91
93
  * }
92
94
  * }
93
95
  */
94
- function generateTokens() {
96
+ export function generateTokens() {
95
97
  const cssFiles = glob
96
98
  .sync(['{**/{components,layouts}/**/*.css', '**/patternfly-charts.css', '**/patternfly-variables.css}'].join(','), {
97
99
  cwd: pfStylesDir,
@@ -249,7 +251,3 @@ function generateTokens() {
249
251
 
250
252
  return fileTokens;
251
253
  }
252
-
253
- module.exports = {
254
- generateTokens
255
- };
@@ -1,8 +1,8 @@
1
- const { outputFileSync } = require('fs-extra');
2
- const { resolve, join } = require('path');
3
- const { generateTokens } = require('./generateTokens');
1
+ import { outputFileSync } from 'fs-extra/esm';
2
+ import { resolve, join } from 'node:path';
3
+ import { generateTokens } from './generateTokens.mjs';
4
4
 
5
- const outDir = resolve(__dirname, '../dist');
5
+ const outDir = resolve(import.meta.dirname, '../dist');
6
6
 
7
7
  const writeESMExport = (tokenName, tokenString) =>
8
8
  outputFileSync(