Browse Source

去除pre-commit

herj 2 years ago
parent
commit
6b4a77a893

+ 35 - 35
.pre-commit-config.yaml

@@ -2,40 +2,40 @@ ci:
   # skip any check that needs internet access
   skip: [check-jsonschema, prettier, eslint, integrity]
 
-repos:
-  - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.2.0
-    hooks:
-      - id: forbid-new-submodules
-      - id: check-case-conflict
-      - id: requirements-txt-fixer
-      - id: check-added-large-files
-      - id: check-case-conflict
-      - id: debug-statements
+repos: []
+  # - repo: https://github.com/pre-commit/pre-commit-hooks
+  #   rev: v4.2.0
+  #   hooks:
+  #     - id: forbid-new-submodules
+  #     - id: check-case-conflict
+  #     - id: requirements-txt-fixer
+  #     - id: check-added-large-files
+  #     - id: check-case-conflict
+  #     - id: debug-statements
 
-  - repo: https://github.com/sirosen/check-jsonschema
-    rev: 0.14.2
-    hooks:
-      - id: check-jsonschema
-        name: 'Check GitHub Workflows'
-        files: ^\.github/workflows/
-        types: [yaml]
-        args: ['--schemafile', 'https://json.schemastore.org/github-workflow']
+  # - repo: https://github.com/sirosen/check-jsonschema
+  #   rev: 0.14.2
+  #   hooks:
+  #     - id: check-jsonschema
+  #       name: 'Check GitHub Workflows'
+  #       files: ^\.github/workflows/
+  #       types: [yaml]
+  #       args: ['--schemafile', 'https://json.schemastore.org/github-workflow']
 
-  - repo: local
-    hooks:
-      - id: prettier
-        name: prettier
-        entry: 'npm run prettier:files'
-        language: node
-        types_or: [json, markdown, ts, tsx, javascript, jsx, css]
-      - id: eslint
-        name: eslint
-        entry: 'npm run eslint:files'
-        language: node
-        types_or: [ts, tsx, javascript, jsx]
-      - id: integrity
-        name: integrity
-        entry: 'npm run integrity --force'
-        language: node
-        stages: [push]
+  # - repo: local
+  #   hooks:
+  #     - id: prettier
+  #       name: prettier
+  #       entry: 'npm run prettier:files'
+  #       language: node
+  #       types_or: [json, markdown, ts, tsx, javascript, jsx, css]
+  #     - id: eslint
+  #       name: eslint
+  #       entry: 'npm run eslint:files'
+  #       language: node
+  #       types_or: [ts, tsx, javascript, jsx]
+  #     - id: integrity
+  #       name: integrity
+  #       entry: 'npm run integrity --force'
+  #       language: node
+  #       stages: [push]

+ 4 - 0
dev_mode/package.json

@@ -73,6 +73,7 @@
     "@jupyterlab/mathjax2": "~3.4.3",
     "@jupyterlab/mathjax2-extension": "~3.4.3",
     "@jupyterlab/metapackage": "~3.4.3",
+    "@jupyterlab/mytest-extension": "~1.0.0",
     "@jupyterlab/nbconvert-css": "~3.4.3",
     "@jupyterlab/nbformat": "~3.4.3",
     "@jupyterlab/notebook": "~3.4.3",
@@ -156,6 +157,7 @@
     "@jupyterlab/mainmenu-extension": "~3.4.3",
     "@jupyterlab/markdownviewer-extension": "~3.4.3",
     "@jupyterlab/mathjax2-extension": "~3.4.3",
+    "@jupyterlab/mytest-extension": "~1.0.0",
     "@jupyterlab/notebook-extension": "~3.4.3",
     "@jupyterlab/pdf-extension": "~3.4.3",
     "@jupyterlab/rendermime-extension": "~3.4.3",
@@ -235,6 +237,7 @@
       "@jupyterlab/mainmenu-extension": "",
       "@jupyterlab/markdownviewer-extension": "",
       "@jupyterlab/mathjax2-extension": "",
+      "@jupyterlab/mytest-extension": "",
       "@jupyterlab/notebook-extension": "",
       "@jupyterlab/rendermime-extension": "",
       "@jupyterlab/running-extension": "",
@@ -368,6 +371,7 @@
       "@jupyterlab/mathjax2": "../packages/mathjax2",
       "@jupyterlab/mathjax2-extension": "../packages/mathjax2-extension",
       "@jupyterlab/metapackage": "../packages/metapackage",
+      "@jupyterlab/mytest-extension": "../packages/mytest-extenison",
       "@jupyterlab/nbconvert-css": "../packages/nbconvert-css",
       "@jupyterlab/nbformat": "../packages/nbformat",
       "@jupyterlab/notebook": "../packages/notebook",

+ 1 - 0
dev_mode/style.js

@@ -29,6 +29,7 @@ import '@jupyterlab/logconsole-extension/style/index.js';
 import '@jupyterlab/mainmenu-extension/style/index.js';
 import '@jupyterlab/markdownviewer-extension/style/index.js';
 import '@jupyterlab/mathjax2-extension/style/index.js';
+import '@jupyterlab/mytest-extension/style/index.js';
 import '@jupyterlab/notebook-extension/style/index.js';
 import '@jupyterlab/pdf-extension/style/index.js';
 import '@jupyterlab/rendermime-extension/style/index.js';

+ 1 - 0
packages/metapackage/package.json

@@ -90,6 +90,7 @@
     "@jupyterlab/markdownviewer-extension": "^3.4.3",
     "@jupyterlab/mathjax2": "^3.4.3",
     "@jupyterlab/mathjax2-extension": "^3.4.3",
+    "@jupyterlab/mytest-extension": "^1.0.0",
     "@jupyterlab/nbconvert-css": "^3.4.3",
     "@jupyterlab/nbformat": "^3.4.3",
     "@jupyterlab/notebook": "^3.4.3",

+ 1 - 0
packages/metapackage/style/index.css

@@ -5,3 +5,4 @@
 
 /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
 @import url('~@jupyterlab/jldbq-extension/style/index.css');
+@import url('~@jupyterlab/mytest-extension/style/index.css');

+ 1 - 0
packages/metapackage/style/index.js

@@ -5,3 +5,4 @@
 
 /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
 import '@jupyterlab/jldbq-extension/style/index.js';
+import '@jupyterlab/mytest-extension/style/index.js';

+ 6 - 1
packages/metapackage/tsconfig.json

@@ -4,7 +4,9 @@
     "outDir": "lib",
     "rootDir": "src"
   },
-  "include": ["src/*"],
+  "include": [
+    "src/*"
+  ],
   "references": [
     {
       "path": "../application"
@@ -174,6 +176,9 @@
     {
       "path": "../mathjax2-extension"
     },
+    {
+      "path": "../mytest-extenison"
+    },
     {
       "path": "../nbformat"
     },

+ 47 - 0
packages/mytest-extenison/package.json

@@ -0,0 +1,47 @@
+{
+  "name": "@jupyterlab/mytest-extension",
+  "version": "1.0.0",
+  "description": "MyTest Extension",
+  "homepage": "",
+  "license": "MIT",
+  "author": "yili",
+  "sideEffects": [
+    "style/**/*.css",
+    "style/index.js"
+  ],
+  "main": "lib/index.js",
+  "types": "lib/index.d.ts",
+  "style": "style/index.css",
+  "directories": {
+    "lib": "lib/"
+  },
+  "files": [
+    "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
+    "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
+    "schema/*.json"
+  ],
+  "scripts": {
+    "build": "tsc -b",
+    "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
+    "docs": "typedoc src",
+    "watch": "tsc -b --watch"
+  },
+  "dependencies": {
+    "@jupyterlab/application": "^3.4.3",
+    "@jupyterlab/apputils": "^3.4.3",
+    "@jupyterlab/ui-components": "^3.4.3",
+    "@lumino/widgets": "^1.30.0"
+  },
+  "devDependencies": {
+    "rimraf": "~3.0.0",
+    "typedoc": "~0.21.2",
+    "typescript": "~4.1.3"
+  },
+  "publishConfig": {
+    "access": "public"
+  },
+  "jupyterlab": {
+    "extension": true
+  },
+  "styleModule": "style/index.js"
+}

+ 38 - 0
packages/mytest-extenison/src/index.ts

@@ -0,0 +1,38 @@
+/**
+ * @packageDocumentation
+ * @module jldbq-extension
+ */
+
+import {
+  JupyterFrontEnd,
+  JupyterFrontEndPlugin
+} from '@jupyterlab/application';
+import { Dialog, ICommandPalette, showDialog } from '@jupyterlab/apputils';
+import { Widget } from '@lumino/widgets';
+
+const plugin: JupyterFrontEndPlugin<void> = {
+  id: '@jupyterlab/mytest-extension',
+  autoStart: true,
+  requires: [ICommandPalette],
+  activate: async (app: JupyterFrontEnd, palette: ICommandPalette) => {
+    const command = 'mytest-command';
+    app.commands.addCommand(command, {
+      label: command,
+      execute: async () => {
+        await showDialog({
+          title: 'test',
+          body: new (class
+            extends Widget
+            implements Dialog.IBodyWidget<string> {
+            getValue(): string {
+              throw new Error('test');
+            }
+          })()
+        });
+      }
+    });
+    palette.addItem({ command, category: 'mytest', args: { isPalette: true } });
+  }
+};
+
+export default plugin;

+ 5 - 0
packages/mytest-extenison/style/base.css

@@ -0,0 +1,5 @@
+/*
+    See the JupyterLab Developer Guide for useful CSS Patterns:
+
+    https://jupyterlab.readthedocs.io/en/stable/developer/css.html
+*/

+ 12 - 0
packages/mytest-extenison/style/index.css

@@ -0,0 +1,12 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
+@import url('~@lumino/widgets/style/index.css');
+@import url('~@jupyterlab/ui-components/style/index.css');
+@import url('~@jupyterlab/apputils/style/index.css');
+@import url('~@jupyterlab/application/style/index.css');
+
+@import url('./base.css');

+ 12 - 0
packages/mytest-extenison/style/index.js

@@ -0,0 +1,12 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
+import '@lumino/widgets/style/index.js';
+import '@jupyterlab/ui-components/style/index.js';
+import '@jupyterlab/apputils/style/index.js';
+import '@jupyterlab/application/style/index.js';
+
+import './base.css';

+ 19 - 0
packages/mytest-extenison/tsconfig.json

@@ -0,0 +1,19 @@
+{
+  "extends": "../../tsconfigbase",
+  "compilerOptions": {
+    "outDir": "lib",
+    "rootDir": "src"
+  },
+  "include": ["src/**/*"],
+  "references": [
+    {
+      "path": "../application"
+    },
+    {
+      "path": "../apputils"
+    },
+    {
+      "path": "../ui-components"
+    }
+  ]
+}

+ 4 - 0
packages/mytest-extenison/typedoc.json

@@ -0,0 +1,4 @@
+{
+  "out": "../../docs/api/mytest-extension",
+  "theme": "../../typedoc-theme"
+}

+ 3 - 0
tsconfigdoc.json

@@ -184,6 +184,9 @@
     {
       "path": "./packages/mathjax2-extension"
     },
+    {
+      "path": "./packages/mytest-extenison"
+    },
     {
       "path": "./packages/nbformat"
     },