@substrate-system/debug 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,131 +1,168 @@
1
- # PolyForm Noncommercial License 1.0.0
1
+ # Big Time Public License
2
2
 
3
- <https://polyformproject.org/licenses/noncommercial/1.0.0>
3
+ Version 2.0.2
4
+
5
+ <https://bigtimelicense.com/versions/2.0.2>
6
+
7
+ ## Purpose
8
+
9
+ These terms let you use and share this software for noncommercial purposes
10
+ and in small business for free, while also guaranteeing that paid licenses
11
+ for big businesses will be available on fair, reasonable, and
12
+ nondiscriminatory terms.
4
13
 
5
14
  ## Acceptance
6
15
 
7
- In order to get any license under these terms, you must agree
8
- to them as both strict obligations and conditions to all
9
- your licenses.
16
+ In order to get any license under these terms, you must agree to them as
17
+ both strict obligations and conditions to all your licenses.
10
18
 
11
- ## Copyright License
19
+ ## Noncommercial Purposes
12
20
 
13
- The licensor grants you a copyright license for the
14
- software to do everything you might do with the software
15
- that would otherwise infringe the licensor's copyright
16
- in it for any permitted purpose. However, you may
17
- only distribute the software according to [Distribution
18
- License](#distribution-license) and make changes or new works
19
- based on the software according to [Changes and New Works
20
- License](#changes-and-new-works-license).
21
+ You may use the software for any noncommercial purpose.
21
22
 
22
- ## Distribution License
23
+ ## Personal Uses
23
24
 
24
- The licensor grants you an additional copyright license
25
- to distribute copies of the software. Your license
26
- to distribute covers distributing the software with
27
- changes and new works permitted by [Changes and New Works
28
- License](#changes-and-new-works-license).
25
+ Personal use for research, experiment, and testing for the benefit of
26
+ public knowledge, personal study, private entertainment, hobby projects,
27
+ amateur pursuits, or religious observance, without any anticipated
28
+ commercial application, count as use for noncommercial purposes.
29
29
 
30
- ## Notices
30
+ ## Noncommercial Organizations
31
31
 
32
- You must ensure that anyone who gets a copy of any part of
33
- the software from you also gets a copy of these terms or the
34
- URL for them above, as well as copies of any plain-text lines
35
- beginning with `Required Notice:` that the licensor provided
36
- with the software. For example:
32
+ Use by any charitable organization, educational institution, public
33
+ research organization, public safety or health organization, environmental
34
+ protection organization, or government institution counts as use for
35
+ noncommercial purposes, regardless of the source of funding or obligations
36
+ resulting from the funding.
37
37
 
38
- > Required Notice: Copyright Bicycle Computing (https://bicycle.codes/)
38
+ ## Small Business
39
39
 
40
- ## Changes and New Works License
40
+ You may use the software for the benefit of your company if it meets all
41
+ these criteria:
41
42
 
42
- The licensor grants you an additional copyright license to
43
- make changes and new works based on the software for any
44
- permitted purpose.
43
+ 1. had fewer than 20 total individuals working as employees and
44
+ independent contractors at all times during the last tax year
45
45
 
46
- ## Patent License
46
+ 2. earned less than $1,000,000 total revenue in the last tax year
47
47
 
48
- The licensor grants you a patent license for the software that
49
- covers patent claims the licensor can license, or becomes able
50
- to license, that you would infringe by using the software.
48
+ 3. received less than $1,000,000 total debt, equity, and other investment
49
+ in the last five tax years, counting investment in predecessor
50
+ companies that reorganized into, merged with, or spun out your company
51
51
 
52
- ## Noncommercial Purposes
52
+ All dollar figures are United States dollars as of 2019. Adjust for them
53
+ inflation according to the United States Bureau of Labor Statistics'
54
+ consumer price index for all urban consumers, United States city average,
55
+ for all items, not seasonally adjusted, with 1982–1984=100 reference base.
53
56
 
54
- Any noncommercial purpose is a permitted purpose.
57
+ ## Big Business
55
58
 
56
- ## Personal Uses
59
+ You may use the software for the benefit of your company:
57
60
 
58
- Personal use for research, experiment, and testing for
59
- the benefit of public knowledge, personal study, private
60
- entertainment, hobby projects, amateur pursuits, or religious
61
- observance, without any anticipated commercial application,
62
- is use for a permitted purpose.
61
+ 1. for 128 days after your company stops qualifying under
62
+ [Small Business](#small-business)
63
63
 
64
- ## Noncommercial Organizations
64
+ 2. indefinitely, if the licensor or their legal successor does not offer
65
+ fair, reasonable, and nondiscriminatory terms for a commercial license for
66
+ the software within 32 days of [written request](#how-to-request) and
67
+ negotiate in good faith to conclude a deal
68
+
69
+ ## How to Request
70
+
71
+ If this software includes an address for the licensor or an agent of the
72
+ licensor in a standard place, such as in documentation, software package
73
+ metadata, or an "about" page or screen, try to request a fair commercial
74
+ license at that address. If this package includes both online and offline
75
+ addresses, try online before offline. If you can't deliver a request that
76
+ way, or this software doesn't include any addressees, spend one hour online
77
+ researching an address, recording all your searches and inquiries as you
78
+ go, and try any addresses that you find. If you can't find any addresses,
79
+ or if those addresses also fail, that counts as failure to offer a fair
80
+ commercial license by the licensor under [Big Business](#big-business).
65
81
 
66
- Use by any charitable organization, educational institution,
67
- public research organization, public safety or health
68
- organization, environmental protection organization,
69
- or government institution is use for a permitted purpose
70
- regardless of the source of funding or obligations resulting
71
- from the funding.
82
+ ## Fair, Reasonable, and Nondiscriminatory Terms
83
+
84
+ Fair, reasonable, and nondiscriminatory terms may license the software
85
+ perpetually or for a term, and may or may not cover new versions of the
86
+ software. If the licensor advertises license terms and a pricing structure
87
+ for generally available commercial licenses, the licensor proposes license
88
+ terms and a price as advertised, and a customer not affiliated with the
89
+ licensor has bought a commercial license for the software on substantially
90
+ equivalent terms in the past year, the proposal is fair, reasonable, and
91
+ nondiscriminatory.
92
+
93
+ ## Copyright License
94
+
95
+ The licensor grants you a copyright license to do everything with the
96
+ software that would otherwise infringe the licensor's copyright in it for
97
+ any purpose allowed by these terms.
98
+
99
+ ## Notices
100
+
101
+ You must ensure that anyone who gets a copy of any part of the software
102
+ from you also gets a copy of these terms or the URL for them above, as well
103
+ as copies of any plain-text lines beginning with `Required Notice:` that
104
+ the licensor provided with the software. For example:
105
+
106
+ > Required Notice: Copyright Nick Thomas (https://nichoth.com)
107
+
108
+ ## Patent License
109
+
110
+ The licensor grants you a patent license for the software that covers
111
+ patent claims the licensor can license, or becomes able to license, that
112
+ you would infringe by using the software.
72
113
 
73
114
  ## Fair Use
74
115
 
75
- You may have "fair use" rights for the software under the
76
- law. These terms do not limit them.
116
+ You may have "fair use" rights for the software under the law. These terms
117
+ do not limit them.
77
118
 
78
119
  ## No Other Rights
79
120
 
80
- These terms do not allow you to sublicense or transfer any of
81
- your licenses to anyone else, or prevent the licensor from
82
- granting licenses to anyone else. These terms do not imply
83
- any other licenses.
121
+ These terms do not allow you to sublicense or transfer any of your licenses
122
+ to anyone else, or prevent the licensor from granting licenses to anyone
123
+ else. These terms do not imply any other licenses.
84
124
 
85
125
  ## Patent Defense
86
126
 
87
- If you make any written claim that the software infringes or
88
- contributes to infringement of any patent, your patent license
89
- for the software granted under these terms ends immediately. If
90
- your company makes such a claim, your patent license ends
91
- immediately for work on behalf of your company.
127
+ If you make any written claim that the software infringes or contributes to
128
+ infringement of any patent, your patent license for the software granted
129
+ under these terms ends immediately. If your company makes such a claim,
130
+ your patent license ends immediately for work on behalf of your company.
92
131
 
93
132
  ## Violations
94
133
 
95
- The first time you are notified in writing that you have
96
- violated any of these terms, or done anything with the software
97
- not covered by your licenses, your licenses can nonetheless
98
- continue if you come into full compliance with these terms,
99
- and take practical steps to correct past violations, within
100
- 32 days of receiving notice. Otherwise, all your licenses
101
- end immediately.
134
+ The first time you are notified in writing that you have violated any of
135
+ these terms, or done anything with the software not covered by your
136
+ licenses, your licenses can nonetheless continue if you come into full
137
+ compliance with these terms, and take practical steps to correct past
138
+ violations, within 32 days of receiving notice. Otherwise, all your
139
+ licenses end immediately.
102
140
 
103
141
  ## No Liability
104
142
 
105
- ***As far as the law allows, the software comes as is, without
106
- any warranty or condition, and the licensor will not be liable
107
- to you for any damages arising out of these terms or the use
108
- or nature of the software, under any kind of legal claim.***
143
+ ***As far as the law allows, the software comes as is, without any warranty
144
+ or condition, and the licensor will not be liable to you for any damages
145
+ arising out of these terms or the use or nature of the software, under any
146
+ kind of legal claim.***
109
147
 
110
148
  ## Definitions
111
149
 
112
- The **licensor** is the individual or entity offering these
113
- terms, and the **software** is the software the licensor makes
114
- available under these terms.
115
-
116
- **You** refers to the individual or entity agreeing to these
150
+ The **licensor** is the individual or entity offering these terms, and
151
+ the **software** is the software the licensor makes available under these
117
152
  terms.
118
153
 
119
- **Your company** is any legal entity, sole proprietorship,
120
- or other kind of organization that you work for, plus all
121
- organizations that have control over, are under the control of,
122
- or are under common control with that organization. **Control**
123
- means ownership of substantially all the assets of an entity,
124
- or the power to direct its management and policies by vote,
154
+ **You** refers to the individual or entity agreeing to these terms.
155
+
156
+ **Your company** is any legal entity, sole proprietorship, or other kind of
157
+ organization that you work for, plus all organizations that have control
158
+ over, are under the control of, or are under common control with that
159
+ organization. **Control** means ownership of substantially all the assets
160
+ of an entity, or the power to direct its management and policies by vote,
125
161
  contract, or otherwise. Control can be direct or indirect.
126
162
 
127
- **Your licenses** are all the licenses granted to you for the
128
- software under these terms.
163
+ **Your licenses** are all the licenses granted to you for the software
164
+ under these terms.
165
+
166
+ **Use** means anything you do with the software requiring one of your
167
+ licenses.
129
168
 
130
- **Use** means anything you do with the software requiring one
131
- of your licenses.
package/README.md CHANGED
@@ -4,27 +4,33 @@
4
4
  [![types](https://img.shields.io/npm/types/@substrate-system/debug?style=flat-square)](README.md)
5
5
  [![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
6
6
  [![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/debug)](https://packagephobia.com/result?p=@substrate-system/debug)
7
- [![license](https://img.shields.io/badge/license-Polyform_Non_Commercial-26bc71?style=flat-square)](LICENSE)
7
+ [![license](https://img.shields.io/badge/license-Big_Time-blue?style=flat-square)](LICENSE)
8
8
 
9
9
 
10
- A tiny JavaScript debugging utility that works in Node.js and browsers. Use environment variables to control logging, so there are no ridiculous console log statements in production.
10
+ A tiny JavaScript debugging utility that works in Node.js and browsers.
11
+ Use environment variables to control logging, so there are no ridiculous
12
+ console log statements in production.
11
13
 
12
- This is based on [debug](https://github.com/debug-js/debug). It's been rewritten to use contemporary JS.
14
+ This is based on [debug](https://github.com/debug-js/debug).
15
+ It's been rewritten to use contemporary JS.
13
16
 
14
17
  In the browser, this should work well with [vite](https://vite.dev/). As is
15
18
  convention, this will look for an env variable prefixed with `VITE_`. So pass
16
19
  env variables like `VITE_DEBUG="foo"`.
17
20
 
18
21
  **Featuring:**
19
- * Use [exports](https://github.com/substrate-system/debug/blob/main/package.json#L31) field in `package.json` to choose node JS or browser version
22
+ * Use [exports](https://github.com/substrate-system/debug/blob/main/package.json#L31)
23
+ field in `package.json` to choose node JS or browser version
20
24
  * ESM only
21
25
 
22
- Plus, [see the docs](https://substrate-system.github.io/debug/) generated by typescript.
26
+ Plus, [see the docs](https://substrate-system.github.io/debug/)
27
+ generated by typescript.
23
28
 
24
29
  ## Contents
25
30
 
26
31
  <!-- toc -->
27
32
 
33
+ - [Browser](#browser)
28
34
  - [config](#config)
29
35
  * [namespace](#namespace)
30
36
  * [NODE_ENV + Vite](#node_env--vite)
@@ -38,11 +44,28 @@ Plus, [see the docs](https://substrate-system.github.io/debug/) generated by typ
38
44
 
39
45
  <!-- tocstop -->
40
46
 
47
+ ## Browser
48
+
49
+ In the browser, this will look for `VITE_DEBUG` import.meta variable,
50
+ and `DEBUG` in `localStorage`.
51
+
52
+ ```js
53
+ import Debug from '@substrate-system/debug'
54
+
55
+ localStorage.setItem('DEBUG', 'browser:123')
56
+
57
+ const debug = Debug('browser:*')
58
+
59
+ debug('hello logs')
60
+ // will log, b/c DEBUG in localStorage is browser:123
61
+ ```
62
+
63
+
41
64
  ## config
42
65
 
43
66
  ### namespace
44
67
  Works with `vite` or other systems. This will look at `import.meta.env`, or
45
- an arbitrary object you can pass in.
68
+ an arbitrary object you can pass in, or `localStorage` in the browser.
46
69
 
47
70
  ```js
48
71
  import Debug from '@substrate-system/debug'
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,eAAe,WAAW,CAAA;AAuK1B,iBAAS,WAAW,CAAE,SAAS,CAAC,EAAC,MAAM,GAAC,OAAO,EAAE,GAAG,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAQnD,GAAG,EAAE,KAAG,IAAI,CAUpC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,eAAe,WAAW,CAAA;AA4K1B,iBAAS,WAAW,CAAE,SAAS,CAAC,EAAC,MAAM,GAAC,OAAO,EAAE,GAAG,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAQnD,GAAG,EAAE,KAAG,IAAI,CAUpC"}
@@ -10,21 +10,23 @@ export default createDebug;
10
10
  * Need to check it against the env var.
11
11
  */
12
12
  function isEnabled(namespace, env) {
13
- if (env && (env.VITE_DEBUG === '*' || env.DEBUG === '*'))
13
+ const DEBUG = localStorage.getItem('DEBUG');
14
+ if ((env && (env.VITE_DEBUG === '*' || env.DEBUG === '*')) ||
15
+ DEBUG === '*')
14
16
  return true;
15
17
  // if we were not called with a namespace
16
18
  if (namespace === 'DEV') {
17
- // We want to log iff we were not passed a VITE_DEBUG variable.
18
- // Pass in VITE_DEBUG="*" to log everything
19
- if (!env || (!env.VITE_DEBUG && !env.DEBUG)) {
19
+ // We want to log iff there is no DEBUG variable.
20
+ if (!env || (!env.VITE_DEBUG && !DEBUG)) {
20
21
  return true;
21
22
  }
22
23
  return false;
23
24
  }
24
- if (!env || (!env.VITE_DEBUG && !env.DEBUG))
25
+ env = env || {};
26
+ if (!DEBUG && (!env || (!env.VITE_DEBUG && !env.DEBUG)))
25
27
  return false;
26
28
  const envVars = createRegexFromEnvVar(namespace);
27
- return envVars.some(regex => regex.test(env.VITE_DEBUG || env.DEBUG));
29
+ return envVars.some(regex => regex.test(env.VITE_DEBUG || env.DEBUG || DEBUG));
28
30
  }
29
31
  /**
30
32
  * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,IAAI,CA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AS,CAAC,CAAC,CAAC,KAAK,EACjD,IAAI,EACJ,EAAE,QAAQ,EAAE,KAAK,EAAE,EACnB,GAAG,CACN,CAAA;IACL,CAAC,CAAA;IAED,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,SAAS,IAAI,KAAK,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@substrate-system/debug",
3
3
  "description": "Debug utility",
4
4
  "type": "module",
5
- "version": "0.9.2",
5
+ "version": "0.9.4",
6
6
  "main": "./dist/node.js",
7
7
  "files": [
8
8
  "./dist/*"
@@ -18,9 +18,10 @@
18
18
  },
19
19
  "scripts": {
20
20
  "lint": "eslint \"./**/*.{ts,js}\"",
21
+ "test-browser": "esbuild ./test/test-browser.ts --target=es2020 --bundle | npx tapout",
21
22
  "build-tests": "esbuild test/index.ts --platform=node --bundle --format=esm --keep-names > test/index.js",
22
23
  "test-node": "esbuild ./example/node.js --platform=node --bundle --format=esm --keep-names | node --input-type=module",
23
- "test": "npm run lint && npm run build && esbuild test/index.ts --target=es2020 --bundle --platform=node --format=esm | DEBUG=test NODE_ENV=development node --input-type=module",
24
+ "test": "npm run build && esbuild test/index.ts --target=es2020 --bundle --platform=node --format=esm | DEBUG=test NODE_ENV=development node --input-type=module",
24
25
  "build-browser-tests": "esbuild test/index.ts --platform=node --target=es2020 --bundle --keep-names > test/test-bundle.js",
25
26
  "test-tape-run": "npm run build-browser-tests && cat test/index.html | tape-run --input=html --static=test | tap-spec",
26
27
  "build": "mkdir -p dist && rm -rf dist/* && tsc --project tsconfig.build.json",
@@ -29,6 +30,7 @@
29
30
  "build-docs": "typedoc ./src/browser.ts ./src/node.ts",
30
31
  "toc": "markdown-toc --maxdepth 3 -i README.md",
31
32
  "start": "vite --mode=staging",
33
+ "start:ls": "vite --config vite-ls.config.js example-ls",
32
34
  "start:star": "VITE_DEBUG=\"*\" vite",
33
35
  "start:vite-production": "NODE_EN\"production\" vite",
34
36
  "start:bar-production": "NODE_ENV=\"production\" VITE_DEBUG=\"barrr\" vite",
@@ -46,7 +48,8 @@
46
48
  "supports-color": "^10.0.0"
47
49
  },
48
50
  "devDependencies": {
49
- "@bicycle-codes/tapzero": "^0.10.0",
51
+ "@substrate-system/tapzero": "^0.10.15",
52
+ "@substrate-system/tapout": "^0.0.16",
50
53
  "@types/node": "^22.0.0",
51
54
  "@typescript-eslint/eslint-plugin": "^8.0.0",
52
55
  "@typescript-eslint/parser": "^8.0.0",
@@ -59,7 +62,7 @@
59
62
  "tape-run": "^11.0.0",
60
63
  "typedoc": "^0.28.1",
61
64
  "typescript": "^5.4.5",
62
- "vite": "^6.0.0"
65
+ "vite": "^7.0.1"
63
66
  },
64
67
  "author": "nichoth <nichoth@gmail.com> (https://nichoth.com)",
65
68
  "license": "SEE LICENSE IN LICENSE",