Skip to content

Commit

Permalink
feat: Chomp migration, windows build, GitHub CI (systemjs#2405)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Jul 24, 2022
1 parent 949272a commit db75ae4
Show file tree
Hide file tree
Showing 46 changed files with 900 additions and 10,505 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/size-impact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
- name: Setup git
uses: actions/checkout@v2
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Setup npm
run: npm install
- name: Setup Chomp
uses: guybedford/chomp-action@v1
- name: Report file size impact
run: node ./.github/workflows/size-impact/report-size-impact.mjs
env:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: main
pull_request:
branches: main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Chomp
uses: guybedford/chomp-action@v1
- name: Setup Node.js
uses: actions/setup-node@v2
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
with:
firefox-version: '89.0'
- name: Chomp Test
run: chomp test
env:
CI_BROWSER: /opt/hostedtoolcache/firefox/89.0/x64/firefox
CI_BROWSER_FLAGS: -headless
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License
-----------

Copyright (C) 2013-2018 Guy Bedford
Copyright (C) 2013-2022 Guy Bedford

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
12 changes: 0 additions & 12 deletions build-node.mjs

This file was deleted.

123 changes: 123 additions & 0 deletions chompfile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
version = 0.1

default-task = 'build'

extensions = [
'[email protected]:npm',
'[email protected]:footprint',
'[email protected]:terser',
'[email protected]:rollup',
'[email protected]:ncc'
]

[[task]]
name = 'build'
deps = ['dist/system.js', 'dist/system.min.js', 'dist/s.js', 'dist/s.min.js', 'dist/system-node.cjs', 'dist/extras/*.js']

[[task]]
target = 'dist/system.js'
deps = ['src/system.js', 'src/common.js', 'src/err-msg.js', 'src/features/*.js']
template = 'rollup'
[task.template-options]
onwarn = false
[task.template-options.output]
banner = '''/*!
* SystemJS #PJSON_VERSION
*/'''
format = 'iife'
strict = false
[[task.template-options.plugin]]
package = '@rollup/plugin-replace'
"process.env.SYSTEM_PRODUCTION" = 'false'
"process.env.SYSTEM_BROWSER" = 'true'

[[task]]
target = 'dist/s.js'
deps = ['src/s.js', 'src/common.js', 'src/err-msg.js', 'src/features/*.js']
template = 'rollup'
[task.template-options]
onwarn = false
[task.template-options.output]
banner = '''/*!
* SJS #PJSON_VERSION
*/'''
format = 'iife'
strict = false
[[task.template-options.plugin]]
package = '@rollup/plugin-replace'
"process.env.SYSTEM_PRODUCTION" = 'true'
"process.env.SYSTEM_BROWSER" = 'true'

[[task]]
deps = ['src/extras/#.js', 'src/common.js', 'src/err-msg.js', 'src/features/*.js']
target = 'dist/extras/#.js'
template = 'rollup'
[task.template-options]
onwarn = false
[task.template-options.output]
format = 'iife'
strict = false
[[task.template-options.plugin]]
package = '@rollup/plugin-replace'
"process.env.SYSTEM_PRODUCTION" = 'false'
"process.env.SYSTEM_BROWSER" = 'true'

[[task]]
target = 'dist/##.min.js'
dep = 'dist/##.js'
template = 'terser'
[task.template-options]
source-map = true
ecma = 5
keep_classnames = false
keep_fnames = false
safari10 = true
toplevel = true
[task.template-options.mangle]
eval = true
[task.template-options.compress]
arguments = true
hoist_funs = true
keep_fargs = false
pure_getters = true
passes = 2
unsafe = true

[[task]]
target = 'dist/system-node.cjs'
deps = ['src/system-node.js', 'package.json', 'src/common.js', 'src/err-msg.js', 'src/features/*.js']
template = 'ncc'
[task.template-options]
assets = false
esm = false

[[task]]
name = 'footprint'
template = 'footprint'
deps = ['dist/system.min.js', 'dist/s.min.js']

[[task]]
name = 'test'
deps = ['test:browser', 'test:internal', 'test:node']

[[task]]
name = 'test:browser:watch'
deps = ['dist/system.js', 'dist/extras/*.js', 'npm:install']
env = { WATCH_MODE = 'true' }
run = 'node test/server.mjs'

[[task]]
name = 'test:browser'
deps = ['dist/system.js', 'dist/extras/*.js', 'npm:install']
run = 'node test/server.mjs'

[[task]]
name = 'test:internal'
dep = 'npm:install'
env = { NODE_OPTIONS = '--unhandled-rejections=none' }
run = 'mocha -b test/import-map.mjs test/system-core.mjs test/url-resolution.mwjs'

[[task]]
name = 'test:node'
deps = ['dist/system-node.cjs', 'npm:install']
run = 'mocha --timeout 5000 -b test/system-node.mjs'
Loading

0 comments on commit db75ae4

Please sign in to comment.