From ef0b1c189248412ab256b3ade4ec3e4dbe17d867 Mon Sep 17 00:00:00 2001 From: Philipp Gfeller Date: Thu, 25 Jul 2024 17:42:58 +0200 Subject: [PATCH] add temporary copy workaround --- packages/styles/.gitignore | 3 +++ packages/styles/gulpfile.js | 15 +++++++++++---- packages/styles/package.json | 2 +- packages/styles/src/placeholders/_modes.scss | 2 +- packages/styles/src/tokens/_core.scss | 2 +- packages/styles/src/tokens/_device.scss | 2 +- packages/styles/src/tokens/_external.scss | 2 +- packages/styles/src/tokens/_internal.scss | 2 +- packages/styles/src/tokens/_post-theme.scss | 2 +- pnpm-lock.yaml | 6 +++--- 10 files changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/styles/.gitignore b/packages/styles/.gitignore index cde4a4d891..f6ed3a2011 100644 --- a/packages/styles/.gitignore +++ b/packages/styles/.gitignore @@ -13,3 +13,6 @@ storybook-static # Mac OSX Finder files. **/.DS_Store .DS_Store + +# Temporary files +src/tokens/temp/ diff --git a/packages/styles/gulpfile.js b/packages/styles/gulpfile.js index 6151f05e7c..631e7c210a 100644 --- a/packages/styles/gulpfile.js +++ b/packages/styles/gulpfile.js @@ -20,6 +20,10 @@ gulp.task('copy', () => { .pipe(gulp.dest(options.outputDir)); }); +gulp.task('temprarily-copy-token-files', () => { + return gulp.src(['../tokens/dist/*.scss']).pipe(gulp.dest('./src/tokens/temp')); +}); + /** * Autoprefix SCSS files */ @@ -168,9 +172,12 @@ gulp.task('sass:tests', () => { /** * Watch task for scss development */ -gulp.task('watch', () => { - return gulp.watch('./src/**/*.scss', gulp.series('copy')); -}); +gulp.task( + 'watch', + gulp.series('temprarily-copy-token-files', () => { + return gulp.watch('./src/**/*.scss', 'copy'); + }), +); /** * Run copy and sass task in parallel per default @@ -179,7 +186,7 @@ exports.default = gulp.task( 'build', gulp.parallel( gulp.series('map-icons', 'copy', 'autoprefixer', 'transform-package-json'), - gulp.series('sass'), + gulp.series('temprarily-copy-token-files', 'sass'), gulp.series('build-components'), ), ); diff --git a/packages/styles/package.json b/packages/styles/package.json index 7b06fa2996..e50d81fe4a 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -44,10 +44,10 @@ }, "dependencies": { "@popperjs/core": "2.11.8", - "@swisspost/design-system-tokens": "workspace:*", "bootstrap": "5.3.3" }, "devDependencies": { + "@swisspost/design-system-tokens": "workspace:*", "@swisspost/design-system-icons": "workspace:8.0.0", "@types/node": "20.14.12", "autoprefixer": "10.4.19", diff --git a/packages/styles/src/placeholders/_modes.scss b/packages/styles/src/placeholders/_modes.scss index 01d3cb6be0..4dcdbf2145 100644 --- a/packages/styles/src/placeholders/_modes.scss +++ b/packages/styles/src/placeholders/_modes.scss @@ -1,4 +1,4 @@ -@use '@swisspost/design-system-tokens/mode' as mode; +@use '../tokens/temp/mode' as mode; @use './../mixins/tokens'; %post-light { diff --git a/packages/styles/src/tokens/_core.scss b/packages/styles/src/tokens/_core.scss index cb60b40e0a..d983e599e1 100644 --- a/packages/styles/src/tokens/_core.scss +++ b/packages/styles/src/tokens/_core.scss @@ -1 +1 @@ -@use '@swisspost/design-system-tokens/core'; +@use './temp/core'; diff --git a/packages/styles/src/tokens/_device.scss b/packages/styles/src/tokens/_device.scss index aea2ae6e84..8a21eecbc8 100644 --- a/packages/styles/src/tokens/_device.scss +++ b/packages/styles/src/tokens/_device.scss @@ -1,4 +1,4 @@ -@use '@swisspost/design-system-tokens/device' as device; +@use './temp/device' as device; @use './core'; @use './../mixins/tokens'; diff --git a/packages/styles/src/tokens/_external.scss b/packages/styles/src/tokens/_external.scss index 8e115183f2..d625768535 100644 --- a/packages/styles/src/tokens/_external.scss +++ b/packages/styles/src/tokens/_external.scss @@ -1,4 +1,4 @@ -@use '@swisspost/design-system-tokens/channel' as channel; +@use './temp/channel' as channel; @use './core'; @use './../mixins/tokens'; diff --git a/packages/styles/src/tokens/_internal.scss b/packages/styles/src/tokens/_internal.scss index 339f45c5d9..415249cb2a 100644 --- a/packages/styles/src/tokens/_internal.scss +++ b/packages/styles/src/tokens/_internal.scss @@ -1,4 +1,4 @@ -@use '@swisspost/design-system-tokens/channel' as channel; +@use './temp/channel' as channel; @use './core'; @use './../mixins/tokens'; diff --git a/packages/styles/src/tokens/_post-theme.scss b/packages/styles/src/tokens/_post-theme.scss index ab35d5a20b..ee7ab8a77d 100644 --- a/packages/styles/src/tokens/_post-theme.scss +++ b/packages/styles/src/tokens/_post-theme.scss @@ -1,4 +1,4 @@ -@use '@swisspost/design-system-tokens/theme' as themes; +@use './temp/theme' as themes; @use './core'; @use './../mixins/tokens'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 264b92bfb6..e75eb7f2a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1036,9 +1036,6 @@ importers: '@popperjs/core': specifier: 2.11.8 version: 2.11.8 - '@swisspost/design-system-tokens': - specifier: workspace:* - version: link:../tokens/dist bootstrap: specifier: 5.3.3 version: 5.3.3(@popperjs/core@2.11.8) @@ -1046,6 +1043,9 @@ importers: '@swisspost/design-system-icons': specifier: workspace:8.0.0 version: link:../icons + '@swisspost/design-system-tokens': + specifier: workspace:* + version: link:../tokens/dist '@types/node': specifier: 20.14.12 version: 20.14.12