Skip to content

Commit

Permalink
fix: file structure for js packages
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
sgammon committed Mar 19, 2024
1 parent e1df68e commit 187537f
Show file tree
Hide file tree
Showing 30 changed files with 31 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: elide-dev/jpms
flags: packages
verbose: true
- name: "Build: Packages"
run: pnpm run -r pack
- name: "Artifact: Packages"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ jobs:
name: ${{ needs.provenance.outputs.provenance-name }}
- name: "Publish: Release"
uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee # v2.0.2
if: !inputs.dry-run
with:
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/

import { basename, dirname } from "node:path"
import { GradleAttribute, GradleModuleSchema, GradleVariantSchema } from "./schema"
import { GradleModuleOptions, gradleModule } from "./util"
import { GradleAttribute, GradleModuleSchema, GradleVariantSchema } from "./gradle-schema"
import { GradleModuleOptions, gradleModule } from "./gradle-util"

/**
* Gradle Info
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { object, array, string, number, InferType, ObjectSchema } from "yup"
import { GRADLE_SCHEMA_VERSION } from "./constants"
import { GRADLE_SCHEMA_VERSION } from "./gradle-constants"

import {
GradleAttribute,
Expand All @@ -11,7 +11,7 @@ import {
GradleModuleType,
GradleReleaseFile,
GradleVariant,
} from "./model"
} from "./gradle-model"

export type {
GradleAttribute,
Expand Down
2 changes: 1 addition & 1 deletion packages/gradle/util.ts → packages/gradle/gradle-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { existsSync } from "node:fs"
import { join, resolve } from "node:path"
import { readFile } from "node:fs/promises"
import { GradleModuleType, GradleModuleInfo } from "./model"
import { GradleModuleType, GradleModuleInfo } from "./gradle-model"

/**
* Read a Gradle Module definition from the provided absolute path
Expand Down
6 changes: 3 additions & 3 deletions packages/gradle/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
* License for the specific language governing permissions and limitations under the License.
*/

export type { GradleModuleInfo } from "./model.js"
export * from "./schema.js"
export * from "./facade.js"
export type { GradleModuleInfo } from "./gradle-model"
export * from "./gradle-schema"
export * from "./gradle-facade"
4 changes: 2 additions & 2 deletions packages/gradle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
},
"exports": {
"./util": {
"import": "./dist/util.js",
"types": "./dist/util.d.ts"
"import": "./dist/gradle-util.js",
"types": "./dist/gradle-util.d.ts"
},
".": {
"import": "./dist/index.mjs",
Expand Down
6 changes: 3 additions & 3 deletions packages/gradle/tests/gradle-facade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

import { expect, test } from "@jest/globals"
import { join } from "node:path"
import { GradleModule } from "../facade"
import { GradleAttribute, GradleModuleType } from "../model"
import { gradleModule } from "../util"
import { GradleModule } from "../gradle-facade"
import { GradleAttribute, GradleModuleType } from "../gradle-model"
import { gradleModule } from "../gradle-util"

test("gradle module facade instance parse from file", async () => {
const mod = await GradleModule.fromFile(__dirname, 'gradle-module-sample.pom')
Expand Down
2 changes: 1 addition & 1 deletion packages/gradle/tests/gradle-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import { expect, test } from "@jest/globals"
import { gradleModule } from "../util"
import { gradleModule } from "../gradle-util"

test("gradle model parse from content (pom)", async () => {
const mod = await gradleModule(__dirname, 'gradle-module-sample.pom')
Expand Down
4 changes: 2 additions & 2 deletions packages/gradle/tests/gradle-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/

import { expect, test } from "@jest/globals"
import { gradleModuleSchema } from "../schema"
import { gradleModule } from "../util"
import { gradleModuleSchema } from "../gradle-schema"
import { gradleModule } from "../gradle-util"

async function sampleModule() {
return (await gradleModule(__dirname, 'gradle-module-sample.json'))?.module
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/indexer/indexer.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { join, resolve, sep, dirname, basename } from "node:path";

import { MavenCoordinate, mavenCoordinate } from "@javamodules/maven";
import { GradleModuleInfo } from "@javamodules/gradle";
import { gradleModule } from "../gradle/dist/util";
import { gradleModule } from "@javamodules/gradle/util";

import { RepositoryPackage, RepositoryIndexBundle, RepositoryIndexFile } from "./model.mjs";
import { RepositoryPackage, RepositoryIndexBundle, RepositoryIndexFile } from "./indexer-model.mjs";

function repositoryPackage(
root: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/java/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
* License for the specific language governing permissions and limitations under the License.
*/

export * from "./model.js"
export * from "./java-model.js"
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/java/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
},
"exports": {
"./util": {
"import": "./dist/util.js",
"types": "./dist/util.d.ts"
"import": "./dist/java-util.js",
"types": "./dist/java-util.d.ts"
},
".": {
"import": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/maven/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
* License for the specific language governing permissions and limitations under the License.
*/

export * from "./model.js"
export * from "./maven-model"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/maven/schema.ts → packages/maven/maven-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import { object, array, string, InferType, ObjectSchema } from "yup"
import { POM_MODEL_VERSION } from "./constants"
import { POM_MODEL_VERSION } from "./maven-constants"

import {
MavenProjectLicense,
Expand All @@ -22,7 +22,7 @@ import {
MavenProjectSourceControl,
MavenProject as MavenProjectType,
MavenProjectManagedDependency,
} from "./model"
} from "./maven-model"

export type {
MavenProjectLicense,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under the License.
*/

import { expect, test } from "@jest/globals";

test("2 + 2", () => {
expect(2 + 2).toBe(4);
});
4 changes: 2 additions & 2 deletions packages/maven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
},
"exports": {
"./util": {
"import": "./dist/util.js",
"types": "./dist/util.d.ts"
"import": "./dist/maven-util.js",
"types": "./dist/maven-util.d.ts"
},
".": {
"import": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/maven/tests/maven-coordinate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import { expect, test } from "@jest/globals"
import { MavenCoordinate, mavenCoordinate, parseMavenCoordinate } from "../model"
import { MavenCoordinate, mavenCoordinate, parseMavenCoordinate } from "../maven-model"

test("build a maven coordinate", () => {
const coordinate: MavenCoordinate = mavenCoordinate('com.google.guava', 'guava', '1.0.0')
Expand Down
4 changes: 2 additions & 2 deletions packages/maven/tests/maven-pom-parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { expect, test } from "@jest/globals"
import { join, resolve } from "node:path"
import { existsSync } from "node:fs"
import { POM_CONTENT_PARENT } from "./maven-samples"
import { MavenProjectPackaging } from "../model"
import parser, { parseAsync, ParsedOutput } from "../parser"
import { MavenProjectPackaging } from "../maven-model"
import parser, { parseAsync, ParsedOutput } from "../maven-parser"

test('parse basic pom content (callback)', async () => {
// sanity: should have non-null string to parse
Expand Down
Empty file removed packages/maven/util.ts
Empty file.

0 comments on commit 187537f

Please sign in to comment.