From 1487e5dc1204bf278e535351a9bab201e4b1d02c Mon Sep 17 00:00:00 2001 From: trusasha Date: Tue, 16 Jan 2024 13:06:07 +0100 Subject: [PATCH 01/11] fix: fixed rollup config --- package.json | 10 +++++----- rollup.config.mjs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bb63257..19a6e36 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "@lomray/react-native-apple-music", "version": "1.0.0", "description": "Apple MusicKit for React-Native", - "main": "lib/index", - "module": "lib/index", - "types": "lib/index.d.ts", - "source": "lib/index", + "main": "index", + "module": "index", + "types": "index.d.ts", + "source": "index", "keywords": [ "js", "react-native", @@ -81,7 +81,7 @@ "preset": "react-native", "modulePathIgnorePatterns": [ "/example/node_modules", - "/lib/" + "/" ] } } diff --git a/rollup.config.mjs b/rollup.config.mjs index 60f7f0f..74c6965 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -51,6 +51,7 @@ export default { { src: 'ios/**/*', dest: 'lib/ios' }, { src: 'package.json', dest: 'lib' }, { src: 'README.md', dest: 'lib' }, + { src: 'RNAppleMusic.podspec', dest: 'lib/ios'}, ] }) ], From 953e319b6918b094ee25d9c39c836a30825c46db Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 11:30:13 +0100 Subject: [PATCH 02/11] fix: fixed tsconfig --- example/package.json | 1 - example/tsconfig.json | 78 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 example/tsconfig.json diff --git a/example/package.json b/example/package.json index 0cacab7..f718967 100644 --- a/example/package.json +++ b/example/package.json @@ -10,7 +10,6 @@ "build:ios": "cd ios && xcodebuild -workspace AppleMusicExample.xcworkspace -scheme AppleMusicExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO" }, "dependencies": { - "@lomray/react-native-apple-music": "file:../", "react": "18.2.0", "react-native": "0.73.1" }, diff --git a/example/tsconfig.json b/example/tsconfig.json new file mode 100644 index 0000000..6122725 --- /dev/null +++ b/example/tsconfig.json @@ -0,0 +1,78 @@ + +{ + "compilerOptions": { + /* Basic Options */ + "target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "lib": [ + "es6", + "es2015", + "es2017", + "es2019", + "dom", + "webworker" + ], /* Specify library files to be included in the compilation. */ + "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + "jsx": "react-native", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + "noEmit": true, /* Do not emit outputs. */ + // "incremental": true, /* Enable incremental compilation */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": false, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + + /* Source Map Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + "resolveJsonModule": true, + "baseUrl": "./", + "rootDirs": [ + "./src" + ], + "paths": { + "@lomray/react-native-apple-music": [ + "../src/index" + ] + } + }, + "include": ["src", "__tests__", "__mocks__", "__helpers__", "*.js", ".*.js", "scripts/**/*"], + "exclude": ["node_modules"] +} From 9d23d50a91101f9ce68571df7b221825b7c9250a Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 11:45:57 +0100 Subject: [PATCH 03/11] fix: fixed package.json --- package-lock.json | 5 ----- package.json | 8 ++++---- src/{index.tsx => index.ts} | 0 3 files changed, 4 insertions(+), 9 deletions(-) rename src/{index.tsx => index.ts} (100%) diff --git a/package-lock.json b/package-lock.json index c3645cf..bb6c24e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,6 @@ "name": "react-native-apple-music-example", "version": "1.0.0", "dependencies": { - "@lomray/react-native-apple-music": "file:../", "react": "18.2.0", "react-native": "0.73.1" }, @@ -4785,10 +4784,6 @@ "integrity": "sha512-1cdM6LNpxdd2+rWGoxXO6rv3R/MtVC5/4zyMstlnmHBQz4DK5ujUlrvgnwZSMgm6Goa0KXYNmezR9GiJxCONaQ==", "dev": true }, - "node_modules/@lomray/react-native-apple-music": { - "resolved": "", - "link": true - }, "node_modules/@mdn/browser-compat-data": { "version": "5.5.4", "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.5.4.tgz", diff --git a/package.json b/package.json index 19a6e36..3fcdad1 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "@lomray/react-native-apple-music", "version": "1.0.0", "description": "Apple MusicKit for React-Native", - "main": "index", - "module": "index", - "types": "index.d.ts", - "source": "index", + "main": "lib/index", + "module": "lib/index", + "types": "lib/index.d.ts", + "source": "lib/index", "keywords": [ "js", "react-native", diff --git a/src/index.tsx b/src/index.ts similarity index 100% rename from src/index.tsx rename to src/index.ts From 924726b700a132f945c7ac659a67a9fe9f2ea7d5 Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 11:49:01 +0100 Subject: [PATCH 04/11] fix: fixed package.json --- example/package.json | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/example/package.json b/example/package.json index f718967..0cacab7 100644 --- a/example/package.json +++ b/example/package.json @@ -10,6 +10,7 @@ "build:ios": "cd ios && xcodebuild -workspace AppleMusicExample.xcworkspace -scheme AppleMusicExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO" }, "dependencies": { + "@lomray/react-native-apple-music": "file:../", "react": "18.2.0", "react-native": "0.73.1" }, diff --git a/package.json b/package.json index 3fcdad1..bb63257 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "preset": "react-native", "modulePathIgnorePatterns": [ "/example/node_modules", - "/" + "/lib/" ] } } From 09cfd42f86b926c981ba18e9c3d228a0420588ed Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 11:51:46 +0100 Subject: [PATCH 05/11] fix: fixed package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bb63257..13ad3ac 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "@lomray/react-native-apple-music", "version": "1.0.0", "description": "Apple MusicKit for React-Native", - "main": "lib/index", - "module": "lib/index", - "types": "lib/index.d.ts", - "source": "lib/index", + "main": "src/index", + "module": "src/index", + "types": "src/index", + "source": "src/index", "keywords": [ "js", "react-native", From 866e3acc67bf0e7c99bbaeaef35bf91fb3ed6f1a Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 12:06:16 +0100 Subject: [PATCH 06/11] fix: fixed rollup config --- rollup.config.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 74c6965..c80ba16 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -10,11 +10,10 @@ export default { 'src/**/*.ts*', ], output: { - dir: 'lib', + dir: 'lib/src', format: 'es', sourcemap: true, preserveModules: true, - preserveModulesRoot: 'src', exports: 'auto', }, external: [ From a95838d5334b5ec39fe158672bb627664c4ddce9 Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 12:08:04 +0100 Subject: [PATCH 07/11] fix: fixed tsconfig --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13ad3ac..fcf2609 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Apple MusicKit for React-Native", "main": "src/index", "module": "src/index", - "types": "src/index", + "types": "src/index.d.ts", "source": "src/index", "keywords": [ "js", From c6ab32b2d233c9dee689eead5161545c7197128c Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 12:08:43 +0100 Subject: [PATCH 08/11] fix: fixed rollup config --- rollup.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/rollup.config.mjs b/rollup.config.mjs index c80ba16..48b32cb 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -14,6 +14,7 @@ export default { format: 'es', sourcemap: true, preserveModules: true, + preserveModulesRoot: 'src', exports: 'auto', }, external: [ From eb319fb8ebd356316a15ab57e860602aee261fb4 Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 13:13:03 +0100 Subject: [PATCH 09/11] fix: fixed rollup config --- example/package.json | 2 +- example/tsconfig.json | 7 +------ package-lock.json | 10 ++++++++++ package.json | 6 ++---- rollup.config.mjs | 15 ++------------- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/example/package.json b/example/package.json index 0cacab7..8ce7378 100644 --- a/example/package.json +++ b/example/package.json @@ -10,7 +10,7 @@ "build:ios": "cd ios && xcodebuild -workspace AppleMusicExample.xcworkspace -scheme AppleMusicExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO" }, "dependencies": { - "@lomray/react-native-apple-music": "file:../", + "@lomray/react-native-apple-music": "^1.0.3", "react": "18.2.0", "react-native": "0.73.1" }, diff --git a/example/tsconfig.json b/example/tsconfig.json index 6122725..a09456d 100644 --- a/example/tsconfig.json +++ b/example/tsconfig.json @@ -66,12 +66,7 @@ "baseUrl": "./", "rootDirs": [ "./src" - ], - "paths": { - "@lomray/react-native-apple-music": [ - "../src/index" - ] - } + ] }, "include": ["src", "__tests__", "__mocks__", "__helpers__", "*.js", ".*.js", "scripts/**/*"], "exclude": ["node_modules"] diff --git a/package-lock.json b/package-lock.json index bb6c24e..e6fa6ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "name": "react-native-apple-music-example", "version": "1.0.0", "dependencies": { + "@lomray/react-native-apple-music": "^1.0.3", "react": "18.2.0", "react-native": "0.73.1" }, @@ -4784,6 +4785,15 @@ "integrity": "sha512-1cdM6LNpxdd2+rWGoxXO6rv3R/MtVC5/4zyMstlnmHBQz4DK5ujUlrvgnwZSMgm6Goa0KXYNmezR9GiJxCONaQ==", "dev": true }, + "node_modules/@lomray/react-native-apple-music": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@lomray/react-native-apple-music/-/react-native-apple-music-1.0.3.tgz", + "integrity": "sha512-xoJOon1XgOsNm9jQKT3o12HSiWv2NzQH0hP8Q+QE2gKZmxyG4hgmbN81rsS/4VIpYPHC9+I9G9Dr2cAyfmxFgQ==", + "peerDependencies": { + "react": "*", + "react-native": ">=0.61" + } + }, "node_modules/@mdn/browser-compat-data": { "version": "5.5.4", "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.5.4.tgz", diff --git a/package.json b/package.json index fcf2609..3dbaf87 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,8 @@ "name": "@lomray/react-native-apple-music", "version": "1.0.0", "description": "Apple MusicKit for React-Native", - "main": "src/index", - "module": "src/index", - "types": "src/index.d.ts", - "source": "src/index", + "main": "index.js", + "type": "module", "keywords": [ "js", "react-native", diff --git a/rollup.config.mjs b/rollup.config.mjs index 48b32cb..1568c29 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,8 +1,6 @@ import typescript from 'rollup-plugin-ts'; import json from '@rollup/plugin-json'; -import peerDepsExternal from 'rollup-plugin-peer-deps-external'; import { folderInput } from 'rollup-plugin-folder-input'; -import babel from '@rollup/plugin-babel'; import copy from 'rollup-plugin-copy'; export default { @@ -10,7 +8,7 @@ export default { 'src/**/*.ts*', ], output: { - dir: 'lib/src', + dir: 'lib', format: 'es', sourcemap: true, preserveModules: true, @@ -36,22 +34,13 @@ export default { ] }), }), - babel({ - exclude: 'node_modules/**', - include: ['src/**/*'], - babelHelpers: 'bundled', - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }), - peerDepsExternal({ - includeDependencies: true, - }), json(), copy({ targets: [ { src: 'ios/**/*', dest: 'lib/ios' }, { src: 'package.json', dest: 'lib' }, { src: 'README.md', dest: 'lib' }, - { src: 'RNAppleMusic.podspec', dest: 'lib/ios'}, + { src: 'RNAppleMusic.podspec', dest: 'lib'}, ] }) ], From c6f4a6c548fa137cb6eacdcfca6194a6064ccf61 Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 13:20:42 +0100 Subject: [PATCH 10/11] fix: fixed lint and prettier files --- .eslintrc.js => .eslintrc.cjs | 0 .prettierrc.js => .prettierrc.cjs | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .eslintrc.js => .eslintrc.cjs (100%) rename .prettierrc.js => .prettierrc.cjs (100%) diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.prettierrc.js b/.prettierrc.cjs similarity index 100% rename from .prettierrc.js rename to .prettierrc.cjs From c65dbeaa4a57ea2a8a4ea5471bce22a8685f2c74 Mon Sep 17 00:00:00 2001 From: trusasha Date: Fri, 19 Jan 2024 13:54:30 +0100 Subject: [PATCH 11/11] fix: fixed package.json --- babel.config.js | 11 ----------- package-lock.json | 37 ------------------------------------- package.json | 2 -- 3 files changed, 50 deletions(-) delete mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index c71cb56..0000000 --- a/babel.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - presets: [ - '@babel/preset-env', - '@babel/preset-react', - '@babel/preset-typescript', - ], - plugins: [ - ['@babel/plugin-proposal-class-properties'], - ], - env: {}, -}; diff --git a/package-lock.json b/package-lock.json index e6fa6ea..2cdf207 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "@lomray/eslint-config": "^3.0.0", "@lomray/prettier-config": "^1.2.0", "@react-native/eslint-config": "^0.72.2", - "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@types/jest": "^28.1.2", "@types/react": "~17.0.21", @@ -38,7 +37,6 @@ "rollup": "^4.9.1", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-folder-input": "^1.0.1", - "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-ts": "^3.4.5", "semantic-release": "^21.1.2", "typescript": "^5.0.2" @@ -6268,32 +6266,6 @@ "react-native": "*" } }, - "node_modules/@rollup/plugin-babel": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", - "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@rollup/pluginutils": "^5.0.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0", - "@types/babel__core": "^7.1.9", - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "@types/babel__core": { - "optional": true - }, - "rollup": { - "optional": true - } - } - }, "node_modules/@rollup/plugin-json": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", @@ -23871,15 +23843,6 @@ "fast-glob": "^3.2.5" } }, - "node_modules/rollup-plugin-peer-deps-external": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-peer-deps-external/-/rollup-plugin-peer-deps-external-2.2.4.tgz", - "integrity": "sha512-AWdukIM1+k5JDdAqV/Cxd+nejvno2FVLVeZ74NKggm3Q5s9cbbcOgUPGdbxPi4BXu7xGaZ8HG12F+thImYu/0g==", - "dev": true, - "peerDependencies": { - "rollup": "*" - } - }, "node_modules/rollup-plugin-ts": { "version": "3.4.5", "resolved": "https://registry.npmjs.org/rollup-plugin-ts/-/rollup-plugin-ts-3.4.5.tgz", diff --git a/package.json b/package.json index 3dbaf87..f386890 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "@lomray/eslint-config": "^3.0.0", "@lomray/prettier-config": "^1.2.0", "@react-native/eslint-config": "^0.72.2", - "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@types/jest": "^28.1.2", "@types/react": "~17.0.21", @@ -60,7 +59,6 @@ "rollup": "^4.9.1", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-folder-input": "^1.0.1", - "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-ts": "^3.4.5", "semantic-release": "^21.1.2", "typescript": "^5.0.2"