Skip to content

Commit

Permalink
Backport PR #13741 on branch 3.5.x (Drop the dependency on @jupyterla…
Browse files Browse the repository at this point in the history
…b/buildutils in @jupyterlab/builder) (#13753)

* Backport PR #13741: Drop the dependency on `@jupyterlab/buildutils` in `@jupyterlab/builder`

* Fix python dist checks

Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
  • Loading branch information
fcollonval and jtpio committed Jan 14, 2023
1 parent f2db901 commit 3da21f3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"watch": "tsc -w --listEmittedFiles"
},
"dependencies": {
"@jupyterlab/buildutils": "^3.5.2",
"@lumino/algorithm": "^1.9.0",
"@lumino/application": "^1.27.0",
"@lumino/commands": "^1.19.0",
Expand Down
5 changes: 2 additions & 3 deletions builder/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import * as webpack from 'webpack';
import * as fs from 'fs-extra';
import * as glob from 'glob';
import * as path from 'path';
import { readJSONFile } from '@jupyterlab/buildutils';

/**
* A namespace for JupyterLab build utilities.
Expand Down Expand Up @@ -137,7 +136,7 @@ export namespace Build {
path.join(packagePath, 'package.json')
);
const packageDir = path.dirname(packageDataPath);
const data = readJSONFile(packageDataPath);
const data = fs.readJSONSync(packageDataPath);
const name = data.name;
const extension = normalizeExtension(data);

Expand All @@ -162,7 +161,7 @@ export namespace Build {
if (fs.existsSync(destination)) {
try {
const oldPackagePath = path.join(destination, 'package.json.orig');
const oldPackageData = readJSONFile(oldPackagePath);
const oldPackageData = fs.readJSONSync(oldPackagePath);
if (oldPackageData.version === data.version) {
fs.removeSync(destination);
}
Expand Down
7 changes: 4 additions & 3 deletions builder/src/extensionConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { merge } from 'webpack-merge';
import * as fs from 'fs-extra';
import * as glob from 'glob';
import Ajv from 'ajv';
import { readJSONFile, writeJSONFile } from '@jupyterlab/buildutils';

const baseConfig = require('./webpack.config.base');
const { ModuleFederationPlugin } = webpack.container;
Expand Down Expand Up @@ -189,7 +188,7 @@ function generateConfig({
}

// Find the remoteEntry file and add it to the package.json metadata
const data = readJSONFile(path.join(outputPath, 'package.json'));
const data = fs.readJSONSync(path.join(outputPath, 'package.json'));
const _build: any = {
load: path.join('static', newEntry)
};
Expand All @@ -203,7 +202,9 @@ function generateConfig({
_build.style = './style';
}
data.jupyterlab._build = _build;
writeJSONFile(path.join(outputPath, 'package.json'), data);
fs.writeJSONSync(path.join(outputPath, 'package.json'), data, {
spaces: 2
});
});
}
}
Expand Down
6 changes: 1 addition & 5 deletions builder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@
"module": "commonjs"
},
"include": ["src/*"],
"references": [
{
"path": "../buildutils"
}
]
"references": []
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ignore = ["binder/**", "builder/**", "buildutils/**", "design/**", "dev_mode/**"
version-cmd = "jlpm bumpversion --force --skip-commit"
npm-install-options = "--legacy-peer-deps"
npm-cmd = "npm publish --tag latest"
pydist-extra-check-cmds = ""
release-message = "[ci skip] Publish {version}"
tag-message = "[ci skip] Release {tag_name}"

Expand Down

0 comments on commit 3da21f3

Please sign in to comment.