Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #25: Ensure only needed files are packaged #44

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions .changeset/lovely-seals-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rdfjs/types": patch
---

Move types to a src directory and ensure the published package only contains needed files.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18

- name: Install Dependencies
run: yarn
run: npm i

- name: Build project
run: npm run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: yarn
- run: yarn test
- run: yarn lint
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm i --ignore-scripts
- run: npm run build
- run: npm run test
- run: npm run lint
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,12 @@ dist

# TernJS port file
.tern-port

# File system
.DS_Store

# Distribution
dist

# Package Lockfile
package-lock.json
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @rdfjs/types

## 1.1.1

### Patch Changes

- Ensure only needed files are packaged

## 1.1.0

### Minor Changes
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
"name": "@rdfjs/types",
"version": "1.1.0",
"license": "MIT",
"types": "index.d.ts",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"author": {
"name": "RDF/JS Representation Task Force",
"url": "https://github.com/rdfjs/representation-task-force",
"email": "[email protected]"
},
"scripts": {
"build": "tsc",
"changeset": "changeset",
"lint": "eslint . --ext .ts",
"test": "tsc --noEmit",
"test": "tsc -p test",
"release": "changeset publish"
},
"dependencies": {
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.
4 changes: 2 additions & 2 deletions rdf-js-query-tests.ts → test/rdf-js-query-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import {
Query,
Variable,
ResultStream,
Quad,
Quad,
StringSparqlQueryable,
AlgebraSparqlQueryable,
BindingsResultSupport,
QuadsResultSupport,
} from ".";
} from "..";

function test_bindings() {
const df: DataFactory = <any> {};
Expand Down
2 changes: 1 addition & 1 deletion rdf-js-tests.ts → test/rdf-js-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BlankNode, DataFactory, Dataset, DatasetCore, DatasetCoreFactory, DatasetFactory, DefaultGraph, Literal,
NamedNode, Quad, BaseQuad, Sink, Source, Store, Stream, Term, Variable, Quad_Graph } from ".";
NamedNode, Quad, BaseQuad, Sink, Source, Store, Stream, Term, Variable, Quad_Graph } from "..";
import { EventEmitter } from "events";

function test_terms() {
Expand Down
13 changes: 13 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "es2022",
"moduleResolution": "node",
"emitDeclarationOnly": false,
"noEmit": true,
},
"include": [
"."
]
}

26 changes: 11 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"target": "ES2022",
"lib": [
"es6"
"ES2022",
"DOM"
],
"module": "ES2022",
"moduleResolution": "node",
"strict": true,
"noImplicitReturns": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"downlevelIteration": true
"emitDeclarationOnly": true,
"declaration": true,
},
"files": [
"index.d.ts",
"rdf-js-tests.ts",
"rdf-js-query-tests.ts"
"include": [
"src/index.ts"
]
}
}
Loading