Skip to content

Commit adbe100

Browse files
authored
Merge pull request #11 from themost-framework/update-rollup-and-build-script
update dependencies and build process
2 parents f86563e + 2bddb6b commit adbe100

20 files changed

Lines changed: 5668 additions & 1813 deletions

.github/workflows/npm-publish-next.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v1
12+
- uses: actions/setup-node@v2
1313
with:
14-
node-version: 12
14+
node-version: 20
1515
registry-url: https://registry.npmjs.org/
1616
- run: npm ci
17-
- run: npm run test:node
1817
- run: npm run build
1918
- run: npm publish --access=public
2019
env:

.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test-context.js
77
rollup.config.js
88
babel.config.js
99
tsconfig.json
10+
tsconfig.spec.json
1011

1112
# github
1213
.github
@@ -15,4 +16,7 @@ tsconfig.json
1516
.gitpod.yml
1617

1718
# typescript
18-
tsconfig.json
19+
tsconfig.json
20+
21+
# editor
22+
.idea

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2020, THEMOST LP
3+
Copyright (c) 2020-2026, THEMOST LP
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

karma.conf.js

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require('path');
12
module.exports = function (config) {
23
config.set({
34
//root path location to resolve paths defined in files and exclude
@@ -6,15 +7,7 @@ module.exports = function (config) {
67
exclude: [],
78
//files/patterns to load in the browser
89
files: [
9-
{pattern: 'test-context.js', watched: false}
10-
/*parameters:
11-
watched: if autoWatch is true all files that have set watched to true will be watched for changes
12-
served: should the files be served by Karma's webserver?
13-
included: should the files be included in the browser using <script> tag?
14-
nocache: should the files be served from disk on each request by Karma's webserver? */
15-
/*assets:
16-
{pattern: '*.html', watched:true, served:true, included:false}
17-
{pattern: 'images/*', watched:false, served:true, included:false} */
10+
{pattern: "spec/**/*.ts"}
1811
],
1912

2013
//executes the tests whenever one of watched files changes
@@ -27,7 +20,7 @@ module.exports = function (config) {
2720
logLevel: config.LOG_WARN, //config.LOG_DISABLE, config.LOG_ERROR, config.LOG_INFO, config.LOG_DEBUG
2821

2922
//list of frameworks you want to use, only jasmine is installed with this boilerplate
30-
frameworks: ['jasmine'],
23+
frameworks: ['jasmine', 'karma-typescript'],
3124
//list of browsers to launch and capture
3225
browsers: ['ChromeHeadlessNoSandbox'/*,'PhantomJS','Firefox','Edge','ChromeCanary','Opera','IE','Safari'*/],
3326
//list of reporters to use
@@ -52,7 +45,7 @@ module.exports = function (config) {
5245
//capture all console output and pipe it to the terminal, true is default
5346
captureConsole: false,
5447
//if true, Karma clears the context window upon the completion of running the tests, true is default
55-
clearContext: false,
48+
clearContext: true,
5649
//run the tests on the same window as the client, without using iframe or a new window, false is default
5750
runInParent: false,
5851
//true: runs the tests inside an iFrame; false: runs the tests in a new window, true is default
@@ -64,39 +57,26 @@ module.exports = function (config) {
6457
},
6558
plugins: [
6659
require('karma-jasmine'),
67-
require('karma-webpack'),
60+
require("karma-typescript"),
6861
require('karma-spec-reporter'),
6962
require('karma-jasmine-html-reporter'),
7063
require('karma-chrome-launcher')
7164
],
72-
/* karma-webpack config
73-
pass your webpack configuration for karma
74-
add `babel-loader` to the webpack configuration to make
75-
the ES6+ code in the test files readable to the browser
76-
eg. import, export keywords */
77-
webpack: {
78-
optimization: {
79-
minimize: false
80-
},
81-
devtool: 'inline-source-map',
82-
module: {
83-
rules: [
84-
{
85-
test: /\.js$/i,
86-
exclude: /(node_modules)/,
87-
loader: 'babel-loader'
88-
}
89-
]
90-
}
91-
},
9265
preprocessors: {
93-
//add webpack as preprocessor to support require() in test-suits .js files
94-
'test-context.js': ['webpack']
66+
"**/*.ts": "karma-typescript" // *.tsx for React Jsx
9567
},
96-
webpackMiddleware: {
97-
//turn off webpack bash output when run the tests
98-
noInfo: false,
99-
stats: 'errors-only'
68+
karmaTypescriptConfig: {
69+
tsconfig: "./tsconfig.spec.json",
70+
bundlerOptions: {
71+
transforms: [
72+
require('karma-typescript-es6-transform')()
73+
],
74+
resolve: {
75+
alias: {
76+
"@themost/xml": path.resolve(__dirname, './dist/index.js'),
77+
}
78+
}
79+
}
10080
},
10181
customLaunchers: {
10282
ChromeNoSandbox: {

0 commit comments

Comments
 (0)