-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from KorzhCom/dev
Version 1.4.20 of EasyData.JS. Switch to rollup and lerna
- Loading branch information
Showing
89 changed files
with
2,165 additions
and
1,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 }} | ||
|
@@ -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 }} | ||
|
||
|
@@ -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 }} | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
easydata.js/packs/core/__tests__/assign-deep-array.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
14
easydata.js/packs/core/__tests__/assign-deep-circular.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.