Skip to content

Commit

Permalink
fix: npm release issues (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiPl01 authored Oct 28, 2023
1 parent 2a86a09 commit 0cd43b1
Show file tree
Hide file tree
Showing 16 changed files with 7,091 additions and 2,096 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ metro.config.js
bob.config.js
README.md
node_modules
scripts
dist
15 changes: 0 additions & 15 deletions .expo/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions .expo/packager-info.json

This file was deleted.

10 changes: 0 additions & 10 deletions .expo/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
run: yarn install --frozen-lockfile

- name: 🔎 Run typecheck
run: yarn typecheck:all
run: yarn typecheck
3 changes: 3 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Override Yarn command so we can automatically setup the repo on running `yarn`

yarn-path "scripts/bootstrap.js"
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# 1.0.0 (2023-10-27)


### Bug Fixes

* Add missing dependencies ([#20](https://github.com/MatiPl01/react-native-skia-responsive-text/issues/20)) ([cd5050d](https://github.com/MatiPl01/react-native-skia-responsive-text/commit/cd5050d5bd83c7d04b84f3c0113879d7779ad396))

- Add missing dependencies ([#20](https://github.com/MatiPl01/react-native-skia-responsive-text/issues/20)) ([cd5050d](https://github.com/MatiPl01/react-native-skia-responsive-text/commit/cd5050d5bd83c7d04b84f3c0113879d7779ad396))

### Features

* Add main library code ([#9](https://github.com/MatiPl01/react-native-skia-responsive-text/issues/9)) ([a2596f9](https://github.com/MatiPl01/react-native-skia-responsive-text/commit/a2596f9907afad07a701632bb18695d56820d14b))
- Add main library code ([#9](https://github.com/MatiPl01/react-native-skia-responsive-text/issues/9)) ([a2596f9](https://github.com/MatiPl01/react-native-skia-responsive-text/commit/a2596f9907afad07a701632bb18695d56820d14b))
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ yarn
You can start the example app using the following command.

```sh
yarn example
yarn example start
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset']
};
11 changes: 10 additions & 1 deletion bob.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module.exports = {
source: 'src',
output: 'dist',
targets: ['commonjs', 'module']
targets: [
'commonjs',
'module',
[
'typescript',
{
project: 'tsconfig.build.json'
}
]
]
};
9 changes: 9 additions & 0 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');
const { getDefaultConfig } = require('@expo/metro-config');
const escape = require('escape-string-regexp');
const exclusionList = require('metro-config/src/defaults/exclusionList');

const rootDir = path.resolve(__dirname, '..');
const rootPkg = require(path.join(rootDir, 'package.json'));
Expand Down Expand Up @@ -30,6 +32,13 @@ module.exports = {
resolver: {
...defaultConfig.resolver,

blacklistRE: exclusionList(
modules.map(
m =>
new RegExp(`^${escape(path.join(rootDir, 'node_modules', m))}\\/.*$`)
)
),

extraNodeModules: {
...externalNodeModules
}
Expand Down
6,767 changes: 6,767 additions & 0 deletions example/yarn.lock

Large diffs are not rendered by default.

28 changes: 9 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"@semantic-release/npm": "^11.0.0",
"@semantic-release/release-notes-generator": "^12.0.0",
"@shopify/react-native-skia": "0.1.196",
"@types/react": "^18.2.33",
"eslint": "^8.52.0",
"eslint-config-react-native-matipl01": "^1.0.2",
"husky": "^8.0.0",
"jest": "^29.7.0",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-native": "^0.72.5",
"react": "18.2.0",
"react-native": "0.72.6",
"react-native-builder-bob": "^0.23.1",
"react-native-reanimated": "~3.3.0",
"semantic-release": "^22.0.5",
"syncpack": "^11.2.1",
Expand Down Expand Up @@ -60,35 +62,23 @@
"react-native": "*",
"react-native-reanimated": ">=2.0.0"
},
"private": true,
"publishConfig": {
"access": "public"
},
"react-native": "src/index",
"repository": "[email protected]:MatiPl01/react-native-skia-responsive-text.git",
"resolutions": {
"react": "^18.2.0",
"react-native": "^0.72.5"
},
"scripts": {
"build": "yarn clean && bob build && yarn declarations:emit",
"bootstrap": "yarn example && yarn",
"build": "yarn clean && bob build",
"clean": "rm -rf dist && rm -f *.tgz",
"declarations:emit": "tsc -p tsconfig.build.json",
"example": "yarn --cwd example workspace example start",
"example:android": "yarn workspace example android",
"example:ios": "yarn workspace example ios",
"example": "yarn --cwd example",
"format:code": "prettier --write . --ignore-unknown",
"format:deps": "syncpack format",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"prepack": "yarn build",
"prepare": "husky install",
"typecheck": "tsc -p tsconfig.json --noEmit",
"typecheck:all": "yarn typecheck && yarn typecheck:example",
"typecheck:example": "yarn workspace example typecheck"
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"types": "dist/typescript/index.d.ts",
"workspaces": [
"example"
]
"types": "dist/typescript/index.d.ts"
}
29 changes: 29 additions & 0 deletions scripts/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const os = require('os');
const path = require('path');
const child_process = require('child_process');

const root = path.resolve(__dirname, '..');
const args = process.argv.slice(2);
const options = {
cwd: process.cwd(),
env: process.env,
stdio: 'inherit',
encoding: 'utf-8'
};

if (os.type() === 'Windows_NT') {
options.shell = true;
}

let result;

if (process.cwd() !== root || args.length) {
// We're not in the root of the project, or additional arguments were passed
// In this case, forward the command to `yarn`
result = child_process.spawnSync('yarn', args, options);
} else {
// If `yarn` is run without arguments, perform bootstrap
result = child_process.spawnSync('yarn', ['bootstrap'], options);
}

process.exitCode = result.status;
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "eslint-config-react-native-matipl01/tsconfig.base",
"include": ["src"],
"exclude": ["example", "node_modules"]
"exclude": ["example"]
}
Loading

0 comments on commit 0cd43b1

Please sign in to comment.