Skip to content

Commit

Permalink
prepare of release (#14)
Browse files Browse the repository at this point in the history
* remove version in main file

* update version in all package versions to 0.7.0

* update release process to pnpm

* make all releases public

* fix used dependencies in packages
  • Loading branch information
CordlessWool authored Mar 27, 2024
1 parent 642a857 commit ebc3580
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ jobs:
- name: Build && publint
run: pnpm run prepublishOnly
- name: Publish Dry Run
run: pnpm publish --dry-run --no-git-checks
run: pnpm -r publish --dry-run --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 20 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,50 @@ name: Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup NodeJs
- name: pnpm-setup
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install
run: npm ci
run: pnpm install
- name: Lint & Fix
run: npm run lint:fix
run: pnpm run lint:fix
- name: Test
run: npm run test:ci
run: pnpm run test:ci
publish:
name: Build & Publish
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node for npm
- name: pnpm-setup
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
registry-url: https://registry.npmjs.org/
- name: Install
run: npm ci
run: pnpm install
- name: Build & publint
run: npm run prepublishOnly
- name: Pack
run: npm pack
run: pnpm run prepublishOnly
- name: Publish
run: npm publish
run: pnpm -r publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 4 additions & 4 deletions adapters/in-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "dist/exports/lib.js",
"types": "dist/exports/lib.d.ts",
"author": "Cotton Coding",
"version": "0.6.0",
"version": "0.7.0",
"description": "A file system wrapper for Node.js and Bun",
"keywords": [
"fs",
Expand Down Expand Up @@ -31,13 +31,13 @@
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@loom-io/interface-tests": "workspace:*"
"@loom-io/interface-tests": "workspace:^"
},
"peerDependencies": {
"@loom-io/core": "workspace:*"
"@loom-io/core": "workspace:^0.7.0"
},
"dependencies": {
"@loom-io/common": "workspace:*"
"@loom-io/common": "workspace:^"
},
"exports": {
".": {
Expand Down
10 changes: 5 additions & 5 deletions adapters/minio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "dist/exports/lib.js",
"types": "dist/exports/lib.d.ts",
"author": "Cotton Coding",
"version": "0.6.0",
"version": "0.7.0",
"description": "A file system wrapper for Node.js and Bun",
"keywords": [
"fs",
Expand All @@ -30,14 +30,14 @@
"prepublishOnly": "npm run build && publint"
},
"devDependencies": {
"@loom-io/interface-tests": "workspace:*",
"@loom-io/test-utils": "workspace:*"
"@loom-io/interface-tests": "workspace:^",
"@loom-io/test-utils": "workspace:^"
},
"peerDependencies": {
"@loom-io/core": "workspace:*"
"@loom-io/core": "^0.7.0"
},
"dependencies": {
"@loom-io/common": "workspace:*",
"@loom-io/common": "workspace:^",
"minio": "^7.1.3"
},
"exports": {
Expand Down
6 changes: 3 additions & 3 deletions adapters/node-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "dist/exports/lib.js",
"types": "dist/exports/lib.d.ts",
"author": "Cotton Coding",
"version": "0.6.0",
"version": "0.7.0",
"description": "A file system wrapper for Node.js and Bun",
"keywords": [
"fs",
Expand Down Expand Up @@ -31,11 +31,11 @@
},
"devDependencies": {
"@loom-io/interface-tests": "workspace:^",
"@loom-io/test-utils": "workspace:*",
"@loom-io/test-utils": "workspace:^",
"@faker-js/faker": "^8.4.1"
},
"peerDependencies": {
"@loom-io/core": "workspace:*"
"@loom-io/core": "^0.7.0"
},
"exports": {
".": {
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"name": "loom-io",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build:common": "pnpm run --filter @loom-io/common build",
"build:core": "pnpm run --filter @loom-io/core build",
Expand Down
13 changes: 6 additions & 7 deletions packages/base-fs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@loom-io/base",
"version": "0.6.0",
"version": "0.7.0",
"description": "",
"main": "dist/exports/lib.js",
"type": "module",
Expand All @@ -12,17 +12,16 @@
"@loom-io/test-utils": "workspace:*"
},
"dependencies": {
"@loom-io/core": "workspace:^0.6.0",
"@loom-io/node-filesystem-adapter": "workspace:^0.6.0",
"@loom-io/yamlConverter": "workspace:^0.6.0",
"@loom-io/jsonConverter": "workspace:^0.6.0"
"@loom-io/core": "workspace:^",
"@loom-io/node-filesystem-adapter": "workspace:^",
"@loom-io/yamlConverter": "workspace:^",
"@loom-io/jsonConverter": "workspace:^"
},
"exports": {
".": {
"types": "./dist/exports/lib.d.ts",
"import": "./dist/exports/lib.js"
}
},
"keywords": [],
"author": ""
"keywords": []
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "dist/exports/lib.js",
"types": "dist/exports/lib.d.ts",
"author": "Cotton Coding",
"version": "0.6.0",
"version": "0.7.0",
"description": "A file system wrapper for Node.js and Bun",
"keywords": [
"bun",
Expand Down
49 changes: 16 additions & 33 deletions packages/core/src/core/dir.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,65 +118,48 @@ describe('Test Directory Service', () => {
});

});
describe('list method', () => {
describe.concurrent('list method', () => {

test('list directory amount', async () => {
const base = adapterHelper.last!;
await adapterHelper.createDirectory(joinPath(base, 'testDir1'));
await adapterHelper.createDirectory(joinPath(base, 'testDir2/testDir3'));
await adapterHelper.createFile(joinPath(base, 'testDir23/testFile.txt'));

const dir = new Directory(adapter, base);
const helper = InMemoryAdapterHelper.init();
helper.createDirectory();
const base = helper.last!;
await helper.createDirectory(joinPath(base, 'testDir1'));
await helper.createDirectory(joinPath(base, 'testDir2/testDir3'));
await helper.createFile(joinPath(base, 'testDir23/testFile.txt'));

const dir = new Directory(helper.adapter, base);
const files = await dir.list();
expect(files).toHaveLength(3);

});

test('list directory' , async () => {
const testDir = adapterHelper.createMultipleDirectories(100);
const helper = InMemoryAdapterHelper.init();
const testDir = helper.createMultipleDirectories(200);
const listOfUniques = getUniqSegmentsOfPath(testDir, 1);
const dir = new Directory(adapter, '/');
const dir = new Directory(helper.adapter, '/');
const paths = await dir.list();
expect(paths).toHaveLength(listOfUniques.length);
for(const t of paths) {
expect(listOfUniques).toContain((t as Directory).path);
}
});

test('list with subDirectory', async () => {
const helper = InMemoryAdapterHelper.init();
const subPath = 'someRandomTestDir';
const testPaths = await adapterHelper.createMultipleDirectories(7, subPath);
const testPaths = await helper.createMultipleDirectories(7, subPath);
const testDir = getUniqSegmentsOfPath(testPaths, 2).map(p => addPrecedingSlash(p));


const dir = new Directory(adapter, '/');
const dir = new Directory(helper.adapter, '/');
const paths = await dir.subDir(subPath).list();
for(const t of paths) {
expect(testDir).toContain((t as Directory).path);
}
});

// TODO: maybe needed for list.asStringArray();
// test('list with additional params', async () => {
// await testHelper.createDirs(30);
// await testHelper.createDirs(2);

// const dir = new Directory(adapter, testHelper.getBasePath());
// const paths = await dir.list(undefined, 'isDirectory');
// expect(paths[0]).toHaveLength(2);
// expect(paths[0][0]).toBeTypeOf('string');
// expect(paths[0][1]).toBe(true);
// });

// test('list with additional multiple params', async () => {
// await testHelper.createFile('testFile', {path: 'testFile.txt'});

// const dir = new Directory(adapter, testHelper.getBasePath());
// const paths = await dir.list(undefined, 'isDirectory', 'isFile');
// expect(paths[0]).toHaveLength(3);
// expect(paths[0][0]).toBeTypeOf('string');
// expect(paths[0][1]).toBe(false);
// expect(paths[0][2]).toBe(true);
// });
});

describe('files method', () => {
Expand Down
4 changes: 2 additions & 2 deletions plugins/jsonConverter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@loom-io/jsonConverter",
"version": "0.6.0",
"version": "0.7.0",
"description": "A plugin for @loom-io to convert json files to JSON",
"main": "dist/jsonConverter.js",
"module": "dist/jsonConverter.js",
Expand All @@ -11,7 +11,7 @@
"prepublishOnly": "npm run build && publint"
},
"peerDependencies": {
"@loom-io/core": "workspace:^0.6.0"
"@loom-io/core": "^0.7.0"
},
"keywords": [],
"author": "Wolfgang Rathgeb",
Expand Down
4 changes: 2 additions & 2 deletions plugins/yamlConverter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@loom-io/yamlConverter",
"version": "0.6.0",
"version": "0.7.0",
"description": "",
"main": "dist/yamlConverter.js",
"type": "module",
Expand All @@ -10,7 +10,7 @@
"prepublishOnly": "npm run build && publint"
},
"peerDependencies": {
"@loom-io/core": "workspace:^0.6.0"
"@loom-io/core": "^0.7.0"
},
"dependencies": {
"yaml": "^2.4.1"
Expand Down
Loading

0 comments on commit ebc3580

Please sign in to comment.