Skip to content

Commit

Permalink
Normalize package layout with nbcelltests
Browse files Browse the repository at this point in the history
  • Loading branch information
painebot committed Jun 4, 2024
1 parent 5da519a commit 857bf20
Show file tree
Hide file tree
Showing 19 changed files with 3,764 additions and 3,425 deletions.
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DOCKER_COMPOSE := podman-compose
YARN := jlpm

###############
# Build Tools #
Expand Down Expand Up @@ -52,7 +51,7 @@ testpy: ## Clean and Make unit tests
python -m pytest -v jupyterfs/tests --junitxml=junit.xml --cov=jupyterfs --cov-report=xml:.coverage.xml --cov-branch --cov-fail-under=20 --cov-report term-missing

testjs: ## Clean and Make js tests
cd js; ${YARN} test
cd js; jlpm test

test: tests
tests: testpy testjs ## run the tests
Expand All @@ -67,15 +66,15 @@ lintpy: ## Lint Python with Ruff
python -m ruff format --check jupyterfs setup.py

lintjs: ## Lint Javascript with ESlint
cd js; ${YARN} lint
cd js; jlpm lint

lint: lintpy lintjs ## run linter

fixpy: ## Autoformat Python with Ruff
python -m ruff format jupyterfs/ setup.py

fixjs: ## Autoformat JavaScript with ESlint
cd js; ${YARN} fix
cd js; jlpm fix

fix: fixpy fixjs ## run black/tslint fix
format: fix
Expand Down Expand Up @@ -122,7 +121,7 @@ clean: ## clean the repository
find . -name ".ipynb_checkpoints" | xargs rm -rf
rm -rf .coverage coverage *.xml build dist *.egg-info lib node_modules .pytest_cache *.egg-info
rm -rf jupyterfs/labextension jupyterfs/nbextension/static/index*
cd js && ${YARN} clean
cd js && jlpm clean
git clean -fd

###########
Expand Down
8 changes: 8 additions & 0 deletions js/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
module.exports = {
ignorePatterns: ["lib/**", "node_modules/**", "filetree.ts", "utils.ts"],
env: {
Expand Down
8 changes: 8 additions & 0 deletions js/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
module.exports = {
presets: [
[
Expand Down
8 changes: 8 additions & 0 deletions js/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
const esModules = ["@jupyter", "@jupyterlab", "@jupyter-widgets", "@lumino", "lib0", "nanoid", "y-protocols", "internmap", "delaunator", "robust-predicates", "lodash-es", "tree-finder"].join("|");

module.exports = {
Expand Down
5 changes: 2 additions & 3 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
"build:prod": "jlpm build:lib && jlpm build:labextension:prod",
"build:labextension:prod": "jupyter labextension build --source-map=True .",
"build:lib": "tsc -b",
"clean": "rimraf *junit.xml .jupyter coverage* dist lib tsconfig.tsbuildinfo",
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf ../jupyterfs/labextension",
"clean:slate": "jlpm clean && jlpm clean:labextension && rimraf node_modules",
"deduplicate": "jlpm yarn-deduplicate -s fewer ../yarn.lock || jlpm yarn-deduplicate -s fewer",
"deduplicate": "jlpm yarn-deduplicate -s fewer yarn.lock || jlpm yarn-deduplicate -s fewer",
"fix": "jlpm lint --fix",
"integrity": "jlpm install && jlpm deduplicate && jlpm install",
"lint": "eslint -c .eslintrc.js --ext .js,.ts,.tsx src/ tests/",
"postpack": "shx rm README.md",
"prepack": "shx cp ../README.md .",
"prepublishOnly": "jlpm clean && jlpm clean:labextension && jlpm integrity && jlpm build:prod",
"test": "jest --coverage",
"test:browser": "../ci/browser_check.sh",
"watch": "run-p watch:lib watch:labextension",
"watch:lib": "tsc -b -w",
"watch:labextension": "jupyter labextension watch ."
Expand Down
8 changes: 8 additions & 0 deletions js/style/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import './index.css';
8 changes: 8 additions & 0 deletions js/tests/activate.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import "isomorphic-fetch";

import { browser, progressStatus } from "../src/index";
Expand Down
8 changes: 8 additions & 0 deletions js/tests/assetsTransformer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
const path = require("path");

module.exports = {
Expand Down
8 changes: 8 additions & 0 deletions js/tests/export.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import "isomorphic-fetch";

import * as extension from "../src/index";
Expand Down
8 changes: 8 additions & 0 deletions js/tests/fileMock.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
module.exports = "test-file-stub";
8 changes: 8 additions & 0 deletions js/tests/jest-setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
/* eslint-disable no-undef */
//global.fetch = require("jest-fetch-mock");
const version = process.version.match(/^v((\d+)\.(\d+))/).slice(2, 4).map(v => parseInt(v));
Expand Down
8 changes: 8 additions & 0 deletions js/tests/settings.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import "isomorphic-fetch";

import { unpartialResource } from "../src/settings";
Expand Down
8 changes: 8 additions & 0 deletions js/tests/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
Object.defineProperty(window, "DragEvent", {
value: class DragEvent {},
});
8 changes: 8 additions & 0 deletions js/tests/snippets.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import "isomorphic-fetch";

import {
Expand Down
8 changes: 8 additions & 0 deletions js/tests/styleMock.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/******************************************************************************
*
* Copyright (c) 2019, the jupyter-fs authors.
*
* This file is part of the jupyter-fs library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
module.exports = {};
Loading

0 comments on commit 857bf20

Please sign in to comment.