Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
"ecmaVersion": 2020
},
"env": {
"browser": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [10.x, 12.x]
node-version: [14.x, 16.x]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2018-2021 Observable, Inc.
Copyright 2018-2022 Observable, Inc.

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Node CI](https://github.com/observablehq/inspector/workflows/Node%20CI/badge.svg)](https://github.com/observablehq/inspector/actions?workflow=Node+CI)

This library implements the default value renderer for Observable programs. When used with the [Observable runtime](https://github.com/observablehq/runtime) as [observers](https://github.com/observablehq/runtime/blob/master/README.md#observers), inspectors can insert elements into the DOM and render interactive displays for arbitrary values.
This library implements the default value renderer for Observable programs. When used with the [Observable runtime](https://github.com/observablehq/runtime) as [observers](https://github.com/observablehq/runtime/blob/main/README.md#observers), inspectors can insert elements into the DOM and render interactive displays for arbitrary values.

To install this library from [npm](https://www.npmjs.com/package/@observablehq/inspector):

Expand All @@ -16,7 +16,7 @@ This library is also available for download [from unpkg](https://unpkg.com/@obse

### Inspectors

An inspector implements the Observable runtime’s [*Observer* interface](https://github.com/observablehq/runtime/blob/master/README.md#observers) by rendering the current value of its associated [variable](https://github.com/observablehq/runtime/blob/master/README.md#variables) to a given DOM element. Inspectors display DOM elements “as-is”, and create interactive “devtools”-style inspectors for other arbitrary values such as numbers and objects.
An inspector implements the Observable runtime’s [*Observer* interface](https://github.com/observablehq/runtime/blob/main/README.md#observers) by rendering the current value of its associated [variable](https://github.com/observablehq/runtime/blob/main/README.md#variables) to a given DOM element. Inspectors display DOM elements “as-is”, and create interactive “devtools”-style inspectors for other arbitrary values such as numbers and objects.

<a href="#Inspector" name="Inspector">#</a> new **Inspector**(*element*) [<>](https://github.com/observablehq/inspector/blob/master/src/index.js "Source")

Expand All @@ -36,4 +36,4 @@ Inspects the specified *error*, replacing the contents of this inspector’s *el

<a href="#Inspector_into" name="Inspector_into">#</a> Inspector.**into**(*container*) [<>](https://github.com/observablehq/inspector/blob/master/src/index.js "Source")

Returns a function that when passed a given [*variable*](https://github.com/observablehq/runtime/blob/master/README.md#variables), returns a new [*inspector*](#inspectors) attached to a new DIV element within the specifier *container* element. If *container* is a string, it represents a selector, and the *container* element becomes the matching selected element. This method can be used with [an Observable module definition](https://github.com/observablehq/runtime/blob/master/README.md#_define) as the observer factory to conveniently render an entire program.
Returns a function that when passed a given [*variable*](https://github.com/observablehq/runtime/blob/main/README.md#variables), returns a new [*inspector*](#inspectors) attached to a new DIV element within the specifier *container* element. If *container* is a string, it represents a selector, and the *container* element becomes the matching selected element. This method can be used with [an Observable module definition](https://github.com/observablehq/runtime/blob/main/README.md#_define) as the observer factory to conveniently render an entire program.
58 changes: 31 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@
{
"name": "@observablehq/inspector",
"version": "3.2.4",
"license": "ISC",
"main": "dist/inspector.js",
"module": "src/index.js",
"author": {
"name": "Observable, Inc.",
"url": "https://observablehq.com"
},
"license": "ISC",
"type": "module",
"main": "src/index.js",
"module": "src/index.js",
"jsdelivr": "dist/inspector.js",
"unpkg": "dist/inspector.js",
"exports": {
"umd": "./dist/inspector.js",
"default": "./src/index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/observablehq/inspector.git"
},
"scripts": {
"test": "rollup -c && jest",
"prepublishOnly": "rollup -c && cleancss -o dist/inspector.css src/style.css",
"postpublish": "git push && git push --tags"
},
"esm": {
"mode": "all",
"mainFields": [
"module"
],
"cjs": true
},
"files": [
"src/**/*.css",
"src/**/*.js",
"dist/**/*.css",
"dist/**/*.js"
"dist/**/*.js",
"src/**/*.css",
"src/**/*.js"
],
"devDependencies": {
"clean-css-cli": "^4.3.0",
"eslint": "^7.18.0",
"esm": "^3.2.25",
"immutable": "^4.0.0-rc.12",
"jest": "^26.6.3",
"rollup": "^2.37.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.2"
"scripts": {
"test": "mkdir -p test/output && mocha 'test/**/*-test.js' && eslint src test",
"prepublishOnly": "rm -rf dist && rollup -c && cleancss -o dist/inspector.css src/style.css",
"postpublish": "git push && git push --tags"
},
"_moduleAliases": {
"@observablehq/inspector": "./src/index.js"
},
"dependencies": {
"isoformat": "^0.2.0"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.1",
"clean-css-cli": "^5.6.1",
"eslint": "^8.27.0",
"immutable": "^4.1.0",
"jsdom": "^20.0.2",
"mocha": "^10.1.0",
"module-alias": "^2.2.2",
"rollup": "^3.2.5",
"rollup-plugin-terser": "^7.0.2"
}
}
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import node from "rollup-plugin-node-resolve";
import node from "@rollup/plugin-node-resolve";
import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";
import * as meta from "./package.json" assert {type: "json"};

const copyright = `// @observablehq/inspector v${meta.version} Copyright ${(new Date).getFullYear()} Observable, Inc.`;

Expand Down
5 changes: 5 additions & 0 deletions test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"mocha": true
}
}
Loading