Skip to content

Commit

Permalink
a little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
snowystinger committed Apr 19, 2024
1 parent 759a136 commit fbbba2b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Expand Up @@ -382,10 +382,6 @@ jobs:
command: |
yarn -v
- run:
name: Corepack
command: corepack enable --install-directory ~/bin

- run:
name: build branch apis
command: yarn build:api-branch
Expand Down
1 change: 0 additions & 1 deletion scripts/buildPublishedAPI.js
Expand Up @@ -197,7 +197,6 @@ async function build() {
json.targets = {
apiCheck: {}
};
// json.source = json.
fs.writeFileSync(path.join(dir, 'packages', p), JSON.stringify(json, false, 2));
}
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/buildWebsite.js
Expand Up @@ -24,6 +24,8 @@ build().catch(err => {
process.exit(1);
});

// Changes dependencies in the workspace from 'workspace:^' to
// a range which can actually be installed from npm/verdaccio.
function moveWorkspaceToPeer(dir, pkgPath) {
let devPkg = JSON.parse(fs.readFileSync(path.join(dir, pkgPath), 'utf8'));
if (!devPkg.dependencies) {
Expand Down Expand Up @@ -139,7 +141,6 @@ async function build() {
fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(pkg, false, 2));

// Copy necessary code and configuration over
// fs.copySync(path.join(__dirname, '..', 'yarn.lock'), path.join(dir, 'yarn.lock'));
fs.copySync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev'));
fs.copySync(path.join(__dirname, '..', 'packages', '@internationalized', 'string-compiler'), path.join(dir, 'packages', '@internationalized', 'string-compiler'));
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp'));
Expand Down
10 changes: 9 additions & 1 deletion scripts/compare-yarnlocks.mjs
@@ -1,4 +1,3 @@

import fs from 'node:fs';
import semver from 'semver';
import chalk from 'chalk';
Expand All @@ -15,6 +14,15 @@ let argv = yargs(process.argv.slice(2))

// example node ./scripts/compare-yarnlocks.mjs -d --v1 ..../react-spectrum/yarn.lock --v4 ..../react-spectrum/yarn.lock

/**
* This compares two yarn lock files, one generated by yarn 1, and one generated
* by yarn 4. It can tell you what packages v4 has added which are completely `new`
* usually due to peer dependencies now being installed by default.
* It can tell you a set of yarn `resolutions` to try in order to match as many versions
* as possible between the two lock files; note, this is not guaranteed.
* And it can tell you all the other `differences` in versions between packages.
*/

let yarn4Lock = fs.readFileSync(argv.v4, 'utf8');
let yarn1Lock = fs.readFileSync(argv.v1, 'utf8');

Expand Down
1 change: 0 additions & 1 deletion scripts/verdaccio.sh
Expand Up @@ -143,7 +143,6 @@ then

cd ../..

pwd
echo 'get size of each package published to verdaccio'
# Get the tarball size of each published package.
node scripts/verdaccioPkgSize.js
Expand Down
7 changes: 0 additions & 7 deletions scripts/verdaccioPkgSize.js
Expand Up @@ -11,21 +11,14 @@ function verdaccioPkgSize() {
let verdaccioStorePath = exec('echo ~/.config/verdaccio/storage/').toString().trim();

if (!fs.existsSync(verdaccioStorePath)) {
console.log(verdaccioStorePath + ' does not exist, trying the default path');
verdaccioStorePath = path.join(__dirname, '..', 'storage/');
if (fs.existsSync(verdaccioStorePath)) {
console.log('default path found')
}
}
console.log('verdaccioStorePath', verdaccioStorePath);

let json = {};
let verdaccioDBPath = path.join(__dirname, '..', 'storage', '.verdaccio-db.json');
let publishedPackages = JSON.parse(fs.readFileSync(verdaccioDBPath), 'utf').list;
console.log('list of published packages', publishedPackages);
for (let pkg of publishedPackages) {
let tarballPath = glob.sync(`**/${pkg}/*.tgz`, {cwd: verdaccioStorePath});
console.log('tarball path', verdaccioStorePath + tarballPath);
let size = fs.statSync(verdaccioStorePath + tarballPath).size / 1000;
json[pkg] = size;
}
Expand Down

0 comments on commit fbbba2b

Please sign in to comment.