Skip to content

Commit

Permalink
Merge pull request #174 from KorzhCom/dev
Browse files Browse the repository at this point in the history
Version 1.4.20 of EasyData.JS. Switch to rollup and lerna
  • Loading branch information
korzh authored Dec 29, 2023
2 parents a83bc49 + 7395753 commit 364cb2d
Show file tree
Hide file tree
Showing 89 changed files with 2,165 additions and 1,122 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/js-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,48 @@ jobs:

defaults:
run:
working-directory: ./easydata.js
working-directory: ./

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x
- name: Install dependencies
run: npm run installall
run: npm install

- name: Set version
run: npm run setver

- name: Build
run: npm run build:prod
run: npm run build

- name: Test
run: npm test
continue-on-error: true

- name: Upload packs artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: packs
path: |
!./easydata.js/packs/**/node_modules/**/*.*
./easydata.js/packs/*/dist/**/*.*
./easydata.js/packs/*/package.json
./easydata.js/packs/*/LICENSE.md
./easydata.js/packs/*/README.md
./easydata.js/packs/*/tsconfig.json
./easydata.js/packs/*/*.js
!./easydata.js/packs/**/node_modules/**/*.*
./easydata.js/packs/*/*.mjs
./easydata.js/packs/*/LICENSE.md
./easydata.js/packs/*/README.md
- name: Upload browser artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: browser
path: |
./easydata.js/packs/crud/dist/browser/*.js
./easydata.js/packs/crud/dist/browser/*.css
./easydata.js/packs/crud/lib/*.js
./easydata.js/packs/crud/lib/*.css
release_dev:
name: Development Release
Expand All @@ -82,22 +83,22 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download browser artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: browser
path: browser

- name: Read version.json to env
uses: antifree/[email protected].0
uses: antifree/[email protected].1
with:
filename: ./easydata.js/version.json
prefix: ed

- name: Publish to CDN
uses: SamKirkland/FTP-Deploy-Action@4.0.0
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.CDN_FTP_SERVER }}
username: ${{ secrets.CDN_FTP_USER }}
Expand All @@ -106,28 +107,28 @@ jobs:
server-dir: 'cdn.korzh.com/ed/${{ env.ed_baseVersion }}/'

- name: Download packs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: packs
path: packs

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
registry-url: 'https://www.myget.org/F/korzh-npm/npm/'

- name: Publish @easydata/core
run: npm publish packs/core
run: npm publish ./packs/core
env:
NODE_AUTH_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }}

- name: Publish @easydata/ui
run: npm publish packs/ui
run: npm publish ./packs/ui
env:
NODE_AUTH_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }}

- name: Publish @easydata/crud
run: npm publish packs/crud
run: npm publish ./packs/crud
env:
NODE_AUTH_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }}

Expand All @@ -138,22 +139,22 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download browser artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: browser
path: browser

- name: Read version.json to env
uses: antifree/[email protected].0
uses: antifree/[email protected].1
with:
filename: ./easydata.js/version.json
prefix: ed

- name: Publish to CDN
uses: SamKirkland/FTP-Deploy-Action@4.0.0
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.CDN_FTP_SERVER }}
username: ${{ secrets.CDN_FTP_USER }}
Expand All @@ -162,27 +163,27 @@ jobs:
server-dir: 'cdn.korzh.com/ed/${{ env.ed_baseVersion }}/'

- name: Download packs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: packs
path: packs

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'

- name: Publish @easydata/core
run: npm publish packs/core --access public --tag ${{ env.ed_tag }}
run: npm publish ./packs/core --access public --tag ${{ env.ed_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

- name: Publish @easydata/ui
run: npm publish packs/ui --access public --tag ${{ env.ed_tag }}
run: npm publish ./packs/ui --access public --tag ${{ env.ed_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

- name: Publish @easydata/crud
run: npm publish packs/crud --access public --tag ${{ env.ed_tag }}
run: npm publish ./packs/crud --access public --tag ${{ env.ed_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ dist/
/playground/**/ts/**/*.js
!/playground/**/ts/styles.js
/easydata.net/src/**/EasyData*.xml
/playground/**/wwwroot/css/easydata.css
/playground/**/wwwroot/css/easydata.css.map
/playground/EasyDataTest
/playground/EasyDataTest02
/playground/EasyDataAspNetCoreTest04
Expand All @@ -380,4 +382,7 @@ playground/EasyDataAspNetCoreTest01/EasyDataTest01.db-wal
playground/EasyDataAspNetCoreTest01/wwwroot/js/dashboard.js
playground/EasyDataAspNetCoreTest01/wwwroot/js/dashboard.js.map

.idea
.idea
dist2
docs2
.nx
19 changes: 0 additions & 19 deletions easydata.js/package.json

This file was deleted.

29 changes: 29 additions & 0 deletions easydata.js/packs/core/__tests__/assign-deep-array.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { expect, test } from 'vitest'
import {utils} from "../src/public_api"

test('AssignDeepArray', () => {
let object1 = {
arr: [
{
data: {
get: "bla",
set: "kek"
}
}
]
}

let object2 = {
arr: [
{
data: {
get: "why"
}
}
]

}

utils.assignDeep(object1, object2);
expect(object1.arr[0].data.get).toEqual(object2.arr[0].data.get);
})
14 changes: 14 additions & 0 deletions easydata.js/packs/core/__tests__/assign-deep-circular.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect, test } from 'vitest'
import {utils} from "../src/public_api"

test('AssignDeep', () => {
function A() {}
function B() {}
var a = new A();
var b = new B();
a.b = b;
b.a = a;

const result = utils.assignDeep({}, a);
expect(result.b.a).toEqual(a);
})
33 changes: 33 additions & 0 deletions easydata.js/packs/core/__tests__/assign-deep.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { expect, test } from 'vitest'
import {utils} from "../src/public_api"

test('AssignDeep', () => {
let object1 = {
data: {
get: "bla",
set: "kek"
},
val: "test",
};

let object2: any = {
data: {
get: "why"
},
prop: "hello",
};

let object3 = {
data: {
set: "ohh"
},
column: "test"
};

let result = utils.assignDeep(object1, object2, object3);
expect(result.data.get).toBe(object2.data.get);
expect(result.data.set).toBe(object3.data.set);
expect(result.val).toBe(object1.val);
expect(result.prop).toBe(object2.prop);
expect(result.column).toBe(object3.column);
})
24 changes: 24 additions & 0 deletions easydata.js/packs/core/__tests__/assign.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect, test } from 'vitest'
import {utils} from "../src/public_api";

test('Assign', () => {
let object1 = {
data: "Hello",
val: "test"
};

let object2 = {
data: "why",
prop: "hello",
};

let object3 = {
column: "test"
};

let result = utils.assign(object1, object2, object3);
expect(result.data).toBe(object2.data);
expect(result.prop).toBe(object2.prop);
expect(result.val).toBe(object1.val);
expect(result.column).toBe(object3.column);
})
32 changes: 32 additions & 0 deletions easydata.js/packs/core/__tests__/generate-id.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { expect, test } from 'vitest'
import {utils} from "../src/public_api";

// @ts-ignore
test('Generate ID', async () => {
const array = []

const gen_pack = () => {
for (let i = 0; i < 100; i++) {
array.push(utils.generateId('id'))
}
}

const delay = (ms: number) => {
// @ts-ignore
return new Promise((resolve, reject) => {
setTimeout(resolve, ms);
});
}

gen_pack()

for (let j = 0; j < 5; j++) {
await delay(1000)
gen_pack()
}

// @ts-ignore
const test = new Set(array)

expect(array.length).toEqual(test.size)
}, 20000)
6 changes: 6 additions & 0 deletions easydata.js/packs/core/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
10 changes: 0 additions & 10 deletions easydata.js/packs/core/jasmine.json

This file was deleted.

Loading

0 comments on commit 364cb2d

Please sign in to comment.