@powerlines/plugin-automd 0.1.221 → 0.1.223
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/dist/_virtual/rolldown_runtime.cjs +0 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +7 -7
- package/dist/types/plugin.d.mts +3 -3
- package/package.json +4 -4
- package/dist/_virtual/rolldown_runtime.mjs +0 -32
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -78
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -77
- package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.cjs +0 -5032
- package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs +0 -5031
- package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.cjs +0 -593
- package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.mjs +0 -590
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +0 -23
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +0 -22
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +0 -405
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +0 -404
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -45
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +0 -204
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +0 -202
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1007
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +0 -128
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +0 -123
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs +0 -41464
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +0 -41461
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +0 -4387
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +0 -4384
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +0 -26
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +0 -26
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +0 -370
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +0 -367
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -939
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -939
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +0 -67
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +0 -64
- package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.cjs +0 -1292
- package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +0 -1284
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -179
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -179
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -20
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -18
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3975
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3961
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +0 -16
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -14
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +0 -36
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +0 -33
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs +0 -227
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +0 -225
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -139
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -133
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -77
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -76
- package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs +0 -72
- package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +0 -69
- package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs +0 -181
- package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs +0 -178
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +0 -12337
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +0 -12337
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +0 -19
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +0 -18
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +0 -71
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +0 -71
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +0 -110
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +0 -100
- /package/dist/{packages/powerlines → powerlines}/src/internal/helpers/hooks.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/api.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/babel.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/build.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/commands.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/config.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/context.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/fs.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/hooks.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/plugin.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/resolved.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/tsconfig.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/unplugin.d.mts +0 -0
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
8
|
var __copyProps = (to, from, except, desc) => {
|
|
10
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
10
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -27,5 +26,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
26
|
|
|
28
27
|
//#endregion
|
|
29
28
|
|
|
30
|
-
exports.__commonJSMin = __commonJSMin;
|
|
31
29
|
exports.__toESM = __toESM;
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const require_automd_CjwUz8DJ = require('./node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.cjs');
|
|
4
3
|
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
5
4
|
let __stryke_fs_is_file = require("@stryke/fs/is-file");
|
|
6
5
|
let __stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
@@ -8,9 +7,10 @@ let __stryke_path_append = require("@stryke/path/append");
|
|
|
8
7
|
let __stryke_path_is_type = require("@stryke/path/is-type");
|
|
9
8
|
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
10
9
|
let __stryke_path_replace = require("@stryke/path/replace");
|
|
10
|
+
let automd = require("automd");
|
|
11
|
+
let c12 = require("c12");
|
|
11
12
|
let defu = require("defu");
|
|
12
13
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
13
|
-
let c12 = require("c12");
|
|
14
14
|
let markdown_toc = require("markdown-toc");
|
|
15
15
|
markdown_toc = require_rolldown_runtime.__toESM(markdown_toc);
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ const plugin = (options = {}) => {
|
|
|
30
30
|
return {
|
|
31
31
|
name: "automd",
|
|
32
32
|
async config() {
|
|
33
|
-
const config = await
|
|
33
|
+
const config = await (0, automd.loadConfig)((0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.projectRoot), options);
|
|
34
34
|
if (!config.prefix || !Array.isArray(config.prefix)) config.prefix = (0, __stryke_convert_to_array.toArray)(config.prefix ?? []);
|
|
35
35
|
if (!config.prefix.includes("automd")) config.prefix.push("automd");
|
|
36
36
|
if (!config.prefix.includes("powerlines")) config.prefix.push("powerlines");
|
|
@@ -61,7 +61,7 @@ const plugin = (options = {}) => {
|
|
|
61
61
|
dir: this.config.automd.dir
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
this.config.automd =
|
|
64
|
+
this.config.automd = (0, automd.resolveConfig)((0, defu.default)(this.config.automd, {
|
|
65
65
|
...config,
|
|
66
66
|
prefix: (0, __stryke_convert_to_array.toArray)(config.prefix ?? [])
|
|
67
67
|
}));
|
|
@@ -88,7 +88,7 @@ const plugin = (options = {}) => {
|
|
|
88
88
|
await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.automd.input).map(async (input) => {
|
|
89
89
|
const contents = await this.fs.read(input);
|
|
90
90
|
if (contents) {
|
|
91
|
-
const result = await
|
|
91
|
+
const result = await (0, automd.transform)(contents, this.config.automd);
|
|
92
92
|
if (result.hasIssues && this.config.automd.allowIssues === false) throw new Error(`AutoMD found issues in file "${input}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);
|
|
93
93
|
if (result.hasChanged) await this.fs.write((0, __stryke_path_append.appendPath)(this.config.automd.output ? (0, __stryke_fs_is_file.isDirectory)(this.config.automd.output) ? (0, __stryke_path_replace.replacePath)(input, this.config.automd.output) : this.config.automd.output : input, this.config.projectRoot), result.contents);
|
|
94
94
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
2
|
import { TOCOptions, __ΩTOCOptions } from "./types/toc.mjs";
|
|
3
3
|
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./types/plugin.mjs";
|
|
4
4
|
import "./types/index.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { loadConfig as loadConfig$1, resolveConfig, transform } from "./node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.mjs";
|
|
2
1
|
import { toArray } from "@stryke/convert/to-array";
|
|
3
2
|
import { isDirectory } from "@stryke/fs/is-file";
|
|
4
3
|
import { listFiles } from "@stryke/fs/list-files";
|
|
@@ -6,8 +5,9 @@ import { appendPath } from "@stryke/path/append";
|
|
|
6
5
|
import { isAbsolutePath } from "@stryke/path/is-type";
|
|
7
6
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
8
7
|
import { replacePath } from "@stryke/path/replace";
|
|
9
|
-
import
|
|
10
|
-
import { loadConfig } from "c12";
|
|
8
|
+
import { loadConfig, resolveConfig, transform } from "automd";
|
|
9
|
+
import { loadConfig as loadConfig$1 } from "c12";
|
|
10
|
+
import defu from "defu";
|
|
11
11
|
import toc from "markdown-toc";
|
|
12
12
|
|
|
13
13
|
//#region src/index.ts
|
|
@@ -26,11 +26,11 @@ const plugin = (options = {}) => {
|
|
|
26
26
|
return {
|
|
27
27
|
name: "automd",
|
|
28
28
|
async config() {
|
|
29
|
-
const config = await loadConfig
|
|
29
|
+
const config = await loadConfig(joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot), options);
|
|
30
30
|
if (!config.prefix || !Array.isArray(config.prefix)) config.prefix = toArray(config.prefix ?? []);
|
|
31
31
|
if (!config.prefix.includes("automd")) config.prefix.push("automd");
|
|
32
32
|
if (!config.prefix.includes("powerlines")) config.prefix.push("powerlines");
|
|
33
|
-
return { automd: defu
|
|
33
|
+
return { automd: defu(config ?? {}, {
|
|
34
34
|
configFile: options.configFile,
|
|
35
35
|
allowIssues: true,
|
|
36
36
|
dir: this.config.projectRoot,
|
|
@@ -45,7 +45,7 @@ const plugin = (options = {}) => {
|
|
|
45
45
|
async configResolved() {
|
|
46
46
|
if (this.config.framework && !toArray(this.config.automd.prefix).includes(this.config.framework)) this.config.automd.prefix = toArray(this.config.automd.prefix).concat(this.config.framework);
|
|
47
47
|
if (this.config.automd.configFile) {
|
|
48
|
-
const { config } = await loadConfig({
|
|
48
|
+
const { config } = await loadConfig$1({
|
|
49
49
|
cwd: this.config.automd.dir,
|
|
50
50
|
configFile: this.config.automd.configFile,
|
|
51
51
|
defaults: {
|
|
@@ -57,7 +57,7 @@ const plugin = (options = {}) => {
|
|
|
57
57
|
dir: this.config.automd.dir
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
this.config.automd = resolveConfig(defu
|
|
60
|
+
this.config.automd = resolveConfig(defu(this.config.automd, {
|
|
61
61
|
...config,
|
|
62
62
|
prefix: toArray(config.prefix ?? [])
|
|
63
63
|
}));
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UserConfig } from "../
|
|
2
|
-
import { ResolvedConfig } from "../
|
|
3
|
-
import { PluginContext } from "../
|
|
1
|
+
import { UserConfig } from "../powerlines/src/types/config.mjs";
|
|
2
|
+
import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
3
|
+
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
4
4
|
import { TOCOptions } from "./toc.mjs";
|
|
5
5
|
import { Config } from "automd";
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-automd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.223",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to maintain a project's markdown files using AutoMD generators.",
|
|
6
6
|
"repository": {
|
|
@@ -125,13 +125,13 @@
|
|
|
125
125
|
"c12": "^3.3.3",
|
|
126
126
|
"defu": "^6.1.4",
|
|
127
127
|
"markdown-toc": "^1.2.0",
|
|
128
|
-
"powerlines": "^0.37.
|
|
128
|
+
"powerlines": "^0.37.95"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
131
|
+
"@powerlines/plugin-plugin": "^0.12.174",
|
|
132
132
|
"@types/node": "^24.10.9",
|
|
133
133
|
"automd": "^0.4.2"
|
|
134
134
|
},
|
|
135
135
|
"publishConfig": { "access": "public" },
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
|
|
137
137
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
-
key = keys[i];
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
16
|
-
__defProp(to, key, {
|
|
17
|
-
get: ((k) => from[k]).bind(null, key),
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
-
value: mod,
|
|
27
|
-
enumerable: true
|
|
28
|
-
}) : target, mod));
|
|
29
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { __commonJSMin, __require, __toESM };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
3
|
-
var comma = ",".charCodeAt(0);
|
|
4
|
-
var semicolon = ";".charCodeAt(0);
|
|
5
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
|
-
var intToChar = new Uint8Array(64);
|
|
7
|
-
var charToInt = new Uint8Array(128);
|
|
8
|
-
for (let i = 0; i < chars.length; i++) {
|
|
9
|
-
const c = chars.charCodeAt(i);
|
|
10
|
-
intToChar[i] = c;
|
|
11
|
-
charToInt[c] = i;
|
|
12
|
-
}
|
|
13
|
-
function encodeInteger(builder, num, relative) {
|
|
14
|
-
let delta = num - relative;
|
|
15
|
-
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
16
|
-
do {
|
|
17
|
-
let clamped = delta & 31;
|
|
18
|
-
delta >>>= 5;
|
|
19
|
-
if (delta > 0) clamped |= 32;
|
|
20
|
-
builder.write(intToChar[clamped]);
|
|
21
|
-
} while (delta > 0);
|
|
22
|
-
return num;
|
|
23
|
-
}
|
|
24
|
-
var bufLength = 1024 * 16;
|
|
25
|
-
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
|
|
26
|
-
return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
|
|
27
|
-
} } : { decode(buf) {
|
|
28
|
-
let out = "";
|
|
29
|
-
for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
|
|
30
|
-
return out;
|
|
31
|
-
} };
|
|
32
|
-
var StringWriter = class {
|
|
33
|
-
constructor() {
|
|
34
|
-
this.pos = 0;
|
|
35
|
-
this.out = "";
|
|
36
|
-
this.buffer = new Uint8Array(bufLength);
|
|
37
|
-
}
|
|
38
|
-
write(v) {
|
|
39
|
-
const { buffer } = this;
|
|
40
|
-
buffer[this.pos++] = v;
|
|
41
|
-
if (this.pos === bufLength) {
|
|
42
|
-
this.out += td.decode(buffer);
|
|
43
|
-
this.pos = 0;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
flush() {
|
|
47
|
-
const { buffer, out, pos } = this;
|
|
48
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
function encode(decoded) {
|
|
52
|
-
const writer = new StringWriter();
|
|
53
|
-
let sourcesIndex = 0;
|
|
54
|
-
let sourceLine = 0;
|
|
55
|
-
let sourceColumn = 0;
|
|
56
|
-
let namesIndex = 0;
|
|
57
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
58
|
-
const line = decoded[i];
|
|
59
|
-
if (i > 0) writer.write(semicolon);
|
|
60
|
-
if (line.length === 0) continue;
|
|
61
|
-
let genColumn = 0;
|
|
62
|
-
for (let j = 0; j < line.length; j++) {
|
|
63
|
-
const segment = line[j];
|
|
64
|
-
if (j > 0) writer.write(comma);
|
|
65
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
66
|
-
if (segment.length === 1) continue;
|
|
67
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
68
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
69
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
70
|
-
if (segment.length === 4) continue;
|
|
71
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return writer.flush();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
|
-
exports.encode = encode;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
2
|
-
var comma = ",".charCodeAt(0);
|
|
3
|
-
var semicolon = ";".charCodeAt(0);
|
|
4
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5
|
-
var intToChar = new Uint8Array(64);
|
|
6
|
-
var charToInt = new Uint8Array(128);
|
|
7
|
-
for (let i = 0; i < chars.length; i++) {
|
|
8
|
-
const c = chars.charCodeAt(i);
|
|
9
|
-
intToChar[i] = c;
|
|
10
|
-
charToInt[c] = i;
|
|
11
|
-
}
|
|
12
|
-
function encodeInteger(builder, num, relative) {
|
|
13
|
-
let delta = num - relative;
|
|
14
|
-
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
15
|
-
do {
|
|
16
|
-
let clamped = delta & 31;
|
|
17
|
-
delta >>>= 5;
|
|
18
|
-
if (delta > 0) clamped |= 32;
|
|
19
|
-
builder.write(intToChar[clamped]);
|
|
20
|
-
} while (delta > 0);
|
|
21
|
-
return num;
|
|
22
|
-
}
|
|
23
|
-
var bufLength = 1024 * 16;
|
|
24
|
-
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
|
|
25
|
-
return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
|
|
26
|
-
} } : { decode(buf) {
|
|
27
|
-
let out = "";
|
|
28
|
-
for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
|
|
29
|
-
return out;
|
|
30
|
-
} };
|
|
31
|
-
var StringWriter = class {
|
|
32
|
-
constructor() {
|
|
33
|
-
this.pos = 0;
|
|
34
|
-
this.out = "";
|
|
35
|
-
this.buffer = new Uint8Array(bufLength);
|
|
36
|
-
}
|
|
37
|
-
write(v) {
|
|
38
|
-
const { buffer } = this;
|
|
39
|
-
buffer[this.pos++] = v;
|
|
40
|
-
if (this.pos === bufLength) {
|
|
41
|
-
this.out += td.decode(buffer);
|
|
42
|
-
this.pos = 0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
flush() {
|
|
46
|
-
const { buffer, out, pos } = this;
|
|
47
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
function encode(decoded) {
|
|
51
|
-
const writer = new StringWriter();
|
|
52
|
-
let sourcesIndex = 0;
|
|
53
|
-
let sourceLine = 0;
|
|
54
|
-
let sourceColumn = 0;
|
|
55
|
-
let namesIndex = 0;
|
|
56
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
57
|
-
const line = decoded[i];
|
|
58
|
-
if (i > 0) writer.write(semicolon);
|
|
59
|
-
if (line.length === 0) continue;
|
|
60
|
-
let genColumn = 0;
|
|
61
|
-
for (let j = 0; j < line.length; j++) {
|
|
62
|
-
const segment = line[j];
|
|
63
|
-
if (j > 0) writer.write(comma);
|
|
64
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
65
|
-
if (segment.length === 1) continue;
|
|
66
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
67
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
68
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
69
|
-
if (segment.length === 4) continue;
|
|
70
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return writer.flush();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
|
-
export { encode };
|