Skip to content

Commit

Permalink
0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Jul 12, 2023
1 parent 5fe22d0 commit 9607dfb
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/get-size/lib/from/AsyncIterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getSizeFromUint8Array from './Uint8Array.js'
import getMergedUint8Array from '../utils/getMergedUint8Array.js'

import '../types.js'
import '../detector.js'
import '../getType.js'

export default async function getSizeFromAsyncIterable(/** @type {Iterable<Uint8Array> | AsyncIterable<Uint8Array>} */ iteratable) {
await import('../utils/ReadableStreamPolyfill.js')
Expand Down
2 changes: 1 addition & 1 deletion packages/get-size/lib/from/FileSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import getSizeFromIterator from './Iterable.js'

import './Uint8Array.js'
import '../types.js'
import '../detector.js'
import '../getType.js'
import '../utils/getMergedUint8Array.js'

export default function getSizeFromFileSync(/** @type {PathLike} */ path, /** @type {GetSizeFromFileSyncOptions} */ opts = null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/get-size/lib/from/Iterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getSizeFromUint8Array from './Uint8Array.js'
import getMergedUint8Array from '../utils/getMergedUint8Array.js'

import '../types.js'
import '../detector.js'
import '../getType.js'

export default function getSizeFromIterator(/** @type {Iterable<Uint8Array>} */ iterable) {
let array = new Uint8Array()
Expand Down
2 changes: 1 addition & 1 deletion packages/get-size/lib/from/ReadableStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getSizeFromAsyncIterable from './AsyncIterable.js'

import './Uint8Array.js'
import '../types.js'
import '../detector.js'
import '../getType.js'
import '../utils/getMergedUint8Array.js'

export default async function getSizeFromReadableStream(/** @type {ReadableStream<Uint8Array>} */ readableStream) {
Expand Down
2 changes: 1 addition & 1 deletion packages/get-size/lib/from/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getSizeFromAsyncIterable from './AsyncIterable.js'

import './Uint8Array.js'
import '../types.js'
import '../detector.js'
import '../getType.js'
import '../utils/getMergedUint8Array.js'

export default async function getSizeFromURL(input) {
Expand Down
16 changes: 8 additions & 8 deletions packages/get-size/lib/getSize.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type { ImageType, ImageResult } from './types.ts'
export type { ImageType, ImageResult } from './types.d.ts'

export { default as getSizeFromAsyncIterable } from './from/AsyncIterable.ts'
export { default as getSizeFromIterable } from './from/Iterable.ts'
export { default as getSizeFromReadableStream } from './from/ReadableStream.ts'
export { default as getSizeFromUint8Array } from './from/Uint8Array.ts'
export { default as getSizeFromURL } from './from/URL.ts'
export { default as getType } from './getType.js'
export { default as getSizeFromAsyncIterable } from './from/AsyncIterable.d.ts'
export { default as getSizeFromIterable } from './from/Iterable.d.ts'
export { default as getSizeFromReadableStream } from './from/ReadableStream.d.ts'
export { default as getSizeFromUint8Array } from './from/Uint8Array.d.ts'
export { default as getSizeFromURL } from './from/URL.d.ts'
export { default as getType } from './getType.d.ts'

export { types } from './types.ts'
export { types } from './types.d.ts'
2 changes: 1 addition & 1 deletion packages/get-size/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@astropub/get-size",
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"main": "./lib/getSize.js",
"types": "./lib/getSize.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions packages/test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@astropub/get-size.test",
"type": "module",
"dependencies": {
"@astropub/get-size": "*"
},
"private": true
}
5 changes: 5 additions & 0 deletions packages/test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { getSizeFromReadableStream } from '@astropub/get-size'

const blob = new Blob([], { type: 'text/css' })

console.log(await getSizeFromReadableStream(blob.stream()))
10 changes: 5 additions & 5 deletions scripts/release.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { execSync, spawnSync } from 'node:child_process'

try {
const pkgs = JSON.parse(execSync('npm pack --workspaces --json').toString())
const pkgs = Object.entries(JSON.parse(execSync('npm pkg get private --workspaces --json').toString()))

for (const pkg of pkgs) {
spawnSync('npm', [ 'publish', pkg.filename, '--access=public', ...process.argv.slice(2) ], {
for (const [ pkgName, pkgPrivate ] of pkgs) {
if (pkgPrivate === true) continue

spawnSync('npm', [ 'publish', '--workspace', JSON.stringify(pkgName), '--access', 'public', ...process.argv.slice(2) ], {
cwd: process.cwd(),
env: process.env,
stdio: 'inherit',
encoding: 'utf-8',
})

execSync(`rm -rf ${pkg.filename}`)
}
} catch (error) {
console.error(error)
Expand Down

0 comments on commit 9607dfb

Please sign in to comment.