Explorar o código

simplify scripting system, dont use tsx anymore

Adam Shaw %!s(int64=3) %!d(string=hai) anos
pai
achega
c042110124

+ 2 - 2
packages/core/package.json

@@ -17,13 +17,13 @@
     "email": "[email protected]",
     "url": "http://arshaw.com/"
   },
+  "type": "module",
   "dependencies": {
     "preact": "^10.0.5",
     "tslib": "^2.1.0"
   },
   "devDependencies": {
     "@fullcalendar/workspace-scripts": "workspace:*",
-    "@types/node": "^16.11.7",
     "handlebars": "^4.1.2"
   },
   "scripts": {
@@ -40,7 +40,7 @@
     "./locales/*": "./src/locales/*.ts"
   },
   "generatedExports": {
-    "./locales-all": "./scripts/generate-locales-all.ts"
+    "./locales-all": "./scripts/generate-locales-all.js"
   },
   "iife": {
     ".": "FullCalendar",

+ 2 - 2
packages/core/scripts/generate-locales-all.ts → packages/core/scripts/generate-locales-all.js

@@ -23,11 +23,11 @@ export default async function() {
 TODO: more DRY
 */
 
-function isFilenameHidden(filename: string): boolean {
+function isFilenameHidden(filename) {
   return Boolean(filename.match(/^\./))
 }
 
-function removeExtension(path: string): string {
+function removeExtension(path) {
   const match = path.match(/^(.*)\.([^\/]*)$/)
   return match ? match[1] : path
 }

+ 0 - 3
packages/core/scripts/tsconfig.json

@@ -1,3 +0,0 @@
-{
-  "extends": "../../../tsconfig.node"
-}

+ 3 - 2
tests/package.json

@@ -2,6 +2,7 @@
   "private": true,
   "name": "@fullcalendar/standard-tests",
   "version": "0.0.0",
+  "type": "module",
   "dependencies": {
     "@fullcalendar/bootstrap": "workspace:*",
     "@fullcalendar/core": "workspace:*",
@@ -38,7 +39,7 @@
     "build": "workspace-scripts pkg:build --iife-only"
   },
   "generatedExports": {
-    ".": "./scripts/generate-index.ts"
+    ".": "./scripts/generate-index.js"
   },
   "exports": {
     ".": {
@@ -49,6 +50,6 @@
       "default": "./dist/.tsc/*.js",
       "types": "./dist/.tsc/*.d.ts"
     },
-    "./scripts/*": "./scripts/*.ts"
+    "./scripts/*": "./scripts/*.js"
   }
 }

+ 3 - 3
tests/scripts/generate-index.ts → tests/scripts/generate-index.js

@@ -1,8 +1,8 @@
 import { resolve as resolvePath } from 'path'
 import { readFile } from 'fs/promises'
 import handlebars from 'handlebars'
-import { capture } from '@fullcalendar/workspace-scripts/src/utils/exec'
-import { removeExt } from '@fullcalendar/workspace-scripts/src/utils/path'
+import { capture } from '@fullcalendar/workspace-scripts/utils/exec'
+import { removeExt } from '@fullcalendar/workspace-scripts/utils/path'
 
 export default async function main() {
   const templatePath = resolvePath('./src/index.ts')
@@ -42,6 +42,6 @@ export default async function main() {
   return code
 }
 
-function strToLines(s: string): string[] {
+function strToLines(s) {
   return s ? s.trim().split('\n') : []
 }

+ 2 - 3
tsconfig.node.json

@@ -1,9 +1,8 @@
 {
   "extends": "@tsconfig/node16/tsconfig.json",
   "compilerOptions": {
-    "module": "es2022",
-    "types": ["node"],
     "composite": true,
-    "noEmit": true
+    "module": "es2022",
+    "types": ["node"]
   }
 }