Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ main, develop ]
branches: [ "main", "develop" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, develop ]
branches: [ "main", "develop" ]
schedule:
- cron: '38 23 * * 1'
- cron: '44 22 * * 5'

jobs:
analyze:
Expand All @@ -32,10 +32,11 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
language: [ 'javascript-typescript' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@next2d/framework-typescript-template",
"description": "Next2D Framework default TypeScript template.",
"version": "1.0.2",
"version": "2.0.0",
"homepage": "https://next2d.app",
"bugs": "https://github.com/Next2D/framework-typescript-template/issues/new",
"author": "Toshiyuki Ienaga<ienaga@tvon.jp>",
"author": "Toshiyuki Ienaga<ienaga@next2d.app>",
"license": "MIT",
"keywords": [
"Next2D",
Expand Down
11 changes: 1 addition & 10 deletions template.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
{
"package": {
"dependencies": {
"@next2d/webpack-typescript-auto-loader-plugin": "*",
"@babel/core": "*",
"@babel/plugin-transform-modules-commonjs": "*",
"@babel/preset-env": "*",
"@types/jest": "*",
"@typescript-eslint/eslint-plugin": "*",
"@typescript-eslint/parser": "*",
"ts-jest": "*",
"ts-loader": "*",
"ts-node": "*",
"typescript": "*",
"eslint": "*",
"eslint-webpack-plugin": "*"
"eslint": "*"
}
}
}
5 changes: 3 additions & 2 deletions template/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"env": {
"es6": true
"browser": true,
"es2021": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2017
"ecmaVersion": "latest"
},
"extends": "plugin:@typescript-eslint/eslint-recommended",
"parser": "@typescript-eslint/parser",
Expand Down
25 changes: 21 additions & 4 deletions template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
coverage
dist-ssr
*.local

.DS_Store
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
Thumbs.db
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

src/Packages.ts
src/config/Config.ts
electron.index.json
electron.index.json
3 changes: 1 addition & 2 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ Multi-platform builder, writes to various platforms including macOS, Windows, iO
Builds apps for the environment specified by env=***.

### Flowchart
![Flowchart](https://raw.githubusercontent.com/Next2D/framework/main/Framework_Flowchart.svg)

![Flowchart](https://raw.githubusercontent.com/Next2D/framework/main/Framework_Flowchart.svg)
Empty file removed template/__tests__/model/empty
Empty file.
11 changes: 11 additions & 0 deletions template/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Local Environments</title>
<script type="module" src="./src/index.ts"></script>
</head>
<body style="margin: 0; padding: 0;">
</body>
</html>
58 changes: 29 additions & 29 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@
"author": "Toshiyuki Ienaga <ienaga@tvon.jp>",
"license": "MIT",
"main": "src/index.ts",
"type": "module",
"scripts": {
"start": "webpack serve",
"ios": "npx @next2d/builder run ios --platform ios --debug",
"android": "npx @next2d/builder run android --platform android --debug",
"macos": "npx @next2d/builder --platform macos --debug",
"windows": "npx @next2d/builder --platform windows --debug",
"build": "npx @next2d/builder",
"lint": "eslint src/**/*.js",
"test": "npx jest",
"start": "vite",
"dev:ios": "npx @next2d/builder run ios --platform ios --debug",
"dev:android": "npx @next2d/builder run android --platform android --debug",
"dev:macos": "npx @next2d/builder --platform macos --debug",
"dev:windows": "npx @next2d/builder --platform windows --debug",
"dev:linux": "npx @next2d/builder --platform linux --debug",
"build:steam:windows": "npx @next2d/builder --platform steam:windows --env prd",
"build:steam:mac": "npx @next2d/builder --platform steam:mac --env prd",
"build:steam:linux": "npx @next2d/builder --platform steam:linux --env prd",
"build:web": "npx @next2d/builder --platform web --env prd",
"build": "vite build",
"lint": "eslint src/**/*.ts",
"test": "npx vitest",
"generate": "npx @next2d/view-generator"
},
"devDependencies": {
"@babel/core": "^7.22.11",
"@babel/preset-env": "^7.22.14",
"@capacitor/android": "^5.3.0",
"@capacitor/cli": "^5.3.0",
"@capacitor/core": "^5.3.0",
"@capacitor/ios": "^5.3.0",
"@next2d/env": "^1.1.1",
"@next2d/framework": "^1.6.2",
"@next2d/webpack-typescript-auto-loader-plugin": "^1.0.1",
"@types/jest": "^29.5.4",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"electron": "^26.1.0",
"eslint": "^8.48.0",
"eslint-webpack-plugin": "^4.0.1",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"@capacitor/android": "^5.5.1",
"@capacitor/cli": "^5.5.1",
"@capacitor/core": "^5.5.1",
"@capacitor/ios": "^5.5.1",
"@next2d/env": "^2.0.2",
"@next2d/framework": "^2.0.0",
"@next2d/player": "^1.18.9",
"@next2d/vite-auto-loader-plugin": "^0.0.7",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"electron": "^27.0.3",
"eslint": "^8.53.0",
"jsdom": "^22.1.0",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"vite": "^4.5.0",
"vitest": "^0.34.6"
}
}
19 changes: 0 additions & 19 deletions template/src/App.ts

This file was deleted.

49 changes: 22 additions & 27 deletions template/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
"use strict";

import "@next2d/framework";

import { App } from "@/App";
import { app } from "@next2d/framework";
// @ts-ignore
import { config } from "@/config/Config";
// @ts-ignore
import { packages } from "@/Packages";

const app: App = new App(config, packages);
if (document.readyState === "loading") {

const initialize = (event: Event) =>
{
if (!event.target) {
return ;
}

event.target.removeEventListener("DOMContentLoaded", initialize);
app
.run()
.then(() =>
{
app.gotoView();
});
};

window.addEventListener("DOMContentLoaded", initialize);

} else {
/**
* @return {void}
* @method
* @private
*/
const boot = (event: Event | null = null): void =>
{
if (event && event.target) {
event.target.removeEventListener("DOMContentLoaded", boot);
}

app
.initialize(config, packages)
.run()
.then(() =>
.then((): void =>
{
app.gotoView();
});
};

if (document.readyState === "loading") {

window.addEventListener("DOMContentLoaded", boot);

} else {

}
boot();

export { app };
}
Loading