Skip to content

Commit

Permalink
prep for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
evannagle committed Mar 27, 2024
1 parent 7f5cb58 commit 2647f8b
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 4 deletions.
Empty file removed .env-example
Empty file.
105 changes: 105 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @link https://makefiletutorial.com/


BIN_FOR_APP = dist/app.js
BIN_FOR_APP = dist/index.js
BIN_FOR_NODE = node
BIN_FOR_MADGE = madge
BIN_FOR_NPM = npm
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "tabnab",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"version": "1.0.0",
"description": "",
"prepublish": "npm run build",
"scripts": {
"build": "make build",
"clean": "make clean",
Expand Down
2 changes: 1 addition & 1 deletion scripts/esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ esbuild.build({
},
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'dist/app.js',
outfile: 'dist/index.js',
target: 'es2020',
external: [
...builtins
Expand Down
4 changes: 2 additions & 2 deletions src/chrome-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { runAppleScript } from "spawn-applescript";
*/
async function renderApplescript(
relpath: string,
model: { [key: string]: string },
model: { [key: string]: string }
) {
const templatePath = path.join(__dirname, relpath);
const template = fs.readFileSync(templatePath, "utf8");
Expand Down Expand Up @@ -54,7 +54,7 @@ export class ChromeTab {
async getHtmlSource(): Promise<string> {
if (!this._source) {
this._source = await renderApplescript("chrome-tab-source.scpt", {
target_url: this.url,
target_url: this.url.toString(),
});
}

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"isolatedModules": true,
"strictNullChecks": true,
"skipLibCheck": true,
"declaration": true,
"lib": ["DOM", "ES5", "ES6", "ES7", "ESNext"]
},
"include": ["src/**/*.ts", "tests/**/*.ts", "docs/**/*"]
Expand Down

0 comments on commit 2647f8b

Please sign in to comment.