-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
248d9b9
commit 49b1c6a
Showing
12 changed files
with
385 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'randsamp': patch | ||
--- | ||
|
||
Initial release |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@aacc/babel-preset", | ||
{ | ||
"typescript": true | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @type {import('eslint').Linter.Config} | ||
*/ | ||
module.exports = { | ||
root: true, | ||
extends: ['@aacc/eslint-config/typescript'], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: 'tsconfig.eslint.json', | ||
}, | ||
ignorePatterns: ['node_modules', 'dist', 'bin'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# randsamp | ||
|
||
Randomizes samples from a target directory and hard links them to another | ||
|
||
## Usage | ||
|
||
```sh | ||
npx randsamp \ | ||
--target ./path/to/target-directory \ | ||
--output ./path/to/output-directory | ||
``` | ||
|
||
## Options | ||
|
||
| Option | Description | Default | | ||
| -------------- | ---------------------------------------------------------- | -------- | | ||
| `-t, --target` | The target directory to collect and randomize samples | Required | | ||
| `-o, --output` | The output directory to hard link the randomized samples | Required | | ||
| `--ext` | Comma separated list of extension types to filter | `.wav` | | ||
| `--count` | The number of samples to hard link in the output directory | `128` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env node | ||
|
||
import * as util from 'node:util' | ||
|
||
import { randsamp as _randsamp } from '../dist/esm/index.mjs' | ||
|
||
const randsamp = | ||
/** @type {typeof import('../dist/types/index.js').randsamp} */ (_randsamp) | ||
|
||
const cli = util.parseArgs({ | ||
options: { | ||
target: { type: 'string', short: 't' }, | ||
output: { type: 'string', short: 'o' }, | ||
ext: { type: 'string' }, | ||
count: { type: 'string' }, | ||
}, | ||
}) | ||
|
||
const { target: targetDir, output: outputDir, ext, count } = cli.values | ||
|
||
if (!targetDir) { | ||
throw new Error('targetDir is required') | ||
} | ||
|
||
if (!outputDir) { | ||
throw new Error('outputDir is required') | ||
} | ||
|
||
await randsamp({ | ||
targetDir, | ||
outputDir, | ||
sampleExtensions: ext ? ext.split(',') : undefined, | ||
sampleCount: count ? Number(count) : undefined, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "randsamp", | ||
"version": "0.0.0", | ||
"description": "Randomizes samples from a target directory and hard links them to another", | ||
"author": "Aaron Casanova <aaronccasanova@gmail.com>", | ||
"license": "MIT", | ||
"bin": "bin/index.mjs", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.mjs", | ||
"types": "dist/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/types/index.d.ts", | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=16.18.0" | ||
}, | ||
"scripts": { | ||
"start": "npm run build && node bin/index.mjs", | ||
"dev": "npm-run-all --parallel 'build:* -- --watch'", | ||
"build": "npm-run-all --parallel build:*", | ||
"build:js": "rollup -c", | ||
"build:types": "tsc --emitDeclarationOnly", | ||
"type-check": "tsc --noEmit", | ||
"type-check:watch": "npm run type-check -- --watch", | ||
"lint": "TIMING=1 eslint . --ext .js,.ts --cache", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"files": [ | ||
"bin", | ||
"dist" | ||
], | ||
"dependencies": { | ||
"globby": "^11.1.0" | ||
}, | ||
"devDependencies": { | ||
"@aacc/babel-preset": "*", | ||
"@aacc/browserslist-config": "*", | ||
"@aacc/eslint-config": "*", | ||
"@aacc/tsconfigs": "*", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@rollup/plugin-commonjs": "^21.1.0", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"@types/node": "^18.11.16", | ||
"rollup": "^2.70.2", | ||
"typescript": "^4.7.3" | ||
}, | ||
"browserslist": [ | ||
"extends @aacc/browserslist-config" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"@aacc:registry": "https://registry.npmjs.org" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/aaronccasanova/aacc.git", | ||
"directory": "packages/randsamp" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/aaronccasanova/aacc/issues" | ||
}, | ||
"homepage": "https://github.com/aaronccasanova/aacc/blob/main/packages/randsamp/README.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import path from 'path' | ||
|
||
import nodeResolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import babel from '@rollup/plugin-babel' | ||
|
||
import pkg from './package.json' | ||
|
||
const extensions = ['.js', '.jsx', '.ts', '.tsx'] | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
format: /** @type {const} */ ('cjs'), | ||
entryFileNames: '[name][assetExtname].js', | ||
dir: path.dirname(pkg.main), | ||
preserveModules: true, | ||
}, | ||
{ | ||
format: /** @type {const} */ ('es'), | ||
entryFileNames: '[name][assetExtname].mjs', | ||
dir: path.dirname(pkg.module), | ||
preserveModules: true, | ||
}, | ||
], | ||
plugins: [ | ||
// Allows node_modules resolution | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
nodeResolve({ extensions }), | ||
// Allow bundling cjs modules. Rollup doesn't understand cjs | ||
commonjs(), | ||
// Compile TypeScript/JavaScript files | ||
babel({ | ||
extensions, | ||
babelHelpers: 'bundled', | ||
include: ['src/**/*'], | ||
}), | ||
], | ||
external: [ | ||
...Object.keys(pkg.dependencies ?? {}), | ||
// @ts-expect-error | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
...Object.keys(pkg.peerDependencies ?? {}), | ||
], | ||
} |
Oops, something went wrong.
49b1c6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
aacc-next-ts – ./recipes/next-ts
aacc-next-ts-aaronccasanova-gmailcom.vercel.app
aacc-next-ts.vercel.app
aacc-next-ts-git-main-aaronccasanova-gmailcom.vercel.app
49b1c6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
aacc-next-ts-styled-comps – ./recipes/next-ts-styled-comps
aacc-next-ts-styled-comps-git-main-aaronccasanova-gmailcom.vercel.app
aacc-next-ts-styled-comps.vercel.app
aacc-next-ts-styled-comps-aaronccasanova-gmailcom.vercel.app
49b1c6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
aacc-scales – ./apps/scales
aacc-scales-git-main-aaronccasanova-gmailcom.vercel.app
aacc-scales-aaronccasanova-gmailcom.vercel.app
aacc-scales.vercel.app