Skip to content

Commit

Permalink
chore: remove dupe build run during release (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe authored Jan 25, 2023
1 parent d889fdf commit 37bcfe0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 19 deletions.
6 changes: 3 additions & 3 deletions components/switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"build": "gulp"
},
"peerDependencies": {
"@spectrum-css/tokens": "^1.0.7"
"@spectrum-css/tokens": "^6.2.2"
},
"devDependencies": {
"@spectrum-css/component-builder-simple": "^2.0.2",
"@spectrum-css/tokens": "^1.0.7",
"@spectrum-css/tokens": "^6.2.2",
"gulp": "^4.0.0"
},
"publishConfig": {
"access": "public"
}
}
}
1 change: 1 addition & 0 deletions components/textfield/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ governing permissions and limitations under the License.
/* hack: define var so it's not reported as undefined */
.🤫 {
--spectrum-textfield-icon-inline-end-override: 0;
--spectrum-textfield-texticon-padding-left: 0;
}

.spectrum-Textfield {
Expand Down
5 changes: 4 additions & 1 deletion components/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
},
"main": "dist/index.css",
"scripts": {
"build": "gulp build"
"prebuild": "rimraf dist/*",
"build": "style-dictionary build",
"postbuild": "gulp rebuildCustoms"
},
"devDependencies": {
"@adobe/spectrum-tokens": "12.0.0-beta.63",
"gulp": "^4.0.0",
"gulp-concat": "^2.6.1",
"rimraf": "^4.1.1",
"style-dictionary": "^3.7.0",
"style-dictionary-sets": "^2.0.2"
},
Expand Down
1 change: 1 addition & 0 deletions components/vars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"main": "dist/spectrum-metadata.json",
"scripts": {
"build": "gulp build",
"update": "gulp update"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"noPrivate": true,
"command": {
"publish": {
"conventionalCommits": true,
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,25 @@
"backstop:test-all": "backstop test --docker --config=backstop_data/backstop_test.js --env=local themes=light,dark,darkest scales=medium,large",
"build": "run-s build:site build:preview # preview cannot be built until the component assets are finished",
"build:clean": "run-s clean build",
"build:components": "gulp buildComponents -LLL ",
"build:components": "lerna run --stream --scope \"@spectrum-css/*\" --ignore \"@spectrum-css/{*-builder*,preview,generator,site}\" build",
"build:preview": "yarn workspace @spectrum-css/preview build",
"postbuild:preview": "rimraf dist/preview && mv tools/preview/storybook-static dist/preview",
"build:site": "gulp -LL",
"check:peerDeps": "gulp checkPeerDependencies # validate peer deps for components; escapes before running lerna if they are not valid",
"ci-all": "yarn build",
"clean": "gulp clean",
"dev": "NODE_ENV=development BROWSERSYNC_OPEN=true gulp dev",
"kill-zombies": "pkill -f \"(chrome)?(--headless)\"",
"new": "yarn workspace @spectrum-css/generator new",
"precommit": "lint-staged",
"prepare": "husky install && gulp prepare",
"prerelease": "yarn build:clean",
"release": "lerna publish --no-private",
"prerelease:beta-from-package": "yarn build:clean",
"release:beta-from-package": "lerna publish from-package --conventional-prerelease --preid beta --pre-dist-tag beta --no-private",
"prerelease": "run-s check:peerDeps version:build",
"release": "lerna publish",
"release:beta-from-package": "yarn release from-package --conventional-prerelease --preid beta --pre-dist-tag beta --no-private",
"release:bundles": "gulp releaseBundles",
"release:site": "gulp prepareSite && gh-pages -d dist-site/ -f -e .",
"start": "NODE_ENV=development yarn workspace @spectrum-css/preview start",
"preversion": "yarn build:clean",
"version": "gulp version",
"version:build": "SCOPE=$(lerna changed | tr \"\\\\n\" ,) && lerna run --stream --scope \"{${SCOPE%,}}\" --ignore \"@spectrum-css/{*-builder*,preview,generator,site}\" build",
"watch": "gulp watch"
},
"workspaces": [
Expand Down
11 changes: 10 additions & 1 deletion tools/component-builder-simple/css/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,16 @@ function getTokensDefinedInCSS(root) {
}

async function getCoreTokens() {
const coreTokensFile = require.resolve('@spectrum-css/tokens');
const fetchOptions = {
paths: [
process.cwd(),
path.join(process.cwd(), '../../')
]
};
/* Resolve core tokens first from the current working directory, or if not found, from the root of the monorepo */
const coreTokensFile = require.resolve('@spectrum-css/tokens', fetchOptions);
const coreTokensPkg = require.resolve('@spectrum-css/tokens/package.json', fetchOptions);
if (coreTokensPkg) console.log('Core tokens version:', await fsp.readFile(coreTokensPkg, 'utf8').then(JSON.parse).then(pkg => pkg.version));
let contents = await fsp.readFile(coreTokensFile, 'utf8');
let root = postcssReal.parse(contents);
return getTokensDefinedInCSS(root);
Expand Down
8 changes: 6 additions & 2 deletions tools/component-builder/css/lib/varUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ function resolveValue(value, vars) {
}
}

const varDir = path.join(path.dirname(require.resolve('@spectrum-css/vars')), '..');
const coreTokensFile = require.resolve('@spectrum-css/tokens');
const varDir = path.join(path.dirname(require.resolve('@spectrum-css/vars', {
paths: [process.cwd(), path.join(process.cwd(), '../../')]
})), '..');
const coreTokensFile = require.resolve('@spectrum-css/tokens', {
paths: [process.cwd(), path.join(process.cwd(), '../../')]
});

async function readDNAVariables(file) {
let css = await fsp.readFile(path.join(varDir, 'css', file));
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2722,11 +2722,6 @@
resolved "https://registry.yarnpkg.com/@spectrum-css/tag/-/tag-3.3.15.tgz#971184fd8cb977b85a529f808313851863123278"
integrity sha512-pF6Wh61Z7hmAy20twIlpjdDuivYj6UPtWIzK7giyJKr/qcn20BjVN2ChIeFB1N+vBamJdLsuQOewv4AJ3+LZ2Q==

"@spectrum-css/tokens@^1.0.7":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@spectrum-css/tokens/-/tokens-1.0.7.tgz#7256ed9383ac4555f7bc0cf43a9ebe4f5e41b117"
integrity sha512-KGP78ZBPLVyj1+2uHU4IOVcPrQipqGkO9e9j3p3eQVbb4JuBJ9v9sJ5p5Z+z3nmcJV6wdg/zLpf1ZH0tnjl3hg==

"@spectrum-css/tokens@^4.0.0":
version "4.0.0"
resolved "https://registry.npmjs.org/@spectrum-css/tokens/-/tokens-4.0.0.tgz#581b858225aae05b9b784db1aa0e257c3e9c53cf"
Expand Down

0 comments on commit 37bcfe0

Please sign in to comment.