Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjlewis committed Nov 17, 2022
1 parent 9dd6db4 commit cefdac4
Show file tree
Hide file tree
Showing 21 changed files with 1,226 additions and 102 deletions.
52 changes: 52 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"extends": [
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {

"no-console": "error",
"no-trailing-spaces": "error",
"max-len": [1, 80, 2, {
"ignorePattern": "^import\\s.+\\sfrom\\s.+;$",
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}],

"@typescript-eslint/type-annotation-spacing": ["error"],

"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-nocheck": "allow-with-description",
"ts-ignore": "allow-with-description"
}
],

"indent": "off",
"@typescript-eslint/indent": ["error", 2],

"semi": "off",
"@typescript-eslint/semi": ["error", "always"],

"quotes": "off",
"@typescript-eslint/quotes": ["error", "double"],

"object-curly-spacing": "off",
"@typescript-eslint/object-curly-spacing": ["error", "always"],

"sort-imports": [
"warn",
{
"ignoreCase": false,
"ignoreDeclarationSort": false,
"ignoreMemberSort": true,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
"allowSeparatedGroups": true
}
]
}
}
17 changes: 17 additions & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default {
timeout: "10m",
files: [
"test/**/*.test.ts"
],
extensions: {
"ts": "module"
},
workerThreads: false,
environmentVariables: {
// "NODE_ENV": "development"
},
nodeArguments: [
"--no-warnings",
"--loader=@tsmodule/tsmodule/loader"
]
};
8 changes: 0 additions & 8 deletions dist/index.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLAttributes } from 'react';
import { HTMLAttributes } from "react";
interface SpotifyProps extends HTMLAttributes<HTMLIFrameElement> {
[key: string]: any;
link: string;
Expand Down
1 change: 1 addition & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions dist/index.mjs

This file was deleted.

3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
17 changes: 0 additions & 17 deletions dist/react-spotify-embed.development.cjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/react-spotify-embed.development.cjs.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/react-spotify-embed.min.mjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/react-spotify-embed.min.mjs.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/react-spotify-embed.production.min.cjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/react-spotify-embed.production.min.cjs.map

This file was deleted.

47 changes: 28 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
{
"version": "0.2.3",
"version": "1.0.1",
"license": "MIT",
"repository": {
"url": "https://github.com/ctjlewis/react-spotify-embed"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"type": "module",
"platform": "node",
"types": "dist/index.d.ts",
"module": "./dist/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
".": "./dist/index.js",
"./*": "./dist/*/index.js"
},
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
"dist"
],
"engines": {
"node": ">=14"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"posttest": "node test/import.mjs && node test/require.cjs",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why"
"dev": "tsmodule dev",
"build": "tsmodule build",
"test": "ava",
"pretest": "tsmodule build",
"prepublishOnly": "yarn test",
"lint": "eslint src --fix"
},
"peerDependencies": {
"react": ">=16"
Expand Down Expand Up @@ -59,15 +56,27 @@
],
"devDependencies": {
"@size-limit/preset-small-lib": "^5.0.2",
"@tsmodule/tsmodule": "^40.10.0",
"@types/node": "^18.11.9",
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"ava": "^5.1.0",
"eslint": "^8.27.0",
"husky": "^7.0.1",
"jest-environment-jsdom": "^27.0.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"size-limit": "^5.0.2",
"tsdx": "ctjlewis/tsdx",
"tslib": "^2.3.0",
"typescript": "^4.3.5"
}
"typescript": "^4.9.3"
},
"keywords": [
"react",
"spotify",
"embed",
"nextjs"
]
}
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLAttributes } from 'react';
import { HTMLAttributes } from "react";

interface SpotifyProps extends HTMLAttributes<HTMLIFrameElement> {
[key: string]: any;
Expand All @@ -15,10 +15,10 @@ const Spotify = ({
link,
style = {},
wide = false,
width = wide ? '100%' : 300,
width = wide ? "100%" : 300,
height = wide ? 80 : 380,
frameBorder = 0,
allow = 'encrypted-media',
allow = "encrypted-media",
...props
}: SpotifyProps) => {
const url = new URL(link);
Expand Down
5 changes: 5 additions & 0 deletions test/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import test from "ava";

test("1 + 1 should equal 2", t => {
t.is(1 + 1, 2);
});
3 changes: 0 additions & 3 deletions test/import.mjs

This file was deleted.

17 changes: 0 additions & 17 deletions test/index.test.tsx

This file was deleted.

1 change: 0 additions & 1 deletion test/require.cjs

This file was deleted.

42 changes: 29 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
{
"include": ["src", "types"],
"include": [
"*env.d.ts",
"src/**/*"
],
"exclude": [
"node_modules",
"test/**"
],
"compilerOptions": {
"strict": true,
"moduleResolution": "node",
"module": "esnext",
"target": "esnext",
"lib": ["dom", "esnext"],
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
"lib": [
"ESNext",
"DOM"
],
"jsx": "preserve",
"rootDir": "src",
"outDir": "dist",
"allowJs": true,
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"declaration": true,
"sourceMap": true,
"checkJs": true,
"noEmit": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"isolatedModules": true,
"incremental": false
}
}
Loading

0 comments on commit cefdac4

Please sign in to comment.