Skip to content
Open
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
94 changes: 7 additions & 87 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,93 +5,13 @@ on:
- main
- dev
jobs:
release_tiny_pkce:
build:
runs-on: ubuntu-latest
steps:
- name: 👀 Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Flutter
uses: subosito/flutter-action@v2

- name: Install dependencies
run: flutter pub get
- name: Configure git
run: |
git fetch --prune --unshallow
git config --global user.name "GitHub Actions"
git config --global user.email "gh-actions@github.com"
- name: 🔂 Run standard-version
run: |
npx standard-version --skip.tag ${{ github.ref == 'refs/heads/dev' && '--prerelease' || '' }}
- name: ⏎ Get new version
uses: actions/github-script@v7
id: get_new_version
with:
result-encoding: string
script: |
const fs = require('fs');
const package = JSON.parse(fs.readFileSync('package.json', 'utf8'));
return package.version;
- run: npm install yaml
- name: Update version in pubspec
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const yaml = require("yaml");
const version = '${{ steps.get_new_version.outputs.result }}';
const pubspec = yaml.parse(fs.readFileSync('pubspec.yaml', 'utf8'));
pubspec.version = version;
fs.writeFileSync('pubspec.yaml', yaml.stringify(pubspec));

- name: Run tests
run: flutter test
- name: Run linter
run: flutter analyze
- name: Add changed source files
run: |
git add pubspec.yaml lib/ package.json
git commit -m "chore(release): ${{ steps.get_new_version.outputs.result }} [skip ci]"
- name: Dry run publish
run: flutter pub publish --dry-run

- run: |
git push origin ${{ github.ref }}

- name: 🪵 Extract changelog for current version
uses: actions/github-script@v7
with:
script: |
const fs = require("fs");
const changelog = fs.readFileSync("CHANGELOG.md", "utf8");
const lines = changelog.split("\n");
let lastVersion = [];
for (let line of lines) {
// Match the version header, by looking for a markdown header followed by semver (optionally wrapped in [])
// Semver regex from https://semver.org/
if (line.match(/^#{2,} \[?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?\]?/)) {
if (lastVersion.length != 0) {
break;
} else {
console.log("Extracting changelog for: " + line)
lastVersion.push(line);
continue;
}
}
if (lastVersion.length > 0) {
lastVersion.push(line);
}
}

fs.writeFileSync("last_version.md", lastVersion.slice(1).join("\n").trim(), "utf8");

# Create a release
- name: 🚀 Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_new_version.outputs.result }}
name: Release ${{ steps.get_new_version.outputs.result }}
body_path: last_version.md
prerelease: ${{ github.ref == 'refs/heads/dev' && 'true' || 'false' }}
git-email: "github-actions@github.com"
git-name: "GitHub Actions"
run-versioning-prerelease: ${{ github.ref != 'main' }}
50 changes: 12 additions & 38 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,23 @@ jobs:
with:
flutter-version: "3.27.4"
channel: "stable"

- name: Install Melos
run: flutter pub global activate melos

- name: Configure git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "gh-actions@github.com"

- name: Install dependencies
run: |
flutter pub get
cd tiny_pkce_launcher
flutter pub get

- name: Verify formatting of tiny_pkce
run: dart format --output=none --set-exit-if-changed .

- name: Verify formatting of tiny_pkce_launcher
run: |
cd tiny_pkce_launcher
dart format --output=none --set-exit-if-changed .
- name: Bootstrap dependencies with Melos
run: melos bootstrap

- name: Analyze tiny_pkce
run: flutter analyze
- name: Verify formatting (all packages)
run: melos run format

- name: Analyze tiny_pkce_launcher
run: |
cd tiny_pkce_launcher
flutter analyze
- name: Analyze (all packages)
run: melos run analyze

- name: Configure git
run: |
git fetch --prune --unshallow
- name: 🔂 Run standard-version
run: |
npx standard-version --skip.tag --skip.commit ${{ github.base_ref == 'dev' && '--prerelease' || '' }}
- name: ⏎ Get new version
uses: actions/github-script@v7
id: get_new_version
with:
result-encoding: string
script: |
const fs = require('fs');
const package = JSON.parse(fs.readFileSync('package.json', 'utf8'));
return package.version;
- name: 💬 Comment on PR with new version
uses: thollander/actions-comment-pull-request@v2
with:
message: "New version ${{ steps.get_new_version.outputs.result }} 🚀 "
- name: Run tests (all packages)
run: melos run test
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ build/
.flutter-plugins-dependencies
.flutter-plugins

example/lib/env.dart
example/lib/env.dart

pubspec_overrides.yaml


coverage_report/


coverage/
2 changes: 0 additions & 2 deletions .pubignore

This file was deleted.

15 changes: 9 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
"version": "0.2.0",
"configurations": [
{
"name": "tiny_pkce",
"name": "example",
"cwd": "apps/example",
"request": "launch",
"type": "dart",
"cwd": "example",

"args": ["--web-port", "8080"]
},
{
"name": "tiny_pkce (profile mode)",
"name": "example (profile mode)",
"cwd": "apps/example",
"request": "launch",
"cwd": "example",

"type": "dart",
"flutterMode": "profile"
},
{
"name": "tiny_pkce (release mode)",
"name": "example (release mode)",

"request": "launch",
"type": "dart",
"cwd": "example",
"cwd": "apps/example",
"flutterMode": "release"
}
]
Expand Down
53 changes: 51 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
## 0.0.1
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2025-05-25

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`tiny_pkce` - `v0.0.2-dev.1`](#tiny_pkce---v002-dev1)

---

#### `tiny_pkce` - `v0.0.2-dev.1`

- **FEAT**: add key prefix support to DefaultSecureStorage to enable having several auth services in a single app.


## 2025-02-19

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`tiny_pkce` - `v0.0.2-dev.0`](#tiny_pkce---v002-dev0)
- [`tiny_pkce_launcher` - `v0.0.2-dev.0`](#tiny_pkce_launcher---v002-dev0)

---

#### `tiny_pkce` - `v0.0.2-dev.0`

- **FEAT**: add melos and combine_coverage.sh.
- **DOCS**: add README for tiny_pkce package.

#### `tiny_pkce_launcher` - `v0.0.2-dev.0`

- **FEAT**: add melos and combine_coverage.sh.

* TODO: Describe initial release.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tiny_pkce 🔐

[![melos](https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square)](https://github.com/invertase/melos)

A lightweight Flutter package for implementing the OAuth 2.0 PKCE authentication flow. 🚀

## Features ✨
Expand Down Expand Up @@ -87,7 +89,7 @@ To use this package, add it to your `pubspec.yaml`.

---

© 2024 ElectricCookie
© 2025 ElectricCookie

Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License. Obtain a copy of the License at:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "com.android.application" version "8.3.0" apply false
id "org.jetbrains.kotlin.android" version "2.0.21" apply false
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions apps/example/lib/env.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
String discoveryUrl =
"https://login.emddigital.com/.well-known/openid-configuration";
String clientId = "pkt-ALEUvLknGqosN8w7cA";
String redirectUrl = "com.your.awesome-app://login-callback";
List<String> scopes = ["openid", "email"];
String logoutUrl = "https://login.emddigital.com/logout";
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import FlutterMacOS
import Foundation

import app_links
import flutter_secure_storage_macos
import path_provider_foundation
import flutter_secure_storage_darwin
import tiny_pkce_launcher
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin"))
TinyPkceLauncherPlugin.register(with: registry.registrar(forPlugin: "TinyPkceLauncherPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions apps/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: tiny_pkce_example
description: "Demonstrates how to use the tiny_pkce plugin."
publish_to: "none"
environment:
sdk: ^3.6.0

dependencies:
flutter:
sdk: flutter

flutter_web_plugins:
sdk: flutter

tiny_pkce: ^0.0.2-dev.0

cupertino_icons: ^1.0.8

dev_dependencies:
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
flutter_lints: ^6.0.0

resolution: workspace

flutter:
uses-material-design: true
7 changes: 7 additions & 0 deletions apps/example/test/example_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:flutter_test/flutter_test.dart';

void main() {
test('tiny pkce example', () {
expect(true, isTrue);
});
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions combine_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

escapedPath="$(echo `pwd` | sed 's/\//\\\//g')"

if grep flutter pubspec.yaml > /dev/null; then
if [ -d "coverage" ]; then
# combine line coverage info from package tests to a common file
if [ ! -d "$MELOS_ROOT_PATH/coverage_report" ]; then
mkdir "$MELOS_ROOT_PATH/coverage_report"
fi
sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> "$MELOS_ROOT_PATH/coverage_report/lcov.info"
rm -rf "coverage"
fi
fi
Loading
Loading