Skip to content

Commit

Permalink
chore: version inject for sd-playground on build (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema committed Jun 28, 2024
1 parent db07acd commit 634868a
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/src/components/sd-playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class SdPlayground extends LitElement {
const dependencies = await analyzeDependencies(script.value);
const sdDep = dependencies.find((dep) => dep.package === 'style-dictionary');
if (sdDep) {
sdDep.package = 'style-dictionary@4.0.0-prerelease.28';
sdDep.package = 'style-dictionary@<? version placeholder ?>';
}
const files: Record<string, string> = {};
files[`tokens.${tokens.lang}`] = tokens.value;
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/assets-base64-embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"eslint-config-react-app": "^7.0.1",
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
},
"resolutions": {
"immer": "8.0.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/create-react-native-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"eslint-config-react-app": "^7.0.1",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1",
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
},
"jest": {
"preset": "react-native"
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/custom-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/custom-transforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/font-face-rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/format-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/matching-build-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"author": "Kelly Harrop <[email protected]>",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/multi-brand-multi-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"homepage": "https://github.com/dbanksdesign/style-dictionary-node#readme",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28",
"style-dictionary": "4.0.0-prerelease.30",
"tinycolor2": "^1.4.1"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/npm-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/referencing_aliasing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"devDependencies": {
"aws-sdk": "^2.7.21",
"fs-extra": "^1.0.0",
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/tokens-deprecation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/transitive-transforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"license": "ISC",
"devDependencies": {
"chroma-js": "^2.1.0",
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/variables-in-outputs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"author": "",
"license": "MIT",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28"
"style-dictionary": "4.0.0-prerelease.30"
}
}
2 changes: 1 addition & 1 deletion examples/advanced/yaml-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "4.0.0-prerelease.28",
"style-dictionary": "4.0.0-prerelease.30",
"yaml": "^1.10.0"
}
}
2 changes: 1 addition & 1 deletion examples/complete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"style-dictionary": "^4.0.0-prerelease.28"
"style-dictionary": "^4.0.0-prerelease.30"
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions scripts/inject-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ packageJSONs.forEach(function (filePath) {
});

// version in lib file
const sdPath = 'lib/StyleDictionary.js';
const indexContent = fs.readFileSync(sdPath, 'utf-8');
const newIndexContent = indexContent.replace('<? version placeholder ?>', version);
fs.writeFileSync(sdPath, newIndexContent, 'utf-8');
execSync(`git add ${sdPath}`);
const paths = ['lib/StyleDictionary.js', 'docs/src/components/sd-playground.ts'];
paths.forEach((p) => {
const indexContent = fs.readFileSync(p, 'utf-8');
const newIndexContent = indexContent.replace('<? version placeholder ?>', version);
fs.writeFileSync(p, newIndexContent, 'utf-8');
execSync(`git add ${p}`);
});

0 comments on commit 634868a

Please sign in to comment.