Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
branches: [main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Typecheck & Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install --immutable

- name: Typecheck (all workspaces)
run: yarn ts:check

- name: Build (all workspaces)
run: yarn build
47 changes: 47 additions & 0 deletions .github/workflows/deprecate-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ⚠️ Deprecate package version

on:
workflow_dispatch:
inputs:
package:
description: "Public package (packages/public/*)"
required: true
type: choice
options:
- ios-common-cookies
range:
description: "Version or range (e.g. 1.0.1 or <1.0.2)"
required: true
message:
description: "Deprecation message (e.g. 'Bad build, use >=1.0.2')"
required: true

jobs:
deprecate:
name: Deprecate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.FLOW_GITHUB_TOKEN }}

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install --immutable

- name: Set npm token
uses: "./.github/actions/set-npm-token"
with:
npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Deprecate npm package version/range
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
PKG_JSON="packages/public/${{ github.event.inputs.package }}/package.json"
PKG_NAME=$(node -p "require(process.argv[1]).name" "$PKG_JSON")
echo "Deprecating $PKG_NAME@${{ github.event.inputs.range }}"
npm deprecate "$PKG_NAME@${{ github.event.inputs.range }}" "${{ github.event.inputs.message }}"
22 changes: 22 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Lint PR"

on:
pull_request:
branches: [main]

jobs:
lint-pr:
name: Validate PR title
runs-on: ubuntu-latest

steps:
- uses: amannn/action-semantic-pull-request@v5
with:
types: |
feat
fix
chore
revert
requireScope: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 📦 Publish package

on:
workflow_dispatch:
inputs:
package:
description: "Public package to publish (packages/public/*)"
required: true
type: choice
options:
- ios-common-cookies
cliArgs:
description: "CLI args"
required: false
default: ""

jobs:
publish:
name: Publish selected package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.FLOW_GITHUB_TOKEN }}

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install --immutable

- name: Set npm token
uses: "./.github/actions/set-npm-token"
with:
npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Publish package
working-directory: packages/public/${{ github.event.inputs.package }}
env:
GITHUB_TOKEN: ${{ secrets.FLOW_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: npx semantic-release ${{ github.event.inputs.cliArgs }}
44 changes: 44 additions & 0 deletions .github/workflows/unpublish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 🧨 Unpublish package version

on:
workflow_dispatch:
inputs:
package:
description: "Public package (packages/public/*)"
required: true
type: choice
options:
- ios-common-cookies
version:
description: "Version to unpublish (e.g. 1.0.1)"
required: true

jobs:
unpublish:
name: Unpublish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.FLOW_GITHUB_TOKEN }}

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install --immutable

- name: Set npm token
uses: "./.github/actions/set-npm-token"
with:
npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Unpublish npm package version
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
PKG_JSON="packages/public/${{ github.event.inputs.package }}/package.json"
PKG_NAME=$(node -p "require(process.argv[1]).name" "$PKG_JSON")
echo "Unpublishing $PKG_NAME@${{ github.event.inputs.version }}"
npm unpublish "$PKG_NAME@${{ github.event.inputs.version }}" --force
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Dependencies
node_modules/
**/node_modules/

# Build outputs
dist/
**/dist/

# TypeScript
*.tsbuildinfo

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# OS
.DS_Store
.directory

# IDEs
.idea/
.vscode/

# Coverage / reports
coverage/
reports/

# Expo / Metro cache
.expo/

# Yarn (Berry)
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
.metro/
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 Telefonica Digital España S.L.U.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "platform-react-native-modules",
"private": true,
"workspaces": [
"packages/*/*"
],
"scripts": {
"build": "yarn workspaces foreach -A run build",
"ts:check": "yarn workspaces foreach -A run ts:check"
},
"engines": {
"node": ">=20"
},
"packageManager": "yarn@4.6.0"
}
10 changes: 10 additions & 0 deletions packages/public/ios-common-cookies/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"branches": ["main"],
"tagFormat": "ios-common-cookies-v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
3 changes: 3 additions & 0 deletions packages/public/ios-common-cookies/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# iOS Common Cookies

Expo module to sync cookies between HTTPCookieStorage and WKWebView.
6 changes: 6 additions & 0 deletions packages/public/ios-common-cookies/expo-module.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"platforms": ["apple"],
"apple": {
"modules": ["iOSCommonCookiesModule"]
}
}
2 changes: 2 additions & 0 deletions packages/public/ios-common-cookies/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from "./src/iOSCommonCookies";
export * from "./src/iOSCommonCookies.types";
22 changes: 22 additions & 0 deletions packages/public/ios-common-cookies/ios/iOSCommonCookies.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Pod::Spec.new do |s|
s.name = 'iOSCommonCookies'
s.version = '1.0.0'
s.summary = 'Sync cookies between HTTPCookieStorage and WKWebView'
s.description = 'Expo iOS module that syncs cookies between HTTPCookieStorage and WKWebsiteDataStore.httpCookieStore.'
s.author = 'Telefónica'
s.homepage = 'https://github.com/telefonica/platform-react-native-modules'
s.platforms = {
:ios => '13.0'
}
s.source = { git: 'https://github.com/telefonica/platform-react-native-modules.git', tag: s.version.to_s }
s.static_framework = true

s.dependency 'ExpoModulesCore'

# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
}

s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
end
Loading