Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a32b402
fix: ESM by using import with file extensions
JumpLink Jul 12, 2022
d3a040f
fix: Fix jest config to allow .js extensions
JumpLink Jul 12, 2022
983bec6
fix: Fix angular webpack config to allow .js extensions
JumpLink Jul 12, 2022
1c8f7b0
fix: Add custom angular webpack config for api-console-guiFix to allo…
JumpLink Jul 13, 2022
2cfedb4
Merge branch 'master' into esm-extension-import
JumpLink Jul 18, 2022
f31e5c8
Merge branch 'master' into esm-extension-import
JumpLink Jul 18, 2022
02041ea
chore: Lint import file extensions
JumpLink Jul 18, 2022
fac976b
chore: New lint:ext npm script
JumpLink Jul 18, 2022
47f3679
Merge branch 'esm-extension-import' into lint-file-extension
JumpLink Jul 18, 2022
6208747
Merge master into lint-file-extension
JumpLink Jul 19, 2022
3f11d2b
Merge master into esm-extension-import
JumpLink Jul 19, 2022
4671f8a
Merge branch 'esm-extension-import' into lint-file-extension
JumpLink Jul 19, 2022
527dc84
Merge branch 'master' into esm-extension-import
JumpLink Jul 19, 2022
ee66dda
fix(rpc-tests): Fix import MemoryLoggerTransport
JumpLink Jul 19, 2022
c79d567
Merge branch 'master' into esm-extension-import
JumpLink Jul 19, 2022
0c77420
Merge branch 'esm-extension-import' into lint-file-extension
JumpLink Jul 19, 2022
4451660
fix: ESM imports for api-console-gui
JumpLink Jul 19, 2022
5741844
fix: Fix require and __dirname for ESM
JumpLink Jul 19, 2022
276f7e2
chore(example-app): Move from CJS to ESM
JumpLink Jul 19, 2022
ac0b8d6
Merge branch 'esm-extension-import' of github.com:gjsify/deepkit-fram…
JumpLink Jul 19, 2022
6dbfc39
chore(example-app): Add support for ESM and CJS
JumpLink Jul 19, 2022
75f27fa
chore: Moved getDirname to @deepkit/core
JumpLink Jul 19, 2022
f4b9b66
Merge branch 'master' into esm-extension-import
JumpLink Jul 19, 2022
d6772eb
chore(esm): Add Node.js independent __dirname implementation
JumpLink Jul 20, 2022
de393a7
fix: Fix jsx and test by removing jsx.Fragment
JumpLink Jul 20, 2022
f8bdd4e
fix: Invalid json in packages/example-app/tsconfig.json
JumpLink Jul 20, 2022
9e201b8
fix: ng build deprecated --prod warning
JumpLink Jul 20, 2022
295417c
Merge branch 'esm-extension-import' into lint-file-extension
JumpLink Jul 20, 2022
4cd70d1
fix: Try to fix jsx and test by set jsx.Fragment to undefined
JumpLink Jul 20, 2022
94b460e
feat(platform): Initial new package
JumpLink Jul 22, 2022
ef262b2
chore(platform): Make use of the new platform package
JumpLink Jul 22, 2022
3e14209
chore(github): Add github action workflows for the new platform package
JumpLink Jul 22, 2022
bf2fa23
fix(platform): Add platform as dependency
JumpLink Jul 22, 2022
7ce435c
Merge remote-tracking branch 'upstream/master' into esm-extension-import
JumpLink Jul 22, 2022
9d54527
chore(github): Use npm ci instead of npm install
JumpLink Jul 22, 2022
10ac9d5
chore(github): Use bootstrap:ci instead of bootstrap
JumpLink Jul 22, 2022
c4e495a
chore(github): Update package-lock.json
JumpLink Jul 22, 2022
e406f7e
fix(framework): Install @deepkit/platform as a default dependency (no…
JumpLink Jul 22, 2022
211b68f
chore(github): Platform tests: Only run bootstrap:ci for @deepkit/pla…
JumpLink Jul 22, 2022
7b5ed00
chore(github): Platform tests: Also run bootstrap:ci for @deepkit/typ…
JumpLink Jul 22, 2022
29fafc5
chore(github): Platform tests: Do not link the packages (platform has…
JumpLink Jul 22, 2022
6cecae4
Merge branch 'master' into esm-extension-import
JumpLink Jul 25, 2022
09a5055
Merge branch 'esm-extension-import' into lint-file-extension
JumpLink Jul 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ on:
push:

jobs:
lint:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
uses: actions/cache@v1
with:
path: "**/node_modules"
key: ${{ runner.os }}-all2-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: npm install
run: npm ci
- name: Check import file extensions
run: npm run lint
npm run lint:ext

unit-tests:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/platform-browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Browser
on:
pull_request:
push:

jobs:
browser:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install NPM dependencies
run: npm ci
- name: Bootstrap
run: npm run bootstrap:ci -- --scope="@deepkit/platform"
# - name: Link
# run: npm run link
# - name: Install compiler
# run: npm run install-compiler
- name: Build
run: npm run lerna -- build --scope="@deepkit/platform"
- name: Test
run: npm run lerna -- test:browser --scope="@deepkit/platform"
39 changes: 39 additions & 0 deletions .github/workflows/platform-deno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deno
on:
pull_request:
push:

jobs:
build:
strategy:
matrix:
node-version: [ 16.x]
deno-version: [ vx.x.x ]
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Setup Deno
uses: denolib/setup-deno@v2
with:
deno-version: ${{ matrix.deno-version }}
- name: Install NPM dependencies
run: npm ci
- name: Bootstrap
run: npm run bootstrap:ci -- --scope="@deepkit/platform"
# - name: Link
# run: npm run link
# - name: Install compiler
# run: npm run install-compiler
- name: Build
run: npm run lerna -- build --scope="@deepkit/platform"
- name: Test
run: npm run lerna -- test:deno --scope="@deepkit/platform"
29 changes: 29 additions & 0 deletions .github/workflows/platform-gjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: GJS
on:
pull_request:
push:

jobs:
linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install GJS
run: sudo apt-get --yes install gjs
- name: Install NPM dependencies
run: npm ci
- name: Bootstrap
run: npm run bootstrap:ci -- --scope="@deepkit/platform"
# - name: Link
# run: npm run link
# - name: Install compiler
# run: npm run install-compiler
- name: Build
run: npm run lerna -- build --scope="@deepkit/platform"
- name: Test
run: npm run lerna -- test:gjs --scope="@deepkit/platform"
34 changes: 34 additions & 0 deletions .github/workflows/platform-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Node.js
on:
pull_request:
push:

jobs:
build:
strategy:
matrix:
node-version: [ 16.x ]
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install NPM dependencies
run: npm ci
- name: Bootstrap
run: npm run bootstrap:ci -- --scope="@deepkit/platform"
# - name: Link
# run: npm run link
# - name: Install compiler
# run: npm run install-compiler
- name: Build
run: npm run lerna -- build --scope="@deepkit/platform"
- name: Test
run: npm run lerna -- test:node --scope="@deepkit/platform"
74 changes: 74 additions & 0 deletions lint-file-extension.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
const path = require('path');
const fs = require('fs/promises');

const search = async (dir, regex, ext, exclude) => {
const files = await getFiles(dir, ext, exclude);
const result = [];

for (file of files) {
const content = await fs.readFile(file, 'utf8');

if (regex.test(content)) {
result.push(file);
}
};

return result;
}

/**
*
* @param {string} dir
* @param {string} ext
* @param {string[]} excludes
* @returns
*/
const getFiles = async (dir, ext, excludes) => {
let files = [];

if(excludes.find(exclude => dir.includes(exclude))) {
console.debug("exclude", dir)
return files;
}

const stat = await fs.lstat(dir);
if (!stat.isDirectory()) {
return files;
}

const dirFiles = await fs.readdir(dir);

for (let file of dirFiles) {
const filePath = path.join(dir, file);

if(excludes.find(exclude => filePath.includes(exclude))) {
continue
}

const stat = await fs.lstat(filePath);

if (stat.isDirectory()) {
const nestedFiles = await getFiles(filePath, ext, excludes);
files = files.concat(nestedFiles);
} else if (stat.isFile()) {
if (path.extname(file) === ext) {
files.push(filePath);
}
}
};

return files;
}

search('./packages', /(import|from) ("|')\..*(?<!.js)("|')/g, '.ts', ['dist', 'node_modules', 'compiler.spec.ts']).then((files)=> {
if(files.length) {
console.error(`Imports without file extension found!`);
console.error('\t' + files.join('\n\t'));
process.exit(1);
}
console.info("All imports are looking good :)");
process.exit(0);

}).catch((error) => {
console.error(error);
})
Loading