Skip to content

Commit 5fb07a3

Browse files
committed
Release 4.9.8
1 parent 44f5bdf commit 5fb07a3

17 files changed

Lines changed: 44 additions & 42 deletions

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"name": "cogs",
3-
"version": "4.9.7",
3+
"version": "4.9.8",
44
"type": "module",
55
"author": "Casey Foster <c@sey.me>",
66
"description": "The fast file transform pipeline.",
77
"license": "MIT",
88
"main": "src/index.js",
99
"module": "src/index.js",
10+
"imports": {
11+
"#*": "./*"
12+
},
1013
"sideEffects": [
1114
"src/cli.js"
1215
],
@@ -21,7 +24,7 @@
2124
"watchy": "0.12"
2225
},
2326
"devDependencies": {
24-
"eslint": "10",
27+
"eslint": "9",
2528
"eslint-config-coderiety": "2",
2629
"kiss-test": "0.2"
2730
}

src/apply-transformers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import filterTransformers from './filter-transformers.js';
2-
import pruneDependencies from './prune-dependencies.js';
1+
import filterTransformers from '#src/filter-transformers.js';
2+
import pruneDependencies from '#src/prune-dependencies.js';
33

44
export default async ({ file, transformers }) => {
55
const applicable = filterTransformers({ transformers, path: file.path });

src/build-config.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import fs from 'node:fs/promises';
2-
import npath from 'node:path';
2+
import { join, relative } from 'node:path';
33

4-
import getBuilds from './get-builds.js';
5-
import maybeWrite from './maybe-write.js';
6-
import setExt from './set-ext.js';
7-
import sortObj from './sort-obj.js';
8-
import writeBuffer from './write-buffer.js';
4+
import getBuilds from '#src/get-builds.js';
5+
import { getExt } from '#src/get-ext.js';
6+
import maybeWrite from '#src/maybe-write.js';
7+
import setExt from '#src/set-ext.js';
8+
import sortObj from '#src/sort-obj.js';
9+
import writeBuffer from '#src/write-buffer.js';
910

1011
const { Buffer } = globalThis;
1112

@@ -36,7 +37,7 @@ const saveBuild = async ({
3637
buffers.map(async (buffer, i) => {
3738
const size = buffer.length;
3839
const sourcePath =
39-
i === 0 ? path : setExt(path, `~${i + 1}${npath.extname(path)}`);
40+
i === 0 ? path : setExt(path, `~${i + 1}${getExt(path)}`);
4041
try {
4142
const { didChange, targetPath } = await writeBuffer({
4243
buffer,
@@ -56,9 +57,7 @@ const getPaths = async pattern => {
5657
const paths = [];
5758
for await (const dirent of fs.glob(pattern, { withFileTypes: true })) {
5859
if (!dirent.isDirectory()) {
59-
paths.push(
60-
npath.relative('.', npath.join(dirent.parentPath, dirent.name))
61-
);
60+
paths.push(relative('.', join(dirent.parentPath, dirent.name)));
6261
}
6362
}
6463
return paths.sort();

src/bust-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fileHasDependency from './file-has-dependency.js';
1+
import fileHasDependency from '#src/file-has-dependency.js';
22

33
export default ({ config, path }) =>
44
Promise.all(

src/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { readFile } from 'node:fs/promises';
44
import { dirname } from 'node:path';
55
import { parseArgs, styleText } from 'node:util';
66

7-
import formatSize from './format-size.js';
8-
import run from './run.js';
7+
import formatSize from '#src/format-size.js';
8+
import run from '#src/run.js';
99

1010
const { console, process, URL } = globalThis;
1111

src/filter-transformers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import npath from 'node:path';
22

3-
import toArray from './to-array.js';
3+
import toArray from '#src/to-array.js';
44

55
const doesMatch = ({ transformer, path }) => {
66
const only = toArray(transformer.only);

src/get-builds.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import applyTransformers from './apply-transformers.js';
2-
import walk from './walk.js';
1+
import applyTransformers from '#src/apply-transformers.js';
2+
import walk from '#src/walk.js';
33

44
const { Buffer } = globalThis;
55

src/get-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import npath from 'path';
22

3-
import normalizeConfig from './normalize-config.js';
3+
import normalizeConfig from '#src/normalize-config.js';
44

55
export default async configPath => {
66
try {

src/get-ext.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/** @param {string} path */
2+
export const getExt = path => path.match(/\.[^/\\]*$/)?.[0] ?? '';

src/get-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { promises as fs } from 'fs';
22

3-
import applyTransformers from './apply-transformers.js';
3+
import applyTransformers from '#src/apply-transformers.js';
44

55
const getOrSet = async (cache, key, fn) => {
66
try {

0 commit comments

Comments
 (0)