Skip to content

Commit

Permalink
Feature/31 missing g util (#33)
Browse files Browse the repository at this point in the history
* Bump versions and revert to ktlint

* Close #29 nested PackageJson template merging

* GH check action
  • Loading branch information
mpetuska authored Jan 23, 2022
1 parent f541dca commit ec195ed
Show file tree
Hide file tree
Showing 34 changed files with 2,885 additions and 789 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Check
defaults:
run:
shell: bash

on:
pull_request:
branches:
- '**'
workflow_dispatch:

env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"

jobs:
check:
name: Check on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11

- name: Restore Gradle cache
id: cache
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/yarn
~/.gradle/nodejs
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Gradle Check
run: ./gradlew check --scan

- name: Gradle Assemble
run: ./gradlew assemble --scan

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: reports-${{ runner.os }}
path: |
**/build/reports
- name: Gradle Check Sandbox
working-directory: sandbox
run: ./gradlew check --scan

- name: Gradle Assemble
working-directory: sandbox
run: ./gradlew assemble pack --scan

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: sandbox-${{ runner.os }}
path: |
sandbox/**/build/reports
sandbox/**/build/publications
- name: ts-consumer Install
working-directory: sandbox/ts-consumer
run: yarn install

- name: ts-consumer Build
working-directory: sandbox/ts-consumer
run: yarn build

- name: ts-consumer Run
working-directory: sandbox/ts-consumer
run: yarn start

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: ts-consumer-${{ runner.os }}
path: |
sandbox/ts-consumer/build
sandbox/ts-consumer/node_modules/@mpetuska
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.theia/
.yarn/
.yarnrc
yarn.lock

# Ignore Gradle build output directory
build
Expand All @@ -13,3 +12,4 @@ apiDiff.api
public/
node_modules
*.log
lint.xml
35 changes: 19 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
# WIP
## Versions
* Kotlin: 1.5.21
* Gradle: 7.2.0cd ..
# 2.1.2
## Build Versions
* Kotlin: 1.4.31
* Gradle: 7.3.3
* JDK: 11
## Changes
*
* Kotlin plugin version bumped to `1.6.10`
* Simplified `JsonObject` DSL builders by rebasing it onto `dev.petuska:kon`
* Implemented proper nested `package.json` template merging
* Rolled back to good old `ktlint` formatting


# v2.1.1
## Versions
* Kotlin: 1.5.21
# 2.1.1
## Build Versions
* Kotlin: 1.4.31
* Gradle: 7.2.0
* JDK: 11
## Changes
* Kotlin version bumped to `1.5.30`
* Kotlin plugin version bumped to `1.5.30`
* Sample GH action introduced to showcase CI publishing
* Reworked ts-consumer to showcase module inter-dependencies


# v2.1.0
## Versions
* Kotlin: 1.5.21
# 2.1.0
## Build Versions
* Kotlin: 1.4.31
* Gradle: 7.2.0
* JDK: 11
## Changes
* Fixed [#24](https://github.com/mpetuska/npm-publish/issues/24): `types` configuration property was ignored
* Added support for setting configuration properties via environment variables too
* Kotlin version bumped to `1.5.21`
* Kotlin plugin version bumped to `1.5.21`


# v2.0.4
## Versions
* Kotlin: 1.5.10
# 2.0.4
## Build Versions
* Kotlin: 1.4.31
* Gradle: 7.1.1
* JDK: 11
## Changes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Gradle plugin enabling NPM publishing (essentially `maven-publish` for NPM packages). Integrates seamlessly with
Kotlin/JS/MPP plugin if applied, providing auto configurations.

> The plugin was last tested with `JDK 11`, `Kotlin 1.5.30` & `Gradle 7.2.0`
> The plugin was last tested with `JDK 11`, `Kotlin 1.6.10` & `Gradle 7.3.3`
## Setup

Expand All @@ -26,7 +26,7 @@ tasks:
```kotlin
plugins {
id("dev.petuska.npm.publish") version "<VERSION>"
kotlin("multiplatform") version "1.5.21" // Optional, also supports "js"
kotlin("multiplatform") version "1.6.10" // Optional, also supports "js"
}

kotlin {
Expand Down
33 changes: 23 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import de.fayard.refreshVersions.core.versionFor
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -16,11 +17,11 @@ plugins {
}

description =
"""
"""
A maven-publish alternative for NPM package publishing.
Integrates with kotlin JS/MPP plugins (if applied) to automatically
setup publishing to NPM repositories for all JS targets.
""".trimIndent()
""".trimIndent()

idea {
module {
Expand All @@ -30,8 +31,19 @@ idea {
}

spotless {
kotlin { ktfmt() }
kotlinGradle { ktfmt() }
val ktlintSettings = mapOf(
"indent_size" to "2",
"continuation_indent_size" to "4",
"disabled_rules" to "no-wildcard-imports"
)
kotlin {
target("src/**/*.kt")
ktlint(versionFor("version.ktlint")).userData(ktlintSettings)
}
kotlinGradle {
target("*.kts")
ktlint(versionFor("version.ktlint")).userData(ktlintSettings)
}
}

gradleEnterprise {
Expand Down Expand Up @@ -150,12 +162,13 @@ afterEvaluate {
withType<Jar> {
manifest {
attributes +=
sortedMapOf(
"Built-By" to System.getProperty("user.name"),
"Build-Jdk" to System.getProperty("java.version"),
"Implementation-Version" to project.version,
"Created-By" to "Gradle v${GradleVersion.current()}",
"Created-From" to Git.headCommitHash)
sortedMapOf(
"Built-By" to System.getProperty("user.name"),
"Build-Jdk" to System.getProperty("java.version"),
"Implementation-Version" to project.version,
"Created-By" to "Gradle v${GradleVersion.current()}",
"Created-From" to Git.headCommitHash
)
}
}
withType<Test> { useJUnitPlatform() }
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement {
plugins {
id("de.fayard.refreshVersions") version "0.20.0"
id("de.fayard.refreshVersions") version "0.30.2"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ec195ed

Please sign in to comment.