Skip to content

Commit

Permalink
feat(vars,expressvars)!: deprecate packages
Browse files Browse the repository at this point in the history
BREAKING CHANGE: as no additional changes have been or are planned to be made to
these legacy token packages, these assets no longer need to exist in the monorepo
structure for Spectrum CSS.
  • Loading branch information
castastrophe committed Nov 10, 2023
1 parent 224106c commit 2f354e4
Show file tree
Hide file tree
Showing 233 changed files with 138 additions and 328,801 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dist-site

temp
.npmrc*
.nx
.env
.tmp
npm-debug.log*
Expand Down
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
**/node_modules

components/*/dist
components/expressvars/custom.css
components/expressvars/css/**/*.css
components/vars/css/**/*.css
components/vars/custom.css
tokens/custom-*/*.css
.storybook/storybook-static/**
generator
dist
template.hbs
*.hbs

site/includes/*.js

Expand Down
10 changes: 6 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ module.exports = {
{
loader: "file-loader",
options: {
outputPath: (url, resourcePath, context) => {
return `assets/images/${url.replace(/_\//g, "")}`;
},
outputPath: (url) => `assets/images/${url.replace(/_\//g, "")}`,
},
},
],
Expand All @@ -118,7 +116,11 @@ module.exports = {
loader: "file-loader",
options: {
name: "[path][name].[ext][query]",
outputPath: (url, resourcePath, context) => {
outputPath: (url) => {
if (/node_modules\/@spectrum-css/.test(url)) {
return `assets/css/${url.replace(/^_\/_\/node_modules\/@spectrum-css\//g, "")}`;
}

return `assets/css/${url.replace(/_\//g, "")}`;
},
esModule: false,
Expand Down
10 changes: 5 additions & 5 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import logo from "./assets/logo.svg";
import pkg from "./package.json";

// Load global styles
import "@spectrum-css/vars/css/globals/index.css";
import "@spectrum-css/vars/css/components/index.css";

import "@spectrum-css/vars/css/scales/spectrum-medium.css";
import "@spectrum-css/vars/css/themes/spectrum-light.css";
import "@spectrum-css/vars/dist/spectrum-global.css";
import "@spectrum-css/vars/dist/spectrum-light.css";
import "@spectrum-css/vars/dist/spectrum-medium.css";

import "./global.js";

import "@spectrum-css/tokens";

addons.setConfig({
theme: create({
base: "light",
Expand Down
15 changes: 15 additions & 0 deletions .storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@
"{workspaceRoot}/storybook-static"
]
},
"storybook": {
"dependsOn": [
"^build"
],
"inputs": [
"{workspaceRoot}/assets",
"{workspaceRoot}/decorators",
"{workspaceRoot}/*.js",
"{workspaceRoot}/*.html",
"{projectRoot}/components/*/dist"
],
"outputs": [
"{workspaceRoot}/storybook-static"
]
},
"clean": {
"inputs": [
"{workspaceRoot}/storybook-static"
Expand Down
4 changes: 2 additions & 2 deletions .storybook/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { resolve, relative, basename } = require("path");
const { resolve, relative, basename, sep } = require("path");
const { existsSync } = require("fs");
const warnCleaner = require("postcss-warn-cleaner");

Expand All @@ -8,7 +8,7 @@ const legacyBuilder = require("@spectrum-css/component-builder/css/processors.js
module.exports = (ctx) => {
let plugins = [];
const componentPath = resolve(__dirname, "../components");
const folderName = relative(componentPath, ctx.file).split("/")[0];
const folderName = ctx.file.includes('node_modules') ? relative(resolve(__dirname, "../../node_modules/@spectrum-css"), ctx.file)?.split(sep)?.shift() : relative(componentPath, ctx.file).split("/")[0];
const pkgPath = resolve(componentPath, folderName, "package.json");

if (["expressvars", "vars", "tokens"].includes(folderName)) {
Expand Down
2 changes: 2 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "@spectrum-css/vars/dist/spectrum-dark.css";
import "@spectrum-css/vars/dist/spectrum-darkest.css";
import "@spectrum-css/vars/dist/spectrum-light.css";

import "@spectrum-css/vars/dist/components/index.css";
import "@spectrum-css/vars/dist/spectrum-global.css";

import "@spectrum-css/expressvars/dist/spectrum-large.css";
Expand All @@ -34,6 +35,7 @@ import "@spectrum-css/expressvars/dist/spectrum-dark.css";
import "@spectrum-css/expressvars/dist/spectrum-darkest.css";
import "@spectrum-css/expressvars/dist/spectrum-light.css";

import "@spectrum-css/expressvars/dist/components/index.css";
import "@spectrum-css/expressvars/dist/spectrum-global.css";

import "@spectrum-css/tokens";
Expand Down
3 changes: 0 additions & 3 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
components/**/*-generated.css
tokens/*
components/vars/*
components/express/*
components/expressvars/*
components/site/*
Loading

0 comments on commit 2f354e4

Please sign in to comment.